diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58fc28e9381..a306c774578 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,10 @@ on: - 'integrated/**' - 'stl-preview-head/**' - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -18,6 +22,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -35,24 +40,40 @@ jobs: - name: Run lints run: ./scripts/lint - upload: - if: github.repository == 'stainless-sdks/cloudflare-python' + build: + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork timeout-minutes: 10 - name: upload + name: build permissions: contents: read id-token: write - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.44.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Install dependencies + run: rye sync --all-features + + - name: Run build + run: rye build + - name: Get GitHub OIDC Token + if: github.repository == 'stainless-sdks/cloudflare-python' id: github-oidc uses: actions/github-script@v6 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball + if: github.repository == 'stainless-sdks/cloudflare-python' env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} @@ -63,6 +84,7 @@ jobs: timeout-minutes: 30 name: test runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -84,7 +106,7 @@ jobs: timeout-minutes: 10 name: examples runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.repository == 'cloudflare/cloudflare-python' + if: github.repository == 'cloudflare/cloudflare-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/detect-breaking-changes.yml b/.github/workflows/detect-breaking-changes.yml new file mode 100644 index 00000000000..b150d7a217f --- /dev/null +++ b/.github/workflows/detect-breaking-changes.yml @@ -0,0 +1,42 @@ +name: CI +on: + pull_request: + branches: + - main + - next + +jobs: + detect_breaking_changes: + runs-on: 'ubuntu-latest' + name: detect-breaking-changes + if: github.repository == 'cloudflare/cloudflare-python' + steps: + - name: Calculate fetch-depth + run: | + echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV + + - uses: actions/checkout@v4 + with: + # Ensure we can check out the pull request base in the script below. + fetch-depth: ${{ env.FETCH_DEPTH }} + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.44.0' + RYE_INSTALL_OPTION: '--yes' + - name: Install dependencies + run: | + rye sync --all-features + - name: Detect removed symbols + run: | + rye run python scripts/detect-breaking-changes.py "${{ github.event.pull_request.base.sha }}" + + - name: Detect breaking changes + run: | + # Try to check out previous versions of the breaking change detection script. This ensures that + # we still detect breaking changes when entire files and their tests are removed. + git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true + ./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 87797408001..95ceb189aa4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .prism.log -.vscode _dev __pycache__ diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 025a1cbcb11..8e76abb5c08 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.3.1" + ".": "5.0.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 590d127c2cb..3cbe618382c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1752 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b15b44e0efd207de48e7e74e742b0b4b190c74f12a941a1a0ef59a51656a5224.yml -openapi_spec_hash: 83243c9ee06f88d0fa91e9b185d8a42e -config_hash: 8601d43fd5ccaf9e3d08f26748a5a63a +configured_endpoints: 1859 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7c981c72c3b84f1b39c664311bcc286c0965bf2833955853107bc1988cc5ff25.yml +openapi_spec_hash: d4b77a5657c299c78a79bb3e5b326fef +config_hash: 8255527f164e4993d48cc97c8e0b3afb diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000000..5b01030785f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.importFormat": "relative", +} diff --git a/CHANGELOG.md b/CHANGELOG.md index e63418f4e7a..5c2abfc300f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,67 @@ # Changelog +## 5.0.0 (2025-10-23) + +Full Changelog: [v4.3.1...v5.0.0](https://github.com/cloudflare/cloudflare-python/compare/v4.3.1...v5.0.0) + +### Features + +* chore(abuse): rename path parameter ([dd0b6fb](https://github.com/cloudflare/cloudflare-python/commit/dd0b6fbd8042a4cde1625d945369b28d6e69bbb0)) +* docs(zero_trust_gateway_policy): add /rules/tenants endpoint to Gateway API docs ([3c18fd3](https://github.com/cloudflare/cloudflare-python/commit/3c18fd307d5cf804eb9d68c8474d5ecc5f481a3e)) +* feat: add connectivity directory service APIs to openapi.stainless.yml ([fc06837](https://github.com/cloudflare/cloudflare-python/commit/fc06837d768b4291bbaa1d9a5e0d3303d0a82ba1)) +* feat: SDKs for Organizations and OrganizationsProfile ([3c3adc5](https://github.com/cloudflare/cloudflare-python/commit/3c3adc5853478da4154805746ac19ffa6e6b4b4e)) +* feat(api): add mcp portals endpoints ([70e068e](https://github.com/cloudflare/cloudflare-python/commit/70e068e9497013d0c8d8e7689ae87b3beafeeb46)) +* feat(radar): add new group by dimension endpoints; deprecate to_markdown endpoint ([845fba2](https://github.com/cloudflare/cloudflare-python/commit/845fba278d6d58c6b4b8de8fa54d02efdc4dddee)) +* fix(ai): rename duplicate parameter in the to_markdown subresource ([e107db1](https://github.com/cloudflare/cloudflare-python/commit/e107db1913c43406acd175d54bc683c11c911bba)) +* fix(api): RAG-286: Add to_markdown subresource to AI resource ([73fa6b1](https://github.com/cloudflare/cloudflare-python/commit/73fa6b1db9654ff802653cebe3aa0c05d182f68b)) +* fix(content_scanning): content scanning terraform resource ([16983e5](https://github.com/cloudflare/cloudflare-python/commit/16983e574240d5656e5e32ffc0494627970a859e)) + + +### Bug Fixes + +* do not set headers with default to omit ([7b7b62f](https://github.com/cloudflare/cloudflare-python/commit/7b7b62fbc7caa0b81e2c828cb48b9fc137a1345c)) + + +### Chores + +* **api:** update composite API spec ([5f5caef](https://github.com/cloudflare/cloudflare-python/commit/5f5caef1eed2c6a2c5cd80b77c2c7e01e19e57fc)) +* **api:** update composite API spec ([5d19869](https://github.com/cloudflare/cloudflare-python/commit/5d1986964f7344c79285a47c9bd4ae6928805ed5)) +* **api:** update composite API spec ([541c9fb](https://github.com/cloudflare/cloudflare-python/commit/541c9fb7974741641bcef74ba99f7b54f142e0b1)) +* **api:** update composite API spec ([ba5b5fc](https://github.com/cloudflare/cloudflare-python/commit/ba5b5fcd1936b0cadb189ba4c2c674dc6ec956e3)) +* **api:** update composite API spec ([7baa51c](https://github.com/cloudflare/cloudflare-python/commit/7baa51ccf00f66c8871156e674214504984dc066)) +* **api:** update composite API spec ([53d59f4](https://github.com/cloudflare/cloudflare-python/commit/53d59f439ba34edaf2628d89c2a1d7363693a38d)) +* **api:** update composite API spec ([25d603f](https://github.com/cloudflare/cloudflare-python/commit/25d603f8cb36473107bb739c1217a10becd82302)) +* **api:** update composite API spec ([9fd6645](https://github.com/cloudflare/cloudflare-python/commit/9fd66450b998a9b0bea72a8f3ac9fdcb26edd88a)) +* **api:** update composite API spec ([19d1d96](https://github.com/cloudflare/cloudflare-python/commit/19d1d96bae88d6af838574218fc09b541a94da81)) +* **api:** update composite API spec ([f9160a4](https://github.com/cloudflare/cloudflare-python/commit/f9160a47dec2c31bc7f591bc73bc9dff420d10f4)) +* **api:** update composite API spec ([c686a51](https://github.com/cloudflare/cloudflare-python/commit/c686a511cc457bb92c7ba7e0c0593fe871b56744)) +* **api:** update composite API spec ([412ed20](https://github.com/cloudflare/cloudflare-python/commit/412ed203f44de2e2c45996bb9382f6278f05fa55)) +* **api:** update composite API spec ([119f889](https://github.com/cloudflare/cloudflare-python/commit/119f889eaf1bc73df1a6cb1e96c44aae289f5a7c)) +* **api:** update composite API spec ([65382bf](https://github.com/cloudflare/cloudflare-python/commit/65382bf11bc785cb991cb57cbee6f0f6f155ad54)) +* **api:** update composite API spec ([b3a3cf6](https://github.com/cloudflare/cloudflare-python/commit/b3a3cf678acf7db925104ecd3ecc2b68767b5081)) +* **api:** update composite API spec ([c78ef5e](https://github.com/cloudflare/cloudflare-python/commit/c78ef5e952f7f7db180e312d7175188810ff6a95)) +* **api:** update composite API spec ([71a023c](https://github.com/cloudflare/cloudflare-python/commit/71a023cf63064090e9aa27e08ac3b0ad6f468cde)) +* **api:** update composite API spec ([3805db3](https://github.com/cloudflare/cloudflare-python/commit/3805db3abfdb8cb11dd13483f670f3264eec8360)) +* **api:** update composite API spec ([c882cba](https://github.com/cloudflare/cloudflare-python/commit/c882cba3a638fd663068ba565bfd3bba9dd90aaf)) +* **api:** update composite API spec ([06eb2a6](https://github.com/cloudflare/cloudflare-python/commit/06eb2a664feed8661b93b893a1cd00e268688a54)) +* **api:** update composite API spec ([10c56f8](https://github.com/cloudflare/cloudflare-python/commit/10c56f863ddf61d3afd53d372a27aa548ad0c28e)) +* **api:** update composite API spec ([e0335d9](https://github.com/cloudflare/cloudflare-python/commit/e0335d95451835f2dfbe7e8359cf896ce18c7477)) +* **api:** update composite API spec ([1cf726b](https://github.com/cloudflare/cloudflare-python/commit/1cf726be6956545c246e4dc95bd424517c36c536)) +* **api:** update composite API spec ([9889b9c](https://github.com/cloudflare/cloudflare-python/commit/9889b9c66902d2972c155d22c4555f627be1466a)) +* **api:** update composite API spec ([f5bb242](https://github.com/cloudflare/cloudflare-python/commit/f5bb242a6cf35eaa836e55f4416c79ee6f69bdae)) +* **api:** update composite API spec ([21d2e59](https://github.com/cloudflare/cloudflare-python/commit/21d2e59197addafe432fd98c5e87fac049bff5a9)) +* **api:** update composite API spec ([7f579af](https://github.com/cloudflare/cloudflare-python/commit/7f579af8d53449c32d8e9b9811b0114846143e92)) +* **api:** update composite API spec ([2edb41d](https://github.com/cloudflare/cloudflare-python/commit/2edb41d57375c44c0decab1b543107ef29c9e4fa)) +* **api:** update composite API spec ([9f0c410](https://github.com/cloudflare/cloudflare-python/commit/9f0c41036972ebd198387db974ac3c745a31413d)) +* **api:** update composite API spec ([3836b7d](https://github.com/cloudflare/cloudflare-python/commit/3836b7d0562b8eee8e5eadb3e767279100165558)) +* **api:** update composite API spec ([e428a7a](https://github.com/cloudflare/cloudflare-python/commit/e428a7ab287a145089def4550e757166c9c0f5d7)) +* **api:** update composite API spec ([7476108](https://github.com/cloudflare/cloudflare-python/commit/7476108e928740002fdb715ec6ebfd0b6e483385)) +* **api:** update composite API spec ([36ca7ff](https://github.com/cloudflare/cloudflare-python/commit/36ca7ff17b14cbf5de4a0a402f7e0285f434db0f)) +* **api:** update composite API spec ([c6223b6](https://github.com/cloudflare/cloudflare-python/commit/c6223b6cd102cd3cd90ec2fb78af0d747094c1d7)) +* **api:** update composite API spec ([7e91dae](https://github.com/cloudflare/cloudflare-python/commit/7e91dae9b0671edb8e293d8b57e2fef73cb0addf)) +* **api:** update composite API spec ([826266e](https://github.com/cloudflare/cloudflare-python/commit/826266e34574063bc1bc970c222b50fbcc0503c3)) +* **api:** update composite API spec ([cd0aa66](https://github.com/cloudflare/cloudflare-python/commit/cd0aa6681605ed620578082640c37e50410eb136)) + ## 4.3.1 (2025-06-16) Full Changelog: [v4.3.0...v4.3.1](https://github.com/cloudflare/cloudflare-python/compare/v4.3.0...v4.3.1) diff --git a/README.md b/README.md index 755e3162353..4e08fb20437 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Cloudflare Python API library -[![PyPI version](https://img.shields.io/pypi/v/cloudflare.svg)](https://pypi.org/project/cloudflare/) + +[![PyPI version](https://img.shields.io/pypi/v/cloudflare.svg?label=pypi%20(stable))](https://pypi.org/project/cloudflare/) The Cloudflare Python library provides convenient access to the Cloudflare REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, @@ -70,6 +71,41 @@ asyncio.run(main()) Functionality between the synchronous and asynchronous clients is otherwise identical. +### With aiohttp + +By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend. + +You can enable this by installing `aiohttp`: + +```sh +# install from PyPI +pip install cloudflare[aiohttp] +``` + +Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: + +```python +import asyncio +from cloudflare import DefaultAioHttpClient +from cloudflare import AsyncCloudflare + + +async def main() -> None: + async with AsyncCloudflare( + api_token="Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY", + http_client=DefaultAioHttpClient(), + ) as client: + zone = await client.zones.create( + account={"id": "023e105f4ecef8ad9ca31a8372d0c353"}, + name="example.com", + type="full", + ) + print(zone.id) + + +asyncio.run(main()) +``` + ## Using types Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like: @@ -244,7 +280,7 @@ client.with_options(max_retries=5).zones.get( ### Timeouts By default requests time out after 1 minute. You can configure this with a `timeout` option, -which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: +which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object: ```python from cloudflare import Cloudflare diff --git a/api.md b/api.md index 04738525ed2..f90be0d2567 100644 --- a/api.md +++ b/api.md @@ -110,8 +110,8 @@ from cloudflare.types.accounts.tokens import PermissionGroupListResponse, Permis Methods: -- client.accounts.tokens.permission_groups.list(\*, account_id) -> SyncSinglePage[PermissionGroupListResponse] -- client.accounts.tokens.permission_groups.get(\*, account_id) -> SyncSinglePage[PermissionGroupGetResponse] +- client.accounts.tokens.permission_groups.list(\*, account_id, \*\*params) -> SyncSinglePage[PermissionGroupListResponse] +- client.accounts.tokens.permission_groups.get(\*, account_id, \*\*params) -> Optional[PermissionGroupGetResponse] ### Value @@ -131,7 +131,36 @@ from cloudflare.types.accounts.logs import AuditListResponse Methods: -- client.accounts.logs.audit.list(\*, account_id, \*\*params) -> SyncCursorLimitPagination[AuditListResponse] +- client.accounts.logs.audit.list(\*, account_id, \*\*params) -> SyncCursorPaginationAfter[AuditListResponse] + +# Organizations + +Types: + +```python +from cloudflare.types.organizations import Organization, OrganizationDeleteResponse +``` + +Methods: + +- client.organizations.create(\*\*params) -> Organization +- client.organizations.update(organization_id, \*\*params) -> Organization +- client.organizations.list(\*\*params) -> SyncSinglePage[Organization] +- client.organizations.delete(organization_id) -> OrganizationDeleteResponse +- client.organizations.get(organization_id) -> Organization + +## OrganizationProfile + +Types: + +```python +from cloudflare.types.organizations import OrganizationProfile +``` + +Methods: + +- client.organizations.organization_profile.update(organization_id, \*\*params) -> None +- client.organizations.organization_profile.get(organization_id) -> Result # OriginCACertificates @@ -297,7 +326,7 @@ from cloudflare.types.user.tokens import PermissionGroupListResponse Methods: -- client.user.tokens.permission_groups.list() -> SyncSinglePage[PermissionGroupListResponse] +- client.user.tokens.permission_groups.list(\*\*params) -> SyncSinglePage[PermissionGroupListResponse] ### Value @@ -537,6 +566,23 @@ Methods: - client.load_balancers.monitors.references.get(monitor_id, \*, account_id) -> SyncSinglePage[ReferenceGetResponse] +## MonitorGroups + +Types: + +```python +from cloudflare.types.load_balancers import MonitorGroup +``` + +Methods: + +- client.load_balancers.monitor_groups.create(\*, account_id, \*\*params) -> MonitorGroup +- client.load_balancers.monitor_groups.update(monitor_group_id, \*, account_id, \*\*params) -> MonitorGroup +- client.load_balancers.monitor_groups.list(\*, account_id) -> SyncSinglePage[MonitorGroup] +- client.load_balancers.monitor_groups.delete(monitor_group_id, \*, account_id) -> MonitorGroup +- client.load_balancers.monitor_groups.edit(monitor_group_id, \*, account_id, \*\*params) -> MonitorGroup +- client.load_balancers.monitor_groups.get(monitor_group_id, \*, account_id) -> MonitorGroup + ## Pools Types: @@ -760,7 +806,7 @@ from cloudflare.types.ssl import RecommendationGetResponse Methods: -- client.ssl.recommendations.get(\*, zone_id) -> Optional[RecommendationGetResponse] +- client.ssl.recommendations.get(\*, zone_id) -> RecommendationGetResponse ## Universal @@ -1026,12 +1072,6 @@ Methods: # DNS -Types: - -```python -from cloudflare.types.dns import DNSAnalyticsNominalMetric, DNSAnalyticsQuery -``` - ## DNSSEC Types: @@ -1083,6 +1123,8 @@ from cloudflare.types.dns import ( RecordExportResponse, RecordImportResponse, RecordScanResponse, + RecordScanReviewResponse, + RecordScanTriggerResponse, ) ``` @@ -1098,15 +1140,12 @@ Methods: - client.dns.records.get(dns_record_id, \*, zone_id) -> Optional[RecordResponse] - client.dns.records.import\_(\*, zone_id, \*\*params) -> Optional[RecordImportResponse] - client.dns.records.scan(\*, zone_id, \*\*params) -> Optional[RecordScanResponse] +- client.dns.records.scan_list(\*, zone_id) -> SyncSinglePage[RecordResponse] +- client.dns.records.scan_review(\*, zone_id, \*\*params) -> Optional[RecordScanReviewResponse] +- client.dns.records.scan_trigger(\*, zone_id) -> RecordScanTriggerResponse ## Settings -Types: - -```python -from cloudflare.types.dns import DNSSetting -``` - ### Zone Types: @@ -1600,7 +1639,7 @@ Methods: Types: ```python -from cloudflare.types.filters import FirewallFilter +from cloudflare.types.filters import FirewallFilter, FilterDeleteResponse, FilterBulkDeleteResponse ``` Methods: @@ -1608,9 +1647,9 @@ Methods: - client.filters.create(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallFilter] - client.filters.update(filter_id, \*, zone_id, \*\*params) -> FirewallFilter - client.filters.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[FirewallFilter] -- client.filters.delete(filter_id, \*, zone_id) -> FirewallFilter -- client.filters.bulk_delete(\*, zone_id) -> SyncSinglePage[FirewallFilter] -- client.filters.bulk_update(\*, zone_id) -> SyncSinglePage[FirewallFilter] +- client.filters.delete(filter_id, \*, zone_id) -> FilterDeleteResponse +- client.filters.bulk_delete(\*, zone_id, \*\*params) -> Optional[FilterBulkDeleteResponse] +- client.filters.bulk_update(\*, zone_id, \*\*params) -> SyncSinglePage[FirewallFilter] - client.filters.get(filter_id, \*, zone_id) -> FirewallFilter # Firewall @@ -1862,8 +1901,8 @@ from cloudflare.types.logpush import InstantLogpushJob Methods: -- client.logpush.edge.create(\*, zone_id, \*\*params) -> Optional[InstantLogpushJob] -- client.logpush.edge.get(\*, zone_id) -> SyncSinglePage[Optional[InstantLogpushJob]] +- client.logpush.edge.create(\*, zone_id, \*\*params) -> Optional[InstantLogpushJob] +- client.logpush.edge.get(\*, zone_id) -> SyncSinglePage[Optional[InstantLogpushJob]] ## Jobs @@ -2261,6 +2300,40 @@ Types: from cloudflare.types.workers import MigrationStep, SingleStepMigration, WorkerMetadata ``` +## Beta + +### Workers + +Types: + +```python +from cloudflare.types.workers.beta import Worker, WorkerDeleteResponse +``` + +Methods: + +- client.workers.beta.workers.create(\*, account_id, \*\*params) -> Worker +- client.workers.beta.workers.update(worker_id, \*, account_id, \*\*params) -> Worker +- client.workers.beta.workers.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Worker] +- client.workers.beta.workers.delete(worker_id, \*, account_id) -> WorkerDeleteResponse +- client.workers.beta.workers.edit(worker_id, \*, account_id, \*\*params) -> Worker +- client.workers.beta.workers.get(worker_id, \*, account_id) -> Worker + +#### Versions + +Types: + +```python +from cloudflare.types.workers.beta.workers import Version, VersionDeleteResponse +``` + +Methods: + +- client.workers.beta.workers.versions.create(worker_id, \*, account_id, \*\*params) -> Version +- client.workers.beta.workers.versions.list(worker_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[Version] +- client.workers.beta.workers.versions.delete(version_id, \*, account_id, worker_id) -> VersionDeleteResponse +- client.workers.beta.workers.versions.get(version_id, \*, account_id, worker_id, \*\*params) -> Version + ## Routes Types: @@ -2302,15 +2375,22 @@ Methods: Types: ```python -from cloudflare.types.workers import Script, ScriptSetting, ScriptUpdateResponse, ScriptGetResponse +from cloudflare.types.workers import ( + Script, + ScriptSetting, + ScriptUpdateResponse, + ScriptGetResponse, + ScriptSearchResponse, +) ``` Methods: - client.workers.scripts.update(script_name, \*, account_id, \*\*params) -> ScriptUpdateResponse -- client.workers.scripts.list(\*, account_id) -> SyncSinglePage[Script] +- client.workers.scripts.list(\*, account_id, \*\*params) -> SyncSinglePage[Script] - client.workers.scripts.delete(script_name, \*, account_id, \*\*params) -> object - client.workers.scripts.get(script_name, \*, account_id) -> str +- client.workers.scripts.search(\*, account_id, \*\*params) -> ScriptSearchResponse ### Assets @@ -2397,15 +2477,17 @@ Types: ```python from cloudflare.types.workers.scripts import ( Deployment, - DeploymentCreateResponse, - DeploymentGetResponse, + DeploymentListResponse, + DeploymentDeleteResponse, ) ``` Methods: -- client.workers.scripts.deployments.create(script_name, \*, account_id, \*\*params) -> Optional[DeploymentCreateResponse] -- client.workers.scripts.deployments.get(script_name, \*, account_id) -> Optional[DeploymentGetResponse] +- client.workers.scripts.deployments.create(script_name, \*, account_id, \*\*params) -> Deployment +- client.workers.scripts.deployments.list(script_name, \*, account_id) -> DeploymentListResponse +- client.workers.scripts.deployments.delete(deployment_id, \*, account_id, script_name) -> DeploymentDeleteResponse +- client.workers.scripts.deployments.get(deployment_id, \*, account_id, script_name) -> Deployment ### Versions @@ -2441,8 +2523,8 @@ Methods: - client.workers.scripts.secrets.update(script_name, \*, account_id, \*\*params) -> Optional[SecretUpdateResponse] - client.workers.scripts.secrets.list(script_name, \*, account_id) -> SyncSinglePage[SecretListResponse] -- client.workers.scripts.secrets.delete(secret_name, \*, account_id, script_name) -> object -- client.workers.scripts.secrets.get(secret_name, \*, account_id, script_name) -> Optional[SecretGetResponse] +- client.workers.scripts.secrets.delete(secret_name, \*, account_id, script_name, \*\*params) -> object +- client.workers.scripts.secrets.get(secret_name, \*, account_id, script_name, \*\*params) -> Optional[SecretGetResponse] ### ScriptAndVersionSettings @@ -2563,22 +2645,16 @@ from cloudflare.types.kv.namespaces import ( Methods: -- client.kv.namespaces.keys.list(namespace_id, \*, account_id, \*\*params) -> SyncCursorLimitPagination[Key] +- client.kv.namespaces.keys.list(namespace_id, \*, account_id, \*\*params) -> SyncCursorPaginationAfter[Key] - client.kv.namespaces.keys.bulk_delete(namespace_id, \*, account_id, \*\*params) -> Optional[KeyBulkDeleteResponse] - client.kv.namespaces.keys.bulk_get(namespace_id, \*, account_id, \*\*params) -> Optional[KeyBulkGetResponse] - client.kv.namespaces.keys.bulk_update(namespace_id, \*, account_id, \*\*params) -> Optional[KeyBulkUpdateResponse] ### Metadata -Types: - -```python -from cloudflare.types.kv.namespaces import MetadataGetResponse -``` - Methods: -- client.kv.namespaces.metadata.get(key_name, \*, account_id, namespace_id) -> Optional[MetadataGetResponse] +- client.kv.namespaces.metadata.get(key_name, \*, account_id, namespace_id) -> object ### Values @@ -2606,7 +2682,7 @@ from cloudflare.types.durable_objects import Namespace Methods: -- client.durable_objects.namespaces.list(\*, account_id) -> SyncSinglePage[Namespace] +- client.durable_objects.namespaces.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Namespace] ### Objects @@ -2618,7 +2694,7 @@ from cloudflare.types.durable_objects.namespaces import DurableObject Methods: -- client.durable_objects.namespaces.objects.list(id, \*, account_id, \*\*params) -> SyncCursorLimitPagination[DurableObject] +- client.durable_objects.namespaces.objects.list(id, \*, account_id, \*\*params) -> SyncCursorPaginationAfter[DurableObject] # Queues @@ -2637,21 +2713,6 @@ Methods: - client.queues.edit(queue_id, \*, account_id, \*\*params) -> Optional[Queue] - client.queues.get(queue_id, \*, account_id) -> Optional[Queue] -## Consumers - -Types: - -```python -from cloudflare.types.queues import Consumer, ConsumerDeleteResponse -``` - -Methods: - -- client.queues.consumers.create(queue_id, \*, account_id, \*\*params) -> Optional[Consumer] -- client.queues.consumers.update(consumer_id, \*, account_id, queue_id, \*\*params) -> Optional[Consumer] -- client.queues.consumers.delete(consumer_id, \*, account_id, queue_id) -> ConsumerDeleteResponse -- client.queues.consumers.get(queue_id, \*, account_id) -> SyncSinglePage[Consumer] - ## Messages Types: @@ -2685,6 +2746,44 @@ Methods: - client.queues.purge.start(queue_id, \*, account_id, \*\*params) -> Optional[Queue] - client.queues.purge.status(queue_id, \*, account_id) -> Optional[PurgeStatusResponse] +## Consumers + +Types: + +```python +from cloudflare.types.queues import Consumer, ConsumerDeleteResponse +``` + +Methods: + +- client.queues.consumers.create(queue_id, \*, account_id, \*\*params) -> Optional[Consumer] +- client.queues.consumers.update(consumer_id, \*, account_id, queue_id, \*\*params) -> Optional[Consumer] +- client.queues.consumers.list(queue_id, \*, account_id) -> SyncSinglePage[Consumer] +- client.queues.consumers.delete(consumer_id, \*, account_id, queue_id) -> ConsumerDeleteResponse +- client.queues.consumers.get(consumer_id, \*, account_id, queue_id) -> Optional[Consumer] + +## Subscriptions + +Types: + +```python +from cloudflare.types.queues import ( + SubscriptionCreateResponse, + SubscriptionUpdateResponse, + SubscriptionListResponse, + SubscriptionDeleteResponse, + SubscriptionGetResponse, +) +``` + +Methods: + +- client.queues.subscriptions.create(\*, account_id, \*\*params) -> Optional[SubscriptionCreateResponse] +- client.queues.subscriptions.update(subscription_id, \*, account_id, \*\*params) -> Optional[SubscriptionUpdateResponse] +- client.queues.subscriptions.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[SubscriptionListResponse] +- client.queues.subscriptions.delete(subscription_id, \*, account_id) -> Optional[SubscriptionDeleteResponse] +- client.queues.subscriptions.get(subscription_id, \*, account_id) -> Optional[SubscriptionGetResponse] + # APIGateway ## Configurations @@ -2692,13 +2791,13 @@ Methods: Types: ```python -from cloudflare.types.api_gateway import Configuration, ConfigurationUpdateResponse +from cloudflare.types.api_gateway import Configuration ``` Methods: -- client.api_gateway.configurations.update(\*, zone_id, \*\*params) -> ConfigurationUpdateResponse -- client.api_gateway.configurations.get(\*, zone_id, \*\*params) -> Configuration +- client.api_gateway.configurations.update(\*, zone_id, \*\*params) -> Configuration +- client.api_gateway.configurations.get(\*, zone_id) -> Configuration ## Discovery @@ -3014,7 +3113,6 @@ from cloudflare.types.rulesets import ( ManagedChallengeRule, RedirectRule, RewriteRule, - RewriteURIPart, RouteRule, RulesetRule, ScoreRule, @@ -3368,17 +3466,63 @@ Types: ```python from cloudflare.types.brand_protection import ( Info, - RuleMatch, - ScanStatus, Submit, - URLInfoModelResults, + BrandProtectionSubmitResponse, + BrandProtectionURLInfoResponse, ) ``` Methods: -- client.brand_protection.submit(\*, account_id, \*\*params) -> Optional[Submit] -- client.brand_protection.url_info(\*, account_id, \*\*params) -> Optional[Info] +- client.brand_protection.submit(\*, account_id) -> BrandProtectionSubmitResponse +- client.brand_protection.url_info(\*, account_id) -> SyncSinglePage[BrandProtectionURLInfoResponse] + +## Queries + +Methods: + +- client.brand_protection.queries.create(\*, account_id, \*\*params) -> None +- client.brand_protection.queries.delete(\*, account_id, \*\*params) -> None +- client.brand_protection.queries.bulk(\*, account_id, \*\*params) -> None + +## Matches + +Types: + +```python +from cloudflare.types.brand_protection import MatchDownloadResponse, MatchGetResponse +``` + +Methods: + +- client.brand_protection.matches.download(\*, account_id, \*\*params) -> MatchDownloadResponse +- client.brand_protection.matches.get(\*, account_id, \*\*params) -> MatchGetResponse + +## Logos + +Types: + +```python +from cloudflare.types.brand_protection import LogoCreateResponse +``` + +Methods: + +- client.brand_protection.logos.create(\*, account_id, \*\*params) -> LogoCreateResponse +- client.brand_protection.logos.delete(logo_id, \*, account_id) -> None + +## LogoMatches + +Types: + +```python +from cloudflare.types.brand_protection import LogoMatchDownloadResponse, LogoMatchGetResponse +``` + +Methods: + +- client.brand_protection.logo_matches.download(\*, account_id, \*\*params) -> LogoMatchDownloadResponse +- client.brand_protection.logo_matches.get(\*, account_id, \*\*params) -> LogoMatchGetResponse # Diagnostics @@ -3394,6 +3538,29 @@ Methods: - client.diagnostics.traceroutes.create(\*, account_id, \*\*params) -> SyncSinglePage[Traceroute] +## EndpointHealthchecks + +Types: + +```python +from cloudflare.types.diagnostics import ( + EndpointHealthcheck, + EndpointHealthcheckCreateResponse, + EndpointHealthcheckUpdateResponse, + EndpointHealthcheckListResponse, + EndpointHealthcheckDeleteResponse, + EndpointHealthcheckGetResponse, +) +``` + +Methods: + +- client.diagnostics.endpoint_healthchecks.create(\*, account_id, \*\*params) -> Optional[EndpointHealthcheckCreateResponse] +- client.diagnostics.endpoint_healthchecks.update(id, \*, account_id, \*\*params) -> Optional[EndpointHealthcheckUpdateResponse] +- client.diagnostics.endpoint_healthchecks.list(\*, account_id) -> Optional[EndpointHealthcheckListResponse] +- client.diagnostics.endpoint_healthchecks.delete(id, \*, account_id) -> EndpointHealthcheckDeleteResponse +- client.diagnostics.endpoint_healthchecks.get(id, \*, account_id) -> Optional[EndpointHealthcheckGetResponse] + # Images ## V1 @@ -3658,18 +3825,6 @@ Methods: - client.intel.indicator_feeds.permissions.list(\*, account_id) -> Optional[PermissionListResponse] - client.intel.indicator_feeds.permissions.delete(\*, account_id, \*\*params) -> Optional[PermissionDeleteResponse] -### Downloads - -Types: - -```python -from cloudflare.types.intel.indicator_feeds import DownloadGetResponse -``` - -Methods: - -- client.intel.indicator_feeds.downloads.get(feed_id, \*, account_id) -> Optional[DownloadGetResponse] - ## Sinkholes Types: @@ -3929,8 +4084,10 @@ Types: ```python from cloudflare.types.magic_transit import ( + ConnectorCreateResponse, ConnectorUpdateResponse, ConnectorListResponse, + ConnectorDeleteResponse, ConnectorEditResponse, ConnectorGetResponse, ) @@ -3938,8 +4095,10 @@ from cloudflare.types.magic_transit import ( Methods: +- client.magic_transit.connectors.create(\*, account_id, \*\*params) -> ConnectorCreateResponse - client.magic_transit.connectors.update(connector_id, \*, account_id, \*\*params) -> ConnectorUpdateResponse - client.magic_transit.connectors.list(\*, account_id) -> SyncSinglePage[ConnectorListResponse] +- client.magic_transit.connectors.delete(connector_id, \*, account_id) -> ConnectorDeleteResponse - client.magic_transit.connectors.edit(connector_id, \*, account_id, \*\*params) -> ConnectorEditResponse - client.magic_transit.connectors.get(connector_id, \*, account_id) -> ConnectorGetResponse @@ -4349,7 +4508,7 @@ from cloudflare.types.pages import Deployment, Project, Stage Methods: - client.pages.projects.create(\*, account_id, \*\*params) -> Project -- client.pages.projects.list(\*, account_id) -> SyncSinglePage[Deployment] +- client.pages.projects.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Deployment] - client.pages.projects.delete(project_name, \*, account_id) -> object - client.pages.projects.edit(project_name, \*, account_id, \*\*params) -> Project - client.pages.projects.get(project_name, \*, account_id) -> Project @@ -4444,7 +4603,6 @@ from cloudflare.types.rules import ( Redirect, ListCreateResponse, ListUpdateResponse, - ListListResponse, ListDeleteResponse, ListGetResponse, ) @@ -4454,7 +4612,7 @@ Methods: - client.rules.lists.create(\*, account_id, \*\*params) -> ListCreateResponse - client.rules.lists.update(list_id, \*, account_id, \*\*params) -> ListUpdateResponse -- client.rules.lists.list(\*, account_id) -> ListListResponse +- client.rules.lists.list(\*, account_id) -> SyncSinglePage[ListsList] - client.rules.lists.delete(list_id, \*, account_id) -> ListDeleteResponse - client.rules.lists.get(list_id, \*, account_id) -> ListGetResponse @@ -4490,8 +4648,8 @@ Methods: - client.rules.lists.items.create(list_id, \*, account_id, \*\*params) -> ItemCreateResponse - client.rules.lists.items.update(list_id, \*, account_id, \*\*params) -> ItemUpdateResponse -- client.rules.lists.items.list(list_id, \*, account_id, \*\*params) -> ItemListResponse -- client.rules.lists.items.delete(list_id, \*, account_id) -> ItemDeleteResponse +- client.rules.lists.items.list(list_id, \*, account_id, \*\*params) -> SyncCursorPaginationAfter[ItemListResponse] +- client.rules.lists.items.delete(list_id, \*, account_id, \*\*params) -> ItemDeleteResponse - client.rules.lists.items.get(item_id, \*, account_id, list_id) -> ItemGetResponse # Stream @@ -5165,8 +5323,8 @@ Methods: - client.workers_for_platforms.dispatch.namespaces.scripts.secrets.update(script_name, \*, account_id, dispatch_namespace, \*\*params) -> SecretUpdateResponse - client.workers_for_platforms.dispatch.namespaces.scripts.secrets.list(script_name, \*, account_id, dispatch_namespace) -> SyncSinglePage[SecretListResponse] -- client.workers_for_platforms.dispatch.namespaces.scripts.secrets.delete(secret_name, \*, account_id, dispatch_namespace, script_name) -> object -- client.workers_for_platforms.dispatch.namespaces.scripts.secrets.get(secret_name, \*, account_id, dispatch_namespace, script_name) -> SecretGetResponse +- client.workers_for_platforms.dispatch.namespaces.scripts.secrets.delete(secret_name, \*, account_id, dispatch_namespace, script_name, \*\*params) -> object +- client.workers_for_platforms.dispatch.namespaces.scripts.secrets.get(secret_name, \*, account_id, dispatch_namespace, script_name, \*\*params) -> SecretGetResponse ##### Tags @@ -5212,7 +5370,7 @@ Methods: - client.zero*trust.devices.devices.list(\*, account_id, \*\*params) -> SyncCursorPagination[DeviceListResponse] - client.zero*trust.devices.devices.delete(device_id, \*, account_id) -> object -- client.zero*trust.devices.devices.get(device_id, \*, account_id) -> DeviceGetResponse +- client.zero*trust.devices.devices.get(device_id, \*, account_id, \*\*params) -> DeviceGetResponse - client.zero*trust.devices.devices.revoke(device_id, \*, account_id) -> object ### Resilience @@ -5246,7 +5404,7 @@ Methods: - client.zero_trust.devices.registrations.list(\*, account_id, \*\*params) -> SyncCursorPagination[RegistrationListResponse] - client.zero_trust.devices.registrations.delete(registration_id, \*, account_id) -> object - client.zero_trust.devices.registrations.bulk_delete(\*, account_id, \*\*params) -> object -- client.zero_trust.devices.registrations.get(registration_id, \*, account_id) -> RegistrationGetResponse +- client.zero_trust.devices.registrations.get(registration_id, \*, account_id, \*\*params) -> RegistrationGetResponse - client.zero_trust.devices.registrations.revoke(\*, account_id, \*\*params) -> object - client.zero_trust.devices.registrations.unrevoke(\*, account_id, \*\*params) -> object @@ -5513,7 +5671,7 @@ Methods: - client.zero_trust.identity_providers.create(\*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider] - client.zero_trust.identity_providers.update(identity_provider_id, \*, account_id, zone_id, \*\*params) -> Optional[IdentityProvider] -- client.zero_trust.identity_providers.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[IdentityProviderListResponse] +- client.zero_trust.identity_providers.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[IdentityProviderListResponse] - client.zero_trust.identity_providers.delete(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProviderDeleteResponse] - client.zero_trust.identity_providers.get(identity_provider_id, \*, account_id, zone_id) -> Optional[IdentityProvider] @@ -5523,13 +5681,13 @@ Methods: Methods: -- client.zero_trust.identity_providers.scim.groups.list(identity_provider_id, \*, account_id, \*\*params) -> SyncSinglePage[ZeroTrustGroup] +- client.zero_trust.identity_providers.scim.groups.list(identity_provider_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[ZeroTrustGroup] #### Users Methods: -- client.zero_trust.identity_providers.scim.users.list(identity_provider_id, \*, account_id, \*\*params) -> SyncSinglePage[AccessUser] +- client.zero_trust.identity_providers.scim.users.list(identity_provider_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[AccessUser] ## Organizations @@ -5655,7 +5813,7 @@ Methods: - client.zero_trust.access.applications.create(\*, account_id, zone_id, \*\*params) -> Optional[ApplicationCreateResponse] - client.zero_trust.access.applications.update(app_id, \*, account_id, zone_id, \*\*params) -> Optional[ApplicationUpdateResponse] -- client.zero_trust.access.applications.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[ApplicationListResponse] +- client.zero_trust.access.applications.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[ApplicationListResponse] - client.zero_trust.access.applications.delete(app_id, \*, account_id, zone_id) -> Optional[ApplicationDeleteResponse] - client.zero_trust.access.applications.get(app_id, \*, account_id, zone_id) -> Optional[ApplicationGetResponse] - client.zero_trust.access.applications.revoke_tokens(app_id, \*, account_id, zone_id) -> object @@ -5671,7 +5829,7 @@ from cloudflare.types.zero_trust.access.applications import CA, CADeleteResponse Methods: - client.zero_trust.access.applications.cas.create(app_id, \*, account_id, zone_id) -> Optional[CA] -- client.zero_trust.access.applications.cas.list(\*, account_id, zone_id) -> SyncSinglePage[CA] +- client.zero_trust.access.applications.cas.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[CA] - client.zero_trust.access.applications.cas.delete(app_id, \*, account_id, zone_id) -> Optional[CADeleteResponse] - client.zero_trust.access.applications.cas.get(app_id, \*, account_id, zone_id) -> Optional[CA] @@ -5728,7 +5886,7 @@ Methods: - client.zero_trust.access.applications.policies.create(app_id, \*, account_id, zone_id, \*\*params) -> Optional[PolicyCreateResponse] - client.zero_trust.access.applications.policies.update(policy_id, \*, app_id, account_id, zone_id, \*\*params) -> Optional[PolicyUpdateResponse] -- client.zero_trust.access.applications.policies.list(app_id, \*, account_id, zone_id) -> SyncSinglePage[PolicyListResponse] +- client.zero_trust.access.applications.policies.list(app_id, \*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[PolicyListResponse] - client.zero_trust.access.applications.policies.delete(policy_id, \*, app_id, account_id, zone_id) -> Optional[PolicyDeleteResponse] - client.zero_trust.access.applications.policies.get(policy_id, \*, app_id, account_id, zone_id) -> Optional[PolicyGetResponse] @@ -5792,7 +5950,7 @@ Methods: - client.zero_trust.access.certificates.create(\*, account_id, zone_id, \*\*params) -> Optional[Certificate] - client.zero_trust.access.certificates.update(certificate_id, \*, account_id, zone_id, \*\*params) -> Optional[Certificate] -- client.zero_trust.access.certificates.list(\*, account_id, zone_id) -> SyncSinglePage[Certificate] +- client.zero_trust.access.certificates.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[Certificate] - client.zero_trust.access.certificates.delete(certificate_id, \*, account_id, zone_id) -> Optional[CertificateDeleteResponse] - client.zero_trust.access.certificates.get(certificate_id, \*, account_id, zone_id) -> Optional[Certificate] @@ -5828,7 +5986,7 @@ Methods: - client.zero_trust.access.groups.create(\*, account_id, zone_id, \*\*params) -> Optional[GroupCreateResponse] - client.zero_trust.access.groups.update(group_id, \*, account_id, zone_id, \*\*params) -> Optional[GroupUpdateResponse] -- client.zero_trust.access.groups.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[GroupListResponse] +- client.zero_trust.access.groups.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[GroupListResponse] - client.zero_trust.access.groups.delete(group_id, \*, account_id, zone_id) -> Optional[GroupDeleteResponse] - client.zero_trust.access.groups.get(group_id, \*, account_id, zone_id) -> Optional[GroupGetResponse] @@ -5848,11 +6006,11 @@ Methods: - client.zero_trust.access.service_tokens.create(\*, account_id, zone_id, \*\*params) -> Optional[ServiceTokenCreateResponse] - client.zero_trust.access.service_tokens.update(service_token_id, \*, account_id, zone_id, \*\*params) -> Optional[ServiceToken] -- client.zero_trust.access.service_tokens.list(\*, account_id, zone_id, \*\*params) -> SyncSinglePage[ServiceToken] +- client.zero_trust.access.service_tokens.list(\*, account_id, zone_id, \*\*params) -> SyncV4PagePaginationArray[ServiceToken] - client.zero_trust.access.service_tokens.delete(service_token_id, \*, account_id, zone_id) -> Optional[ServiceToken] - client.zero_trust.access.service_tokens.get(service_token_id, \*, account_id, zone_id) -> Optional[ServiceToken] - client.zero_trust.access.service_tokens.refresh(service_token_id, \*, account_id) -> Optional[ServiceToken] -- client.zero_trust.access.service_tokens.rotate(service_token_id, \*, account_id) -> Optional[ServiceTokenRotateResponse] +- client.zero_trust.access.service_tokens.rotate(service_token_id, \*, account_id, \*\*params) -> Optional[ServiceTokenRotateResponse] ### Bookmarks @@ -5916,7 +6074,7 @@ from cloudflare.types.zero_trust.access.logs.scim import UpdateListResponse Methods: -- client.zero_trust.access.logs.scim.updates.list(\*, account_id, \*\*params) -> SyncSinglePage[UpdateListResponse] +- client.zero_trust.access.logs.scim.updates.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[UpdateListResponse] ### Users @@ -5928,7 +6086,7 @@ from cloudflare.types.zero_trust.access import AccessUser, UserListResponse Methods: -- client.zero_trust.access.users.list(\*, account_id, \*\*params) -> SyncSinglePage[UserListResponse] +- client.zero_trust.access.users.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[UserListResponse] #### ActiveSessions @@ -5986,7 +6144,7 @@ Methods: - client.zero_trust.access.custom_pages.create(\*, account_id, \*\*params) -> Optional[CustomPageWithoutHTML] - client.zero_trust.access.custom_pages.update(custom_page_id, \*, account_id, \*\*params) -> Optional[CustomPageWithoutHTML] -- client.zero_trust.access.custom_pages.list(\*, account_id) -> SyncSinglePage[CustomPageWithoutHTML] +- client.zero_trust.access.custom_pages.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[CustomPageWithoutHTML] - client.zero_trust.access.custom_pages.delete(custom_page_id, \*, account_id) -> Optional[CustomPageDeleteResponse] - client.zero_trust.access.custom_pages.get(custom_page_id, \*, account_id) -> Optional[CustomPage] @@ -6002,7 +6160,7 @@ Methods: - client.zero_trust.access.tags.create(\*, account_id, \*\*params) -> Optional[Tag] - client.zero_trust.access.tags.update(tag_name, \*, account_id, \*\*params) -> Optional[Tag] -- client.zero_trust.access.tags.list(\*, account_id) -> SyncSinglePage[Tag] +- client.zero_trust.access.tags.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Tag] - client.zero_trust.access.tags.delete(tag_name, \*, account_id) -> Optional[TagDeleteResponse] - client.zero_trust.access.tags.get(tag_name, \*, account_id) -> Optional[Tag] @@ -6026,7 +6184,7 @@ Methods: - client.zero_trust.access.policies.create(\*, account_id, \*\*params) -> Optional[PolicyCreateResponse] - client.zero_trust.access.policies.update(policy_id, \*, account_id, \*\*params) -> Optional[PolicyUpdateResponse] -- client.zero_trust.access.policies.list(\*, account_id) -> SyncSinglePage[PolicyListResponse] +- client.zero_trust.access.policies.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[PolicyListResponse] - client.zero_trust.access.policies.delete(policy_id, \*, account_id) -> Optional[PolicyDeleteResponse] - client.zero_trust.access.policies.get(policy_id, \*, account_id) -> Optional[PolicyGetResponse] @@ -6348,6 +6506,31 @@ Methods: - client.zero_trust.connectivity_settings.edit(\*, account_id, \*\*params) -> ConnectivitySettingEditResponse - client.zero_trust.connectivity_settings.get(\*, account_id) -> ConnectivitySettingGetResponse +## Connectivity + +### Directory + +#### Services + +Types: + +```python +from cloudflare.types.zero_trust.connectivity.directory import ( + ServiceCreateResponse, + ServiceUpdateResponse, + ServiceListResponse, + ServiceGetResponse, +) +``` + +Methods: + +- client.zero_trust.connectivity.directory.services.create(\*, account_id, \*\*params) -> Optional[ServiceCreateResponse] +- client.zero_trust.connectivity.directory.services.update(service_id, \*, account_id, \*\*params) -> Optional[ServiceUpdateResponse] +- client.zero_trust.connectivity.directory.services.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ServiceListResponse] +- client.zero_trust.connectivity.directory.services.delete(service_id, \*, account_id) -> None +- client.zero_trust.connectivity.directory.services.get(service_id, \*, account_id) -> Optional[ServiceGetResponse] + ## DLP ### Datasets @@ -6377,7 +6560,7 @@ from cloudflare.types.zero_trust.dlp.datasets import NewVersion Methods: - client.zero_trust.dlp.datasets.upload.create(dataset_id, \*, account_id) -> Optional[NewVersion] -- client.zero_trust.dlp.datasets.upload.edit(version, \*, account_id, dataset_id, \*\*params) -> Optional[Dataset] +- client.zero_trust.dlp.datasets.upload.edit(version, dataset, \*, account_id, dataset_id, \*\*params) -> Optional[Dataset] #### Versions @@ -6401,7 +6584,7 @@ from cloudflare.types.zero_trust.dlp.datasets.versions import EntryCreateRespons Methods: -- client.zero_trust.dlp.datasets.versions.entries.create(entry_id, \*, account_id, dataset_id, version, \*\*params) -> Optional[EntryCreateResponse] +- client.zero_trust.dlp.datasets.versions.entries.create(entry_id, dataset_version_entry, \*, account_id, dataset_id, version, \*\*params) -> Optional[EntryCreateResponse] ### Patterns @@ -6508,7 +6691,9 @@ from cloudflare.types.zero_trust.dlp.profiles import PredefinedProfile Methods: +- client.zero_trust.dlp.profiles.predefined.create(\*, account_id, \*\*params) -> Optional[Profile] - client.zero_trust.dlp.profiles.predefined.update(profile_id, \*, account_id, \*\*params) -> Optional[Profile] +- client.zero_trust.dlp.profiles.predefined.delete(profile_id, \*, account_id) -> object - client.zero_trust.dlp.profiles.predefined.get(profile_id, \*, account_id) -> Optional[Profile] ### Limits @@ -6538,11 +6723,74 @@ from cloudflare.types.zero_trust.dlp import ( Methods: -- client.zero_trust.dlp.entries.create(\*, account_id, \*\*params) -> Optional[EntryCreateResponse] -- client.zero_trust.dlp.entries.update(entry_id, \*, account_id, \*\*params) -> Optional[EntryUpdateResponse] -- client.zero_trust.dlp.entries.list(\*, account_id) -> SyncSinglePage[EntryListResponse] -- client.zero_trust.dlp.entries.delete(entry_id, \*, account_id) -> object -- client.zero_trust.dlp.entries.get(entry_id, \*, account_id) -> Optional[EntryGetResponse] +- client.zero_trust.dlp.entries.create(\*, account_id, \*\*params) -> Optional[EntryCreateResponse] +- client.zero_trust.dlp.entries.update(entry_id, \*, account_id, \*\*params) -> Optional[EntryUpdateResponse] +- client.zero_trust.dlp.entries.list(\*, account_id) -> SyncSinglePage[EntryListResponse] +- client.zero_trust.dlp.entries.delete(entry_id, \*, account_id) -> object +- client.zero_trust.dlp.entries.get(entry_id, \*, account_id) -> Optional[EntryGetResponse] + +#### Custom + +Types: + +```python +from cloudflare.types.zero_trust.dlp.entries import ( + CustomCreateResponse, + CustomUpdateResponse, + CustomListResponse, + CustomGetResponse, +) +``` + +Methods: + +- client.zero_trust.dlp.entries.custom.create(\*, account_id, \*\*params) -> Optional[CustomCreateResponse] +- client.zero_trust.dlp.entries.custom.update(entry_id, \*, account_id, \*\*params) -> Optional[CustomUpdateResponse] +- client.zero_trust.dlp.entries.custom.list(\*, account_id) -> SyncSinglePage[CustomListResponse] +- client.zero_trust.dlp.entries.custom.delete(entry_id, \*, account_id) -> object +- client.zero_trust.dlp.entries.custom.get(entry_id, \*, account_id) -> Optional[CustomGetResponse] + +#### Predefined + +Types: + +```python +from cloudflare.types.zero_trust.dlp.entries import ( + PredefinedCreateResponse, + PredefinedUpdateResponse, + PredefinedListResponse, + PredefinedGetResponse, +) +``` + +Methods: + +- client.zero_trust.dlp.entries.predefined.create(\*, account_id, \*\*params) -> Optional[PredefinedCreateResponse] +- client.zero_trust.dlp.entries.predefined.update(entry_id, \*, account_id, \*\*params) -> Optional[PredefinedUpdateResponse] +- client.zero_trust.dlp.entries.predefined.list(\*, account_id) -> SyncSinglePage[PredefinedListResponse] +- client.zero_trust.dlp.entries.predefined.delete(entry_id, \*, account_id) -> object +- client.zero_trust.dlp.entries.predefined.get(entry_id, \*, account_id) -> Optional[PredefinedGetResponse] + +#### Integration + +Types: + +```python +from cloudflare.types.zero_trust.dlp.entries import ( + IntegrationCreateResponse, + IntegrationUpdateResponse, + IntegrationListResponse, + IntegrationGetResponse, +) +``` + +Methods: + +- client.zero_trust.dlp.entries.integration.create(\*, account_id, \*\*params) -> Optional[IntegrationCreateResponse] +- client.zero_trust.dlp.entries.integration.update(entry_id, \*, account_id, \*\*params) -> Optional[IntegrationUpdateResponse] +- client.zero_trust.dlp.entries.integration.list(\*, account_id) -> SyncSinglePage[IntegrationListResponse] +- client.zero_trust.dlp.entries.integration.delete(entry_id, \*, account_id) -> object +- client.zero_trust.dlp.entries.integration.get(entry_id, \*, account_id) -> Optional[IntegrationGetResponse] ## Gateway @@ -6736,6 +6984,7 @@ Methods: - client.zero_trust.gateway.rules.list(\*, account_id) -> SyncSinglePage[GatewayRule] - client.zero_trust.gateway.rules.delete(rule_id, \*, account_id) -> object - client.zero_trust.gateway.rules.get(rule_id, \*, account_id) -> Optional[GatewayRule] +- client.zero_trust.gateway.rules.list_tenant(\*, account_id) -> SyncSinglePage[GatewayRule] - client.zero_trust.gateway.rules.reset_expiration(rule_id, \*, account_id) -> Optional[GatewayRule] ### Certificates @@ -6834,6 +7083,22 @@ Methods: - client.zero_trust.networks.subnets.cloudflare_source.update(address_family, \*, account_id, \*\*params) -> CloudflareSourceUpdateResponse +### HostnameRoutes + +Types: + +```python +from cloudflare.types.zero_trust.networks import HostnameRoute +``` + +Methods: + +- client.zero_trust.networks.hostname_routes.create(\*, account_id, \*\*params) -> HostnameRoute +- client.zero_trust.networks.hostname_routes.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[HostnameRoute] +- client.zero_trust.networks.hostname_routes.delete(hostname_route_id, \*, account_id) -> HostnameRoute +- client.zero_trust.networks.hostname_routes.edit(hostname_route_id, \*, account_id, \*\*params) -> HostnameRoute +- client.zero_trust.networks.hostname_routes.get(hostname_route_id, \*, account_id) -> HostnameRoute + ## RiskScoring Types: @@ -7000,6 +7265,7 @@ from cloudflare.types.vectorize import ( IndexDeleteByIDsResponse, IndexInfoResponse, IndexInsertResponse, + IndexListVectorsResponse, IndexQueryResponse, IndexUpsertResponse, ) @@ -7015,6 +7281,7 @@ Methods: - client.vectorize.indexes.get_by_ids(index_name, \*, account_id, \*\*params) -> object - client.vectorize.indexes.info(index_name, \*, account_id) -> Optional[IndexInfoResponse] - client.vectorize.indexes.insert(index_name, \*, account_id, \*\*params) -> Optional[IndexInsertResponse] +- client.vectorize.indexes.list_vectors(index_name, \*, account_id, \*\*params) -> Optional[IndexListVectorsResponse] - client.vectorize.indexes.query(index_name, \*, account_id, \*\*params) -> Optional[IndexQueryResponse] - client.vectorize.indexes.upsert(index_name, \*, account_id, \*\*params) -> Optional[IndexUpsertResponse] @@ -7095,10 +7362,24 @@ from cloudflare.types.radar.ai import ToMarkdownCreateResponse Methods: -- client.radar.ai.to_markdown.create(\*, account_id, \*\*params) -> SyncSinglePage[ToMarkdownCreateResponse] +- client.radar.ai.to_markdown.create(body, \*, account_id, \*\*params) -> SyncSinglePage[ToMarkdownCreateResponse] ### Inference +Types: + +```python +from cloudflare.types.radar.ai import ( + InferenceSummaryV2Response, + InferenceTimeseriesGroupsV2Response, +) +``` + +Methods: + +- client.radar.ai.inference.summary_v2(dimension, \*\*params) -> InferenceSummaryV2Response +- client.radar.ai.inference.timeseries_groups_v2(dimension, \*\*params) -> InferenceTimeseriesGroupsV2Response + #### Summary Types: @@ -7132,6 +7413,22 @@ Methods: ### Bots +Types: + +```python +from cloudflare.types.radar.ai import ( + BotSummaryV2Response, + BotTimeseriesResponse, + BotTimeseriesGroupsResponse, +) +``` + +Methods: + +- client.radar.ai.bots.summary_v2(dimension, \*\*params) -> BotSummaryV2Response +- client.radar.ai.bots.timeseries(\*\*params) -> BotTimeseriesResponse +- client.radar.ai.bots.timeseries_groups(dimension, \*\*params) -> BotTimeseriesGroupsResponse + #### Summary Types: @@ -7149,13 +7446,65 @@ Methods: Types: ```python -from cloudflare.types.radar.ai import TimeseriesGroupUserAgentResponse +from cloudflare.types.radar.ai import ( + TimeseriesGroupSummaryResponse, + TimeseriesGroupTimeseriesResponse, + TimeseriesGroupTimeseriesGroupsResponse, + TimeseriesGroupUserAgentResponse, +) ``` Methods: +- client.radar.ai.timeseries_groups.summary(dimension, \*\*params) -> TimeseriesGroupSummaryResponse +- client.radar.ai.timeseries_groups.timeseries(\*\*params) -> TimeseriesGroupTimeseriesResponse +- client.radar.ai.timeseries_groups.timeseries_groups(dimension, \*\*params) -> TimeseriesGroupTimeseriesGroupsResponse - client.radar.ai.timeseries_groups.user_agent(\*\*params) -> TimeseriesGroupUserAgentResponse +## Ct + +Types: + +```python +from cloudflare.types.radar import ( + CtSummaryResponse, + CtTimeseriesResponse, + CtTimeseriesGroupsResponse, +) +``` + +Methods: + +- client.radar.ct.summary(dimension, \*\*params) -> CtSummaryResponse +- client.radar.ct.timeseries(\*\*params) -> CtTimeseriesResponse +- client.radar.ct.timeseries_groups(dimension, \*\*params) -> CtTimeseriesGroupsResponse + +### Authorities + +Types: + +```python +from cloudflare.types.radar.ct import AuthorityListResponse, AuthorityGetResponse +``` + +Methods: + +- client.radar.ct.authorities.list(\*\*params) -> AuthorityListResponse +- client.radar.ct.authorities.get(ca_slug, \*\*params) -> AuthorityGetResponse + +### Logs + +Types: + +```python +from cloudflare.types.radar.ct import LogListResponse, LogGetResponse +``` + +Methods: + +- client.radar.ct.logs.list(\*\*params) -> LogListResponse +- client.radar.ct.logs.get(log_slug, \*\*params) -> LogGetResponse + ## Annotations Types: @@ -7280,6 +7629,44 @@ Methods: - client.radar.bgp.ips.timeseries(\*\*params) -> IPTimeseriesResponse +## Bots + +Types: + +```python +from cloudflare.types.radar import ( + BotListResponse, + BotGetResponse, + BotSummaryResponse, + BotTimeseriesResponse, + BotTimeseriesGroupsResponse, +) +``` + +Methods: + +- client.radar.bots.list(\*\*params) -> BotListResponse +- client.radar.bots.get(bot_slug, \*\*params) -> BotGetResponse +- client.radar.bots.summary(dimension, \*\*params) -> BotSummaryResponse +- client.radar.bots.timeseries(\*\*params) -> BotTimeseriesResponse +- client.radar.bots.timeseries_groups(dimension, \*\*params) -> BotTimeseriesGroupsResponse + +### WebCrawlers + +Types: + +```python +from cloudflare.types.radar.bots import ( + WebCrawlerSummaryResponse, + WebCrawlerTimeseriesGroupsResponse, +) +``` + +Methods: + +- client.radar.bots.web_crawlers.summary(dimension, \*\*params) -> WebCrawlerSummaryResponse +- client.radar.bots.web_crawlers.timeseries_groups(dimension, \*\*params) -> WebCrawlerTimeseriesGroupsResponse + ## Datasets Types: @@ -7299,12 +7686,18 @@ Methods: Types: ```python -from cloudflare.types.radar import DNSTimeseriesResponse +from cloudflare.types.radar import ( + DNSSummaryV2Response, + DNSTimeseriesResponse, + DNSTimeseriesGroupsV2Response, +) ``` Methods: +- client.radar.dns.summary_v2(dimension, \*\*params) -> DNSSummaryV2Response - client.radar.dns.timeseries(\*\*params) -> DNSTimeseriesResponse +- client.radar.dns.timeseries_groups_v2(dimension, \*\*params) -> DNSTimeseriesGroupsV2Response ### Top @@ -7388,13 +7781,20 @@ Methods: Types: ```python -from cloudflare.types.radar import NetflowSummaryResponse, NetflowTimeseriesResponse +from cloudflare.types.radar import ( + NetflowSummaryResponse, + NetflowSummaryV2Response, + NetflowTimeseriesResponse, + NetflowTimeseriesGroupsResponse, +) ``` Methods: - client.radar.netflows.summary(\*\*params) -> NetflowSummaryResponse +- client.radar.netflows.summary_v2(dimension, \*\*params) -> NetflowSummaryV2Response - client.radar.netflows.timeseries(\*\*params) -> NetflowTimeseriesResponse +- client.radar.netflows.timeseries_groups(dimension, \*\*params) -> NetflowTimeseriesGroupsResponse ### Top @@ -7441,12 +7841,18 @@ Methods: Types: ```python -from cloudflare.types.radar import AS112TimeseriesResponse +from cloudflare.types.radar import ( + AS112SummaryV2Response, + AS112TimeseriesResponse, + AS112TimeseriesGroupsV2Response, +) ``` Methods: +- client.radar.as112.summary_v2(dimension, \*\*params) -> AS112SummaryV2Response - client.radar.as112.timeseries(\*\*params) -> AS112TimeseriesResponse +- client.radar.as112.timeseries_groups_v2(dimension, \*\*params) -> AS112TimeseriesGroupsV2Response ### Summary @@ -7526,6 +7932,17 @@ from cloudflare.types.radar import RadarEmailSeries, RadarEmailSummary ### Routing +Types: + +```python +from cloudflare.types.radar.email import RoutingSummaryV2Response, RoutingTimeseriesGroupsV2Response +``` + +Methods: + +- client.radar.email.routing.summary_v2(dimension, \*\*params) -> RoutingSummaryV2Response +- client.radar.email.routing.timeseries_groups_v2(dimension, \*\*params) -> RoutingTimeseriesGroupsV2Response + #### Summary Types: @@ -7576,6 +7993,20 @@ Methods: ### Security +Types: + +```python +from cloudflare.types.radar.email import ( + SecuritySummaryV2Response, + SecurityTimeseriesGroupsV2Response, +) +``` + +Methods: + +- client.radar.email.security.summary_v2(dimension, \*\*params) -> SecuritySummaryV2Response +- client.radar.email.security.timeseries_groups_v2(dimension, \*\*params) -> SecurityTimeseriesGroupsV2Response + #### Top ##### Tlds @@ -7693,12 +8124,18 @@ Methods: Types: ```python -from cloudflare.types.radar.attacks import Layer3TimeseriesResponse +from cloudflare.types.radar.attacks import ( + Layer3SummaryV2Response, + Layer3TimeseriesResponse, + Layer3TimeseriesGroupsV2Response, +) ``` Methods: +- client.radar.attacks.layer3.summary_v2(dimension, \*\*params) -> Layer3SummaryV2Response - client.radar.attacks.layer3.timeseries(\*\*params) -> Layer3TimeseriesResponse +- client.radar.attacks.layer3.timeseries_groups_v2(dimension, \*\*params) -> Layer3TimeseriesGroupsV2Response #### Summary @@ -7788,12 +8225,18 @@ Methods: Types: ```python -from cloudflare.types.radar.attacks import Layer7TimeseriesResponse +from cloudflare.types.radar.attacks import ( + Layer7SummaryV2Response, + Layer7TimeseriesResponse, + Layer7TimeseriesGroupsV2Response, +) ``` Methods: +- client.radar.attacks.layer7.summary_v2(dimension, \*\*params) -> Layer7SummaryV2Response - client.radar.attacks.layer7.timeseries(\*\*params) -> Layer7TimeseriesResponse +- client.radar.attacks.layer7.timeseries_groups_v2(dimension, \*\*params) -> Layer7TimeseriesGroupsV2Response #### Summary @@ -7909,6 +8352,7 @@ Types: ```python from cloudflare.types.radar.entities import ( ASNListResponse, + ASNAsSetResponse, ASNGetResponse, ASNIPResponse, ASNRelResponse, @@ -7918,6 +8362,7 @@ from cloudflare.types.radar.entities import ( Methods: - client.radar.entities.asns.list(\*\*params) -> ASNListResponse +- client.radar.entities.asns.as_set(asn, \*\*params) -> ASNAsSetResponse - client.radar.entities.asns.get(asn, \*\*params) -> ASNGetResponse - client.radar.entities.asns.ip(\*\*params) -> ASNIPResponse - client.radar.entities.asns.rel(asn, \*\*params) -> ASNRelResponse @@ -7935,17 +8380,36 @@ Methods: - client.radar.entities.locations.list(\*\*params) -> LocationListResponse - client.radar.entities.locations.get(location, \*\*params) -> LocationGetResponse +## Geolocations + +Types: + +```python +from cloudflare.types.radar import GeolocationListResponse, GeolocationGetResponse +``` + +Methods: + +- client.radar.geolocations.list(\*\*params) -> GeolocationListResponse +- client.radar.geolocations.get(geo_id, \*\*params) -> GeolocationGetResponse + ## HTTP Types: ```python -from cloudflare.types.radar import HTTPTimeseriesResponse +from cloudflare.types.radar import ( + HTTPSummaryV2Response, + HTTPTimeseriesResponse, + HTTPTimeseriesGroupsV2Response, +) ``` Methods: +- client.radar.http.summary_v2(dimension, \*\*params) -> HTTPSummaryV2Response - client.radar.http.timeseries(\*\*params) -> HTTPTimeseriesResponse +- client.radar.http.timeseries_groups_v2(dimension, \*\*params) -> HTTPTimeseriesGroupsV2Response ### Locations @@ -8388,6 +8852,20 @@ Methods: ## LeakedCredentials +Types: + +```python +from cloudflare.types.radar import ( + LeakedCredentialSummaryV2Response, + LeakedCredentialTimeseriesGroupsV2Response, +) +``` + +Methods: + +- client.radar.leaked_credentials.summary_v2(dimension, \*\*params) -> LeakedCredentialSummaryV2Response +- client.radar.leaked_credentials.timeseries_groups_v2(dimension, \*\*params) -> LeakedCredentialTimeseriesGroupsV2Response + ### Summary Types: @@ -8644,15 +9122,20 @@ Methods: Types: ```python -from cloudflare.types.snippets import Snippet, SnippetDeleteResponse +from cloudflare.types.snippets import ( + SnippetUpdateResponse, + SnippetListResponse, + SnippetDeleteResponse, + SnippetGetResponse, +) ``` Methods: -- client.snippets.update(snippet_name, \*, zone_id, \*\*params) -> Optional[Snippet] -- client.snippets.list(\*, zone_id) -> SyncSinglePage[Snippet] -- client.snippets.delete(snippet_name, \*, zone_id) -> SnippetDeleteResponse -- client.snippets.get(snippet_name, \*, zone_id) -> Optional[Snippet] +- client.snippets.update(snippet_name, \*, zone_id, \*\*params) -> SnippetUpdateResponse +- client.snippets.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[SnippetListResponse] +- client.snippets.delete(snippet_name, \*, zone_id) -> str +- client.snippets.get(snippet_name, \*, zone_id) -> SnippetGetResponse ## Content @@ -8672,7 +9155,7 @@ Methods: - client.snippets.rules.update(\*, zone_id, \*\*params) -> SyncSinglePage[RuleUpdateResponse] - client.snippets.rules.list(\*, zone_id) -> SyncSinglePage[RuleListResponse] -- client.snippets.rules.delete(\*, zone_id) -> RuleDeleteResponse +- client.snippets.rules.delete(\*, zone_id) -> SyncSinglePage[RuleDeleteResponse] # Calls @@ -8714,7 +9197,7 @@ from cloudflare.types.calls import ( Methods: -- client.calls.turn.create(\*, account_id, \*\*params) -> TURNCreateResponse +- client.calls.turn.create(\*, account_id, \*\*params) -> Optional[TURNCreateResponse] - client.calls.turn.update(key_id, \*, account_id, \*\*params) -> Optional[TURNUpdateResponse] - client.calls.turn.list(\*, account_id) -> SyncSinglePage[TURNListResponse] - client.calls.turn.delete(key_id, \*, account_id) -> Optional[TURNDeleteResponse] @@ -8755,6 +9238,19 @@ Methods: - client.cloudforce_one.scans.config.delete(config_id, \*, account_id) -> object - client.cloudforce_one.scans.config.edit(config_id, \*, account_id, \*\*params) -> Optional[ConfigEditResponse] +## BinaryStorage + +Types: + +```python +from cloudflare.types.cloudforce_one import BinaryStorageCreateResponse +``` + +Methods: + +- client.cloudforce_one.binary_storage.create(\*, account_id, \*\*params) -> BinaryStorageCreateResponse +- client.cloudforce_one.binary_storage.get(hash, \*, account_id) -> None + ## Requests Types: @@ -8908,19 +9404,6 @@ Methods: - client.cloudforce_one.threat_events.countries.list(\*, account_id) -> CountryListResponse -### Crons - -Types: - -```python -from cloudflare.types.cloudforce_one.threat_events import CronListResponse, CronEditResponse -``` - -Methods: - -- client.cloudforce_one.threat_events.crons.list(\*, account_id) -> CronListResponse -- client.cloudforce_one.threat_events.crons.edit(\*, account_id) -> CronEditResponse - ### Datasets Types: @@ -8943,18 +9426,6 @@ Methods: - client.cloudforce_one.threat_events.datasets.get(dataset_id, \*, account_id) -> DatasetGetResponse - client.cloudforce_one.threat_events.datasets.raw(event_id, \*, account_id, dataset_id) -> DatasetRawResponse -#### Health - -Types: - -```python -from cloudflare.types.cloudforce_one.threat_events.datasets import HealthGetResponse -``` - -Methods: - -- client.cloudforce_one.threat_events.datasets.health.get(dataset_id, \*, account_id) -> HealthGetResponse - ### IndicatorTypes Types: @@ -9032,26 +9503,6 @@ Methods: - client.cloudforce_one.threat_events.target_industries.list(\*, account_id) -> TargetIndustryListResponse -### Insights - -Types: - -```python -from cloudflare.types.cloudforce_one.threat_events import ( - InsightCreateResponse, - InsightDeleteResponse, - InsightEditResponse, - InsightGetResponse, -) -``` - -Methods: - -- client.cloudforce_one.threat_events.insights.create(event_id, \*, account_id, \*\*params) -> InsightCreateResponse -- client.cloudforce_one.threat_events.insights.delete(insight_id, \*, account_id, event_id) -> InsightDeleteResponse -- client.cloudforce_one.threat_events.insights.edit(insight_id, \*, account_id, event_id, \*\*params) -> InsightEditResponse -- client.cloudforce_one.threat_events.insights.get(insight_id, \*, account_id, event_id) -> InsightGetResponse - # AIGateway Types: @@ -9190,7 +9641,7 @@ Methods: - client.iam.resource_groups.create(\*, account_id, \*\*params) -> ResourceGroupCreateResponse - client.iam.resource_groups.update(resource_group_id, \*, account_id, \*\*params) -> ResourceGroupUpdateResponse -- client.iam.resource_groups.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ResourceGroupListResponse] +- client.iam.resource_groups.list(\*, account_id, \*\*params) -> SyncSinglePage[ResourceGroupListResponse] - client.iam.resource_groups.delete(resource_group_id, \*, account_id) -> Optional[ResourceGroupDeleteResponse] - client.iam.resource_groups.get(resource_group_id, \*, account_id) -> ResourceGroupGetResponse @@ -9390,7 +9841,7 @@ Methods: - client.resource_sharing.update(share_id, \*, account_id, \*\*params) -> Optional[ResourceSharingUpdateResponse] - client.resource_sharing.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ResourceSharingListResponse] - client.resource_sharing.delete(share_id, \*, account_id) -> Optional[ResourceSharingDeleteResponse] -- client.resource_sharing.get(share_id, \*, account_id) -> Optional[ResourceSharingGetResponse] +- client.resource_sharing.get(share_id, \*, account_id, \*\*params) -> Optional[ResourceSharingGetResponse] ## Recipients @@ -9410,7 +9861,7 @@ Methods: - client.resource_sharing.recipients.create(share_id, \*, path_account_id, \*\*params) -> Optional[RecipientCreateResponse] - client.resource_sharing.recipients.list(share_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[RecipientListResponse] - client.resource_sharing.recipients.delete(recipient_id, \*, account_id, share_id) -> Optional[RecipientDeleteResponse] -- client.resource_sharing.recipients.get(recipient_id, \*, account_id, share_id) -> Optional[RecipientGetResponse] +- client.resource_sharing.recipients.get(recipient_id, \*, account_id, share_id, \*\*params) -> Optional[RecipientGetResponse] ## Resources @@ -9471,10 +9922,23 @@ Methods: # ContentScanning +Types: + +```python +from cloudflare.types.content_scanning import ( + ContentScanningCreateResponse, + ContentScanningUpdateResponse, + ContentScanningGetResponse, +) +``` + Methods: +- client.content_scanning.create(\*, zone_id, \*\*params) -> ContentScanningCreateResponse +- client.content_scanning.update(\*, zone_id, \*\*params) -> ContentScanningUpdateResponse - client.content_scanning.disable(\*, zone_id) -> object - client.content_scanning.enable(\*, zone_id) -> object +- client.content_scanning.get(\*, zone_id) -> ContentScanningGetResponse ## Payloads @@ -9516,7 +9980,7 @@ from cloudflare.types.abuse_reports import AbuseReportCreateResponse Methods: -- client.abuse_reports.create(report_type, \*, account_id, \*\*params) -> str +- client.abuse_reports.create(report_param, \*, account_id, \*\*params) -> str # AI @@ -9591,6 +10055,18 @@ Methods: - client.ai.models.schema.get(\*, account_id, \*\*params) -> object +## ToMarkdown + +Types: + +```python +from cloudflare.types.ai import ToMarkdownTransformResponse +``` + +Methods: + +- client.ai.to_markdown.transform(file, \*, account_id, \*\*params) -> SyncSinglePage[ToMarkdownTransformResponse] + # SecurityCenter ## Insights @@ -9739,13 +10215,17 @@ Methods: Types: ```python -from cloudflare.types.custom_pages import CustomPageUpdateResponse, CustomPageGetResponse +from cloudflare.types.custom_pages import ( + CustomPageUpdateResponse, + CustomPageListResponse, + CustomPageGetResponse, +) ``` Methods: - client.custom_pages.update(identifier, \*, account_id, zone_id, \*\*params) -> Optional[CustomPageUpdateResponse] -- client.custom_pages.list(\*, account_id, zone_id) -> SyncSinglePage[object] +- client.custom_pages.list(\*, account_id, zone_id) -> SyncSinglePage[CustomPageListResponse] - client.custom_pages.get(identifier, \*, account_id, zone_id) -> Optional[CustomPageGetResponse] # SecretsStore diff --git a/bin/check-release-environment b/bin/check-release-environment index b659e91535b..b845b0f4c96 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,7 +3,7 @@ errors=() if [ -z "${PYPI_TOKEN}" ]; then - errors+=("The CLOUDFLARE_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") + errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi lenErrors=${#errors[@]} diff --git a/examples/dns/record.py b/examples/dns/record.py index 72b89316a58..87b3d4fd17a 100644 --- a/examples/dns/record.py +++ b/examples/dns/record.py @@ -14,6 +14,7 @@ type="A", name="www.mydns.com", content="198.51.100.1", + ttl=1, proxied=True, ) assert record is not None diff --git a/examples/workers/script_upload.py b/examples/workers/script_upload.py index 2343e0e33d2..500cf31d132 100644 --- a/examples/workers/script_upload.py +++ b/examples/workers/script_upload.py @@ -71,20 +71,20 @@ def main() -> None: } ], }, - files={ + files=[ # Add main_module file - script_file_name: ( + ( script_file_name, bytes(script_content, "utf-8"), "application/javascript+module", - ) + ), # Can add other files, such as more modules or source maps - # source_map_file_name: ( - # source_map_file_name, - # bytes(source_map_content, "utf-8"), - # "application/source-map" - #) - }, + # ( + # source_map_file_name, + # bytes(source_map_content, "utf-8"), + # "application/source-map", + # ), + ], ) print("Script Upload success!") print(script.to_json(indent=2)) diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index e929ff8caa2..00000000000 --- a/mypy.ini +++ /dev/null @@ -1,50 +0,0 @@ -[mypy] -pretty = True -show_error_codes = True - -# Exclude _files.py because mypy isn't smart enough to apply -# the correct type narrowing and as this is an internal module -# it's fine to just use Pyright. -# -# We also exclude our `tests` as mypy doesn't always infer -# types correctly and Pyright will still catch any type errors. -exclude = ^(src/cloudflare/_files\.py|_dev/.*\.py|tests/.*|src/cloudflare/resources/zero_trust/identity_providers\.py|src/cloudflare/resources/zero_trust/access/applications/applications\.py|src/cloudflare/resources/workers/ai\.py|src/cloudflare/resources/magic_transit/apps\.py)$ - -strict_equality = True -implicit_reexport = True -check_untyped_defs = True -no_implicit_optional = True - -warn_return_any = True -warn_unreachable = True -warn_unused_configs = True - -# Turn these options off as it could cause conflicts -# with the Pyright options. -warn_unused_ignores = False -warn_redundant_casts = False - -disallow_any_generics = True -disallow_untyped_defs = True -disallow_untyped_calls = True -disallow_subclassing_any = True -disallow_incomplete_defs = True -disallow_untyped_decorators = True -cache_fine_grained = True - -# By default, mypy reports an error if you assign a value to the result -# of a function call that doesn't return anything. We do this in our test -# cases: -# ``` -# result = ... -# assert result is None -# ``` -# Changing this codegen to make mypy happy would increase complexity -# and would not be worth it. -disable_error_code = func-returns-value,overload-cannot-match - -# https://github.com/python/mypy/issues/12162 -[mypy.overrides] -module = "black.files.*" -ignore_errors = true -ignore_missing_imports = true diff --git a/pyproject.toml b/pyproject.toml index b1f6854f5f6..a26861bb910 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cloudflare" -version = "4.3.1" +version = "5.0.0" description = "The official Python library for the cloudflare API" dynamic = ["readme"] license = "Apache-2.0" @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", @@ -37,6 +38,8 @@ classifiers = [ Homepage = "https://github.com/cloudflare/cloudflare-python" Repository = "https://github.com/cloudflare/cloudflare-python" +[project.optional-dependencies] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] [tool.rye] managed = true @@ -53,8 +56,8 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", - "nest_asyncio==1.6.0", "pytest-xdist>=3.6.1", + "griffe>=1", ] [tool.rye.scripts] @@ -145,6 +148,7 @@ exclude = [ "_dev", ".venv", ".nox", + ".git", ] reportImplicitOverride = true @@ -153,10 +157,62 @@ reportOverlappingOverload = false reportImportCycles = false reportPrivateUsage = false +[tool.mypy] +pretty = true +show_error_codes = true + +# Exclude _files.py because mypy isn't smart enough to apply +# the correct type narrowing and as this is an internal module +# it's fine to just use Pyright. +# +# We also exclude our `tests` as mypy doesn't always infer +# types correctly and Pyright will still catch any type errors. +exclude = ['src/cloudflare/_files.py', '_dev/.*.py', 'tests/.*', 'src/cloudflare/resources/zero_trust/identity_providers\.py', 'src/cloudflare/resources/zero_trust/access/applications/applications\.py', 'src/cloudflare/resources/workers/ai\.py', 'src/cloudflare/resources/magic_transit/apps\.py'] + +strict_equality = true +implicit_reexport = true +check_untyped_defs = true +no_implicit_optional = true + +warn_return_any = true +warn_unreachable = true +warn_unused_configs = true + +# Turn these options off as it could cause conflicts +# with the Pyright options. +warn_unused_ignores = false +warn_redundant_casts = false + +disallow_any_generics = true +disallow_untyped_defs = true +disallow_untyped_calls = true +disallow_subclassing_any = true +disallow_incomplete_defs = true +disallow_untyped_decorators = true +cache_fine_grained = true + +# By default, mypy reports an error if you assign a value to the result +# of a function call that doesn't return anything. We do this in our test +# cases: +# ``` +# result = ... +# assert result is None +# ``` +# Changing this codegen to make mypy happy would increase complexity +# and would not be worth it. +disable_error_code = "func-returns-value,overload-cannot-match" + +# https://github.com/python/mypy/issues/12162 +[[tool.mypy.overrides]] +module = "black.files.*" +ignore_errors = true +ignore_missing_imports = true + + [tool.ruff] line-length = 120 output-format = "grouped" -target-version = "py37" +target-version = "py38" [tool.ruff.format] docstring-code-format = true diff --git a/requirements-dev.lock b/requirements-dev.lock index d30c3e08170..bcfb9bc0362 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -10,6 +10,13 @@ # universal: false -e file:. +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.12.8 + # via cloudflare + # via httpx-aiohttp +aiosignal==1.3.2 + # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 @@ -17,9 +24,15 @@ anyio==4.4.0 # via httpx argcomplete==3.1.2 # via nox +async-timeout==5.0.1 + # via aiohttp +attrs==25.3.0 + # via aiohttp certifi==2023.7.22 # via httpcore # via httpx +colorama==0.4.6 + # via griffe colorlog==6.7.0 # via nox dirty-equals==0.6.0 @@ -34,16 +47,24 @@ execnet==2.1.1 # via pytest-xdist filelock==3.12.4 # via virtualenv -h11==0.14.0 +frozenlist==1.6.2 + # via aiohttp + # via aiosignal +griffe==1.13.0 +h11==0.16.0 # via httpcore -httpcore==1.0.2 +httpcore==1.0.9 # via httpx httpx==0.28.1 # via cloudflare + # via httpx-aiohttp # via respx +httpx-aiohttp==0.1.8 + # via cloudflare idna==3.4 # via anyio # via httpx + # via yarl importlib-metadata==7.0.0 iniconfig==2.0.0 # via pytest @@ -51,10 +72,12 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py +multidict==6.4.4 + # via aiohttp + # via yarl mypy==1.14.1 mypy-extensions==1.0.0 # via mypy -nest-asyncio==1.6.0 nodeenv==1.8.0 # via pyright nox==2023.4.22 @@ -65,9 +88,12 @@ platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 # via pytest -pydantic==2.10.3 +propcache==0.3.1 + # via aiohttp + # via yarl +pydantic==2.11.9 # via cloudflare -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic pygments==2.18.0 # via rich @@ -98,11 +124,17 @@ tomli==2.0.2 typing-extensions==4.12.2 # via anyio # via cloudflare + # via multidict # via mypy # via pydantic # via pydantic-core # via pyright + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic virtualenv==20.24.5 # via nox +yarl==1.20.0 + # via aiohttp zipp==3.17.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index 4752e59fd63..b2df8dfc612 100644 --- a/requirements.lock +++ b/requirements.lock @@ -10,11 +10,22 @@ # universal: false -e file:. +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.12.8 + # via cloudflare + # via httpx-aiohttp +aiosignal==1.3.2 + # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 # via cloudflare # via httpx +async-timeout==5.0.1 + # via aiohttp +attrs==25.3.0 + # via aiohttp certifi==2023.7.22 # via httpcore # via httpx @@ -22,18 +33,31 @@ distro==1.8.0 # via cloudflare exceptiongroup==1.2.2 # via anyio -h11==0.14.0 +frozenlist==1.6.2 + # via aiohttp + # via aiosignal +h11==0.16.0 # via httpcore -httpcore==1.0.2 +httpcore==1.0.9 # via httpx httpx==0.28.1 # via cloudflare + # via httpx-aiohttp +httpx-aiohttp==0.1.8 + # via cloudflare idna==3.4 # via anyio # via httpx -pydantic==2.10.3 + # via yarl +multidict==6.4.4 + # via aiohttp + # via yarl +propcache==0.3.1 + # via aiohttp + # via yarl +pydantic==2.11.9 # via cloudflare -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic sniffio==1.3.0 # via anyio @@ -41,5 +65,11 @@ sniffio==1.3.0 typing-extensions==4.12.2 # via anyio # via cloudflare + # via multidict # via pydantic # via pydantic-core + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic +yarl==1.20.0 + # via aiohttp diff --git a/scripts/bootstrap b/scripts/bootstrap index e84fe62c380..b430fee36d6 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd "$(dirname "$0")/.." -if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes new file mode 100755 index 00000000000..fb28f3a261a --- /dev/null +++ b/scripts/detect-breaking-changes @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Detecting breaking changes" + +TEST_PATHS=( tests/api_resources tests/test_client.py tests/test_response.py ) + +for PATHSPEC in "${TEST_PATHS[@]}"; do + # Try to check out previous versions of the test files + # with the current SDK. + git checkout "$1" -- "${PATHSPEC}" 2>/dev/null || true +done + +# Instead of running the tests, use the linter to check if an +# older test is no longer compatible with the latest SDK. +./scripts/lint diff --git a/scripts/detect-breaking-changes.py b/scripts/detect-breaking-changes.py new file mode 100644 index 00000000000..f8d81890b9b --- /dev/null +++ b/scripts/detect-breaking-changes.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +import sys +from typing import Iterator +from pathlib import Path + +import rich +import griffe +from rich.text import Text +from rich.style import Style + + +def public_members(obj: griffe.Object | griffe.Alias) -> dict[str, griffe.Object | griffe.Alias]: + if isinstance(obj, griffe.Alias): + # ignore imports for now, they're technically part of the public API + # but we don't have good preventative measures in place to prevent + # changing them + return {} + + return {name: value for name, value in obj.all_members.items() if not name.startswith("_")} + + +def find_breaking_changes( + new_obj: griffe.Object | griffe.Alias, + old_obj: griffe.Object | griffe.Alias, + *, + path: list[str], +) -> Iterator[Text | str]: + new_members = public_members(new_obj) + old_members = public_members(old_obj) + + for name, old_member in old_members.items(): + if isinstance(old_member, griffe.Alias) and len(path) > 2: + # ignore imports in `/types/` for now, they're technically part of the public API + # but we don't have good preventative measures in place to prevent changing them + continue + + new_member = new_members.get(name) + if new_member is None: + cls_name = old_member.__class__.__name__ + yield Text(f"({cls_name})", style=Style(color="rgb(119, 119, 119)")) + yield from [" " for _ in range(10 - len(cls_name))] + yield f" {'.'.join(path)}.{name}" + yield "\n" + continue + + yield from find_breaking_changes(new_member, old_member, path=[*path, name]) + + +def main() -> None: + try: + against_ref = sys.argv[1] + except IndexError as err: + raise RuntimeError("You must specify a base ref to run breaking change detection against") from err + + package = griffe.load( + "cloudflare", + search_paths=[Path(__file__).parent.parent.joinpath("src")], + ) + old_package = griffe.load_git( + "cloudflare", + ref=against_ref, + search_paths=["src"], + ) + assert isinstance(package, griffe.Module) + assert isinstance(old_package, griffe.Module) + + output = list(find_breaking_changes(package, old_package, path=["cloudflare"])) + if output: + rich.print(Text("Breaking changes detected!", style=Style(color="rgb(165, 79, 87)"))) + rich.print() + + for text in output: + rich.print(text, end="") + + sys.exit(1) + + +main() diff --git a/scripts/mock b/scripts/mock index d2814ae6a0c..0b28f6ea23d 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi diff --git a/scripts/test b/scripts/test index 2b87845670b..dbeda2d2176 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 6ba857e8d3b..fc6462eccf8 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash set -exuo pipefail -RESPONSE=$(curl -X POST "$URL" \ +FILENAME=$(basename dist/*.whl) + +RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \ -H "Authorization: Bearer $AUTH" \ -H "Content-Type: application/json") @@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ - -H "Content-Type: application/gzip" \ - --data-binary @- "$SIGNED_URL" 2>&1) +UPLOAD_RESPONSE=$(curl -v -X PUT \ + -H "Content-Type: binary/octet-stream" \ + --data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" - echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/cloudflare-python/$SHA'\033[0m" + echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/cloudflare-python/$SHA/$FILENAME'\033[0m" else echo -e "\033[31mFailed to upload artifact.\033[0m" exit 1 diff --git a/src/cloudflare/__init__.py b/src/cloudflare/__init__.py index 9ce8e45d0c0..26a59059d51 100644 --- a/src/cloudflare/__init__.py +++ b/src/cloudflare/__init__.py @@ -3,7 +3,7 @@ import typing as _t from . import types -from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes +from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given from ._utils import file_from_path from ._client import ( Client, @@ -36,7 +36,7 @@ UnprocessableEntityError, APIResponseValidationError, ) -from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient +from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient from ._utils._logs import setup_logging as _setup_logging __all__ = [ @@ -48,7 +48,9 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "not_given", "Omit", + "omit", "CloudflareError", "APIError", "APIStatusError", @@ -78,6 +80,7 @@ "DEFAULT_CONNECTION_LIMITS", "DefaultHttpxClient", "DefaultAsyncHttpxClient", + "DefaultAioHttpClient", ] if not _t.TYPE_CHECKING: diff --git a/src/cloudflare/_base_client.py b/src/cloudflare/_base_client.py index d6d981cb568..369fe558a26 100644 --- a/src/cloudflare/_base_client.py +++ b/src/cloudflare/_base_client.py @@ -42,7 +42,6 @@ from ._qs import Querystring from ._files import to_httpx_files, async_to_httpx_files from ._types import ( - NOT_GIVEN, Body, Omit, Query, @@ -59,9 +58,10 @@ MultipartSyntax, HttpxRequestFiles, ModelBuilderProtocol, + not_given, ) from ._utils import is_dict, is_list, asyncify, is_given, is_tuple, lru_cache, is_mapping, is_mapping_t, is_sequence_t -from ._compat import PYDANTIC_V2, model_copy, model_dump +from ._compat import PYDANTIC_V1, model_copy, model_dump from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, @@ -147,9 +147,9 @@ def __init__( def __init__( self, *, - url: URL | NotGiven = NOT_GIVEN, - json: Body | NotGiven = NOT_GIVEN, - params: Query | NotGiven = NOT_GIVEN, + url: URL | NotGiven = not_given, + json: Body | NotGiven = not_given, + params: Query | NotGiven = not_given, ) -> None: self.url = url self.json = json @@ -234,7 +234,7 @@ def _set_private_attributes( model: Type[_T], options: FinalRequestOptions, ) -> None: - if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None: self.__pydantic_private__ = {} self._model = model @@ -322,7 +322,7 @@ def _set_private_attributes( client: AsyncAPIClient, options: FinalRequestOptions, ) -> None: - if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None: self.__pydantic_private__ = {} self._model = model @@ -553,6 +553,18 @@ def _build_request( # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} + is_body_allowed = options.method.lower() != "get" + + if is_body_allowed: + if isinstance(json_data, bytes): + kwargs["content"] = json_data + else: + kwargs["json"] = json_data if is_given(json_data) else None + kwargs["files"] = files + else: + headers.pop("Content-Type", None) + kwargs.pop("data", None) + # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, @@ -564,8 +576,6 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data if is_given(json_data) else None, - files=files, **kwargs, ) @@ -625,7 +635,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques # we internally support defining a temporary header to override the # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response` # see _response.py for implementation details - override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN) + override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given) if is_given(override_cast_to): options.headers = headers return cast(Type[ResponseT], override_cast_to) @@ -856,7 +866,7 @@ def __init__( base_url: str | URL, api_version: str, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1331,6 +1341,24 @@ def __init__(self, **kwargs: Any) -> None: super().__init__(**kwargs) +try: + import httpx_aiohttp +except ImportError: + + class _DefaultAioHttpClient(httpx.AsyncClient): + def __init__(self, **_kwargs: Any) -> None: + raise RuntimeError("To use the aiohttp client you must have installed the package with the `aiohttp` extra") +else: + + class _DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + + super().__init__(**kwargs) + + if TYPE_CHECKING: DefaultAsyncHttpxClient = httpx.AsyncClient """An alias to `httpx.AsyncClient` that provides the same defaults that this SDK @@ -1339,8 +1367,12 @@ def __init__(self, **kwargs: Any) -> None: This is useful because overriding the `http_client` with your own instance of `httpx.AsyncClient` will result in httpx's defaults being used, not ours. """ + + DefaultAioHttpClient = httpx.AsyncClient + """An alias to `httpx.AsyncClient` that changes the default HTTP transport to `aiohttp`.""" else: DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient + DefaultAioHttpClient = _DefaultAioHttpClient class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): @@ -1367,7 +1399,7 @@ def __init__( api_version: str, _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1830,8 +1862,8 @@ def make_request_options( extra_query: Query | None = None, extra_body: Body | None = None, idempotency_key: str | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - post_parser: PostParser | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + post_parser: PostParser | NotGiven = not_given, multipart_syntax: MultipartSyntax | None = None, ) -> RequestOptions: """Create a dict of type RequestOptions without keys of NotGiven values.""" diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index 141eaf0be63..f5811b09500 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import TYPE_CHECKING, Any, Union, Mapping +from typing import TYPE_CHECKING, Any, Mapping from datetime import datetime from typing_extensions import Self, override @@ -12,7 +12,6 @@ from . import _exceptions from ._qs import Querystring from ._types import ( - NOT_GIVEN, Omit, Headers, Timeout, @@ -20,6 +19,7 @@ Transport, ProxiesTypes, RequestOptions, + not_given, ) from ._utils import is_given, get_async_library from ._compat import cached_property @@ -96,6 +96,7 @@ abuse_reports, email_routing, magic_transit, + organizations, secrets_store, waiting_rooms, bot_management, @@ -170,7 +171,6 @@ from .resources.billing.billing import BillingResource, AsyncBillingResource from .resources.logpush.logpush import LogpushResource, AsyncLogpushResource from .resources.workers.workers import WorkersResource, AsyncWorkersResource - from .resources.brand_protection import BrandProtectionResource, AsyncBrandProtectionResource from .resources.accounts.accounts import AccountsResource, AsyncAccountsResource from .resources.alerting.alerting import AlertingResource, AsyncAlertingResource from .resources.firewall.firewall import FirewallResource, AsyncFirewallResource @@ -201,6 +201,7 @@ from .resources.healthchecks.healthchecks import HealthchecksResource, AsyncHealthchecksResource from .resources.email_routing.email_routing import EmailRoutingResource, AsyncEmailRoutingResource from .resources.magic_transit.magic_transit import MagicTransitResource, AsyncMagicTransitResource + from .resources.organizations.organizations import OrganizationsResource, AsyncOrganizationsResource from .resources.secrets_store.secrets_store import SecretsStoreResource, AsyncSecretsStoreResource from .resources.waiting_rooms.waiting_rooms import WaitingRoomsResource, AsyncWaitingRoomsResource from .resources.cloudforce_one.cloudforce_one import CloudforceOneResource, AsyncCloudforceOneResource @@ -214,6 +215,7 @@ from .resources.durable_objects.durable_objects import DurableObjectsResource, AsyncDurableObjectsResource from .resources.request_tracers.request_tracers import RequestTracersResource, AsyncRequestTracersResource from .resources.security_center.security_center import SecurityCenterResource, AsyncSecurityCenterResource + from .resources.brand_protection.brand_protection import BrandProtectionResource, AsyncBrandProtectionResource from .resources.content_scanning.content_scanning import ContentScanningResource, AsyncContentScanningResource from .resources.custom_hostnames.custom_hostnames import CustomHostnamesResource, AsyncCustomHostnamesResource from .resources.resource_sharing.resource_sharing import ResourceSharingResource, AsyncResourceSharingResource @@ -281,7 +283,7 @@ def __init__( user_service_key: str | None = None, base_url: str | httpx.URL | None = None, api_version: str | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -349,6 +351,12 @@ def accounts(self) -> AccountsResource: return AccountsResource(self) + @cached_property + def organizations(self) -> OrganizationsResource: + from .resources.organizations import OrganizationsResource + + return OrganizationsResource(self) + @cached_property def origin_ca_certificates(self) -> OriginCACertificatesResource: from .resources.origin_ca_certificates import OriginCACertificatesResource @@ -1013,9 +1021,9 @@ def copy( user_service_key: str | None = None, base_url: str | httpx.URL | None = None, api_version: str | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + max_retries: int | NotGiven = not_given, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -1113,7 +1121,7 @@ def __init__( user_service_key: str | None = None, base_url: str | httpx.URL | None = None, api_version: str | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -1181,6 +1189,12 @@ def accounts(self) -> AsyncAccountsResource: return AsyncAccountsResource(self) + @cached_property + def organizations(self) -> AsyncOrganizationsResource: + from .resources.organizations import AsyncOrganizationsResource + + return AsyncOrganizationsResource(self) + @cached_property def origin_ca_certificates(self) -> AsyncOriginCACertificatesResource: from .resources.origin_ca_certificates import AsyncOriginCACertificatesResource @@ -1845,9 +1859,9 @@ def copy( user_service_key: str | None = None, base_url: str | httpx.URL | None = None, api_version: str | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + max_retries: int | NotGiven = not_given, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -1941,6 +1955,12 @@ def accounts(self) -> accounts.AccountsResourceWithRawResponse: return AccountsResourceWithRawResponse(self._client.accounts) + @cached_property + def organizations(self) -> organizations.OrganizationsResourceWithRawResponse: + from .resources.organizations import OrganizationsResourceWithRawResponse + + return OrganizationsResourceWithRawResponse(self._client.organizations) + @cached_property def origin_ca_certificates(self) -> origin_ca_certificates.OriginCACertificatesResourceWithRawResponse: from .resources.origin_ca_certificates import OriginCACertificatesResourceWithRawResponse @@ -2520,6 +2540,12 @@ def accounts(self) -> accounts.AsyncAccountsResourceWithRawResponse: return AsyncAccountsResourceWithRawResponse(self._client.accounts) + @cached_property + def organizations(self) -> organizations.AsyncOrganizationsResourceWithRawResponse: + from .resources.organizations import AsyncOrganizationsResourceWithRawResponse + + return AsyncOrganizationsResourceWithRawResponse(self._client.organizations) + @cached_property def origin_ca_certificates(self) -> origin_ca_certificates.AsyncOriginCACertificatesResourceWithRawResponse: from .resources.origin_ca_certificates import AsyncOriginCACertificatesResourceWithRawResponse @@ -3099,6 +3125,12 @@ def accounts(self) -> accounts.AccountsResourceWithStreamingResponse: return AccountsResourceWithStreamingResponse(self._client.accounts) + @cached_property + def organizations(self) -> organizations.OrganizationsResourceWithStreamingResponse: + from .resources.organizations import OrganizationsResourceWithStreamingResponse + + return OrganizationsResourceWithStreamingResponse(self._client.organizations) + @cached_property def origin_ca_certificates(self) -> origin_ca_certificates.OriginCACertificatesResourceWithStreamingResponse: from .resources.origin_ca_certificates import OriginCACertificatesResourceWithStreamingResponse @@ -3678,6 +3710,12 @@ def accounts(self) -> accounts.AsyncAccountsResourceWithStreamingResponse: return AsyncAccountsResourceWithStreamingResponse(self._client.accounts) + @cached_property + def organizations(self) -> organizations.AsyncOrganizationsResourceWithStreamingResponse: + from .resources.organizations import AsyncOrganizationsResourceWithStreamingResponse + + return AsyncOrganizationsResourceWithStreamingResponse(self._client.organizations) + @cached_property def origin_ca_certificates(self) -> origin_ca_certificates.AsyncOriginCACertificatesResourceWithStreamingResponse: from .resources.origin_ca_certificates import AsyncOriginCACertificatesResourceWithStreamingResponse diff --git a/src/cloudflare/_compat.py b/src/cloudflare/_compat.py index 92d9ee61ee9..bdef67f0425 100644 --- a/src/cloudflare/_compat.py +++ b/src/cloudflare/_compat.py @@ -12,14 +12,13 @@ _T = TypeVar("_T") _ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel) -# --------------- Pydantic v2 compatibility --------------- +# --------------- Pydantic v2, v3 compatibility --------------- # Pyright incorrectly reports some of our functions as overriding a method when they don't # pyright: reportIncompatibleMethodOverride=false -PYDANTIC_V2 = pydantic.VERSION.startswith("2.") +PYDANTIC_V1 = pydantic.VERSION.startswith("1.") -# v1 re-exports if TYPE_CHECKING: def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001 @@ -44,90 +43,92 @@ def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001 ... else: - if PYDANTIC_V2: - from pydantic.v1.typing import ( + # v1 re-exports + if PYDANTIC_V1: + from pydantic.typing import ( get_args as get_args, is_union as is_union, get_origin as get_origin, is_typeddict as is_typeddict, is_literal_type as is_literal_type, ) - from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime + from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime else: - from pydantic.typing import ( + from ._utils import ( get_args as get_args, is_union as is_union, get_origin as get_origin, + parse_date as parse_date, is_typeddict as is_typeddict, + parse_datetime as parse_datetime, is_literal_type as is_literal_type, ) - from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime # refactored config if TYPE_CHECKING: from pydantic import ConfigDict as ConfigDict else: - if PYDANTIC_V2: - from pydantic import ConfigDict - else: + if PYDANTIC_V1: # TODO: provide an error message here? ConfigDict = None + else: + from pydantic import ConfigDict as ConfigDict # renamed methods / properties def parse_obj(model: type[_ModelT], value: object) -> _ModelT: - if PYDANTIC_V2: - return model.model_validate(value) - else: + if PYDANTIC_V1: return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + else: + return model.model_validate(value) def field_is_required(field: FieldInfo) -> bool: - if PYDANTIC_V2: - return field.is_required() - return field.required # type: ignore + if PYDANTIC_V1: + return field.required # type: ignore + return field.is_required() def field_get_default(field: FieldInfo) -> Any: value = field.get_default() - if PYDANTIC_V2: - from pydantic_core import PydanticUndefined - - if value == PydanticUndefined: - return None + if PYDANTIC_V1: return value + from pydantic_core import PydanticUndefined + + if value == PydanticUndefined: + return None return value def field_outer_type(field: FieldInfo) -> Any: - if PYDANTIC_V2: - return field.annotation - return field.outer_type_ # type: ignore + if PYDANTIC_V1: + return field.outer_type_ # type: ignore + return field.annotation def get_model_config(model: type[pydantic.BaseModel]) -> Any: - if PYDANTIC_V2: - return model.model_config - return model.__config__ # type: ignore + if PYDANTIC_V1: + return model.__config__ # type: ignore + return model.model_config def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]: - if PYDANTIC_V2: - return model.model_fields - return model.__fields__ # type: ignore + if PYDANTIC_V1: + return model.__fields__ # type: ignore + return model.model_fields def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT: - if PYDANTIC_V2: - return model.model_copy(deep=deep) - return model.copy(deep=deep) # type: ignore + if PYDANTIC_V1: + return model.copy(deep=deep) # type: ignore + return model.model_copy(deep=deep) def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: - if PYDANTIC_V2: - return model.model_dump_json(indent=indent) - return model.json(indent=indent) # type: ignore + if PYDANTIC_V1: + return model.json(indent=indent) # type: ignore + return model.model_dump_json(indent=indent) def model_dump( @@ -139,14 +140,14 @@ def model_dump( warnings: bool = True, mode: Literal["json", "python"] = "python", ) -> dict[str, Any]: - if PYDANTIC_V2 or hasattr(model, "model_dump"): + if (not PYDANTIC_V1) or hasattr(model, "model_dump"): return model.model_dump( mode=mode, exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 - warnings=warnings if PYDANTIC_V2 else True, + warnings=True if PYDANTIC_V1 else warnings, ) return cast( "dict[str, Any]", @@ -159,9 +160,9 @@ def model_dump( def model_parse(model: type[_ModelT], data: Any) -> _ModelT: - if PYDANTIC_V2: - return model.model_validate(data) - return model.parse_obj(data) # pyright: ignore[reportDeprecated] + if PYDANTIC_V1: + return model.parse_obj(data) # pyright: ignore[reportDeprecated] + return model.model_validate(data) # generic models @@ -170,17 +171,16 @@ def model_parse(model: type[_ModelT], data: Any) -> _ModelT: class GenericModel(pydantic.BaseModel): ... else: - if PYDANTIC_V2: + if PYDANTIC_V1: + import pydantic.generics + + class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ... + else: # there no longer needs to be a distinction in v2 but # we still have to create our own subclass to avoid # inconsistent MRO ordering errors class GenericModel(pydantic.BaseModel): ... - else: - import pydantic.generics - - class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ... - # cached properties if TYPE_CHECKING: diff --git a/src/cloudflare/_files.py b/src/cloudflare/_files.py index 8c03622633a..0c0ce12faaa 100644 --- a/src/cloudflare/_files.py +++ b/src/cloudflare/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() diff --git a/src/cloudflare/_models.py b/src/cloudflare/_models.py index 7bf82bb0bde..eefba0b5349 100644 --- a/src/cloudflare/_models.py +++ b/src/cloudflare/_models.py @@ -2,9 +2,10 @@ import os import inspect -from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast +from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast from datetime import date, datetime from typing_extensions import ( + List, Unpack, Literal, ClassVar, @@ -50,7 +51,7 @@ strip_annotated_type, ) from ._compat import ( - PYDANTIC_V2, + PYDANTIC_V1, ConfigDict, GenericModel as BaseGenericModel, get_args, @@ -81,11 +82,7 @@ class _ConfigProtocol(Protocol): class BaseModel(pydantic.BaseModel): - if PYDANTIC_V2: - model_config: ClassVar[ConfigDict] = ConfigDict( - extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true")) - ) - else: + if PYDANTIC_V1: @property @override @@ -95,6 +92,10 @@ def model_fields_set(self) -> set[str]: class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] extra: Any = pydantic.Extra.allow # type: ignore + else: + model_config: ClassVar[ConfigDict] = ConfigDict( + extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true")) + ) def to_dict( self, @@ -208,28 +209,32 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] else: fields_values[name] = field_get_default(field) + extra_field_type = _get_extra_fields_type(__cls) + _extra = {} for key, value in values.items(): if key not in model_fields: - if PYDANTIC_V2: - _extra[key] = value - else: + parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value + + if PYDANTIC_V1: _fields_set.add(key) - fields_values[key] = value + fields_values[key] = parsed + else: + _extra[key] = parsed object.__setattr__(m, "__dict__", fields_values) - if PYDANTIC_V2: - # these properties are copied from Pydantic's `model_construct()` method - object.__setattr__(m, "__pydantic_private__", None) - object.__setattr__(m, "__pydantic_extra__", _extra) - object.__setattr__(m, "__pydantic_fields_set__", _fields_set) - else: + if PYDANTIC_V1: # init_private_attributes() does not exist in v2 m._init_private_attributes() # type: ignore # copied from Pydantic v1's `construct()` method object.__setattr__(m, "__fields_set__", _fields_set) + else: + # these properties are copied from Pydantic's `model_construct()` method + object.__setattr__(m, "__pydantic_private__", None) + object.__setattr__(m, "__pydantic_extra__", _extra) + object.__setattr__(m, "__pydantic_fields_set__", _fields_set) return m @@ -239,7 +244,7 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] # although not in practice model_construct = construct - if not PYDANTIC_V2: + if PYDANTIC_V1: # we define aliases for some of the new pydantic v2 methods so # that we can just document these methods without having to specify # a specific pydantic version as some users may not know which @@ -252,7 +257,7 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, @@ -260,6 +265,7 @@ def model_dump( warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, serialize_as_any: bool = False, + fallback: Callable[[Any], Any] | None = None, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -291,16 +297,18 @@ def model_dump( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, ) - return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped + return cast("dict[str, Any]", json_safe(dumped)) if mode == "json" else dumped @override def model_dump_json( @@ -309,13 +317,14 @@ def model_dump_json( indent: int | None = None, include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, + fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, ) -> str: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json @@ -344,11 +353,13 @@ def model_dump_json( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, @@ -359,15 +370,32 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: if value is None: return field_get_default(field) - if PYDANTIC_V2: - type_ = field.annotation - else: + if PYDANTIC_V1: type_ = cast(type, field.outer_type_) # type: ignore + else: + type_ = field.annotation # type: ignore if type_ is None: raise RuntimeError(f"Unexpected field type is None for {key}") - return construct_type(value=value, type_=type_) + return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) + + +def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: + if PYDANTIC_V1: + # TODO + return None + + schema = cls.__pydantic_core_schema__ + if schema["type"] == "model": + fields = schema["schema"] + if fields["type"] == "model-fields": + extras = fields.get("extras_schema") + if extras and "cls" in extras: + # mypy can't narrow the type + return extras["cls"] # type: ignore[no-any-return] + + return None def is_basemodel(type_: type) -> bool: @@ -421,7 +449,7 @@ def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T: return cast(_T, construct_type(value=value, type_=type_)) -def construct_type(*, value: object, type_: object) -> object: +def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]] = None) -> object: """Loose coercion to the expected type with construction of nested values. If the given value does not match the expected type then it is returned as-is. @@ -439,8 +467,10 @@ def construct_type(*, value: object, type_: object) -> object: type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` - if is_annotated_type(type_): - meta: tuple[Any, ...] = get_args(type_)[1:] + if metadata is not None and len(metadata) > 0: + meta: tuple[Any, ...] = tuple(metadata) + elif is_annotated_type(type_): + meta = get_args(type_)[1:] type_ = extract_type_arg(type_, 0) else: meta = tuple() @@ -605,30 +635,30 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, for variant in get_args(union): variant = strip_annotated_type(variant) if is_basemodel_type(variant): - if PYDANTIC_V2: - field = _extract_field_schema_pv2(variant, discriminator_field_name) - if not field: + if PYDANTIC_V1: + field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + if not field_info: continue # Note: if one variant defines an alias then they all should - discriminator_alias = field.get("serialization_alias") - - field_schema = field["schema"] + discriminator_alias = field_info.alias - if field_schema["type"] == "literal": - for entry in cast("LiteralSchema", field_schema)["expected"]: + if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): + for entry in get_args(annotation): if isinstance(entry, str): mapping[entry] = variant else: - field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] - if not field_info: + field = _extract_field_schema_pv2(variant, discriminator_field_name) + if not field: continue # Note: if one variant defines an alias then they all should - discriminator_alias = field_info.alias + discriminator_alias = field.get("serialization_alias") - if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): - for entry in get_args(annotation): + field_schema = field["schema"] + + if field_schema["type"] == "literal": + for entry in cast("LiteralSchema", field_schema)["expected"]: if isinstance(entry, str): mapping[entry] = variant @@ -691,7 +721,7 @@ class GenericModel(BaseGenericModel, BaseModel): pass -if PYDANTIC_V2: +if not PYDANTIC_V1: from pydantic import TypeAdapter as _TypeAdapter _CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter)) @@ -761,12 +791,12 @@ class FinalRequestOptions(pydantic.BaseModel): json_data: Union[Body, None] = None extra_json: Union[AnyMapping, None] = None - if PYDANTIC_V2: - model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True) - else: + if PYDANTIC_V1: class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] arbitrary_types_allowed: bool = True + else: + model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True) def get_max_retries(self, max_retries: int) -> int: if isinstance(self.max_retries, NotGiven): @@ -799,9 +829,9 @@ def construct( # type: ignore key: strip_not_given(value) for key, value in values.items() } - if PYDANTIC_V2: - return super().model_construct(_fields_set, **kwargs) - return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated] + if PYDANTIC_V1: + return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated] + return super().model_construct(_fields_set, **kwargs) if not TYPE_CHECKING: # type checkers incorrectly complain about this assignment diff --git a/src/cloudflare/_qs.py b/src/cloudflare/_qs.py index 274320ca5ee..ada6fd3f721 100644 --- a/src/cloudflare/_qs.py +++ b/src/cloudflare/_qs.py @@ -4,7 +4,7 @@ from urllib.parse import parse_qs, urlencode from typing_extensions import Literal, get_args -from ._types import NOT_GIVEN, NotGiven, NotGivenOr +from ._types import NotGiven, not_given from ._utils import flatten _T = TypeVar("_T") @@ -41,8 +41,8 @@ def stringify( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> str: return urlencode( self.stringify_items( @@ -56,8 +56,8 @@ def stringify_items( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> list[tuple[str, str]]: opts = Options( qs=self, @@ -143,8 +143,8 @@ def __init__( self, qs: Querystring = _qs, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> None: self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format diff --git a/src/cloudflare/_types.py b/src/cloudflare/_types.py index 1d0b53f5ab8..001b3ee159d 100644 --- a/src/cloudflare/_types.py +++ b/src/cloudflare/_types.py @@ -13,10 +13,21 @@ Mapping, TypeVar, Callable, + Iterator, Optional, Sequence, ) -from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable +from typing_extensions import ( + Set, + Literal, + Protocol, + TypeAlias, + TypedDict, + SupportsIndex, + overload, + override, + runtime_checkable, +) import httpx import pydantic @@ -109,18 +120,21 @@ class RequestOptions(TypedDict, total=False): # Sentinel class used until PEP 0661 is accepted class NotGiven: """ - A sentinel singleton class used to distinguish omitted keyword arguments - from those passed in with the value None (which may have different behavior). + For parameters with a meaningful None value, we need to distinguish between + the user explicitly passing None, and the user not passing the parameter at + all. + + User code shouldn't need to use not_given directly. For example: ```py - def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ... + def create(timeout: Timeout | None | NotGiven = not_given): ... - get(timeout=1) # 1s timeout - get(timeout=None) # No timeout - get() # Default timeout behavior, which may not be statically known at the method definition. + create(timeout=1) # 1s timeout + create(timeout=None) # No timeout + create() # Default timeout behavior ``` """ @@ -132,13 +146,14 @@ def __repr__(self) -> str: return "NOT_GIVEN" -NotGivenOr = Union[_T, NotGiven] +not_given = NotGiven() +# for backwards compatibility: NOT_GIVEN = NotGiven() class Omit: - """In certain situations you need to be able to represent a case where a default value has - to be explicitly removed and `None` is not an appropriate substitute, for example: + """ + To explicitly omit something from being sent in a request, use `omit`. ```py # as the default `Content-Type` header is `application/json` that will be sent @@ -148,8 +163,8 @@ class Omit: # to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983' client.post(..., headers={"Content-Type": "multipart/form-data"}) - # instead you can remove the default `application/json` header by passing Omit - client.post(..., headers={"Content-Type": Omit()}) + # instead you can remove the default `application/json` header by passing omit + client.post(..., headers={"Content-Type": omit}) ``` """ @@ -157,6 +172,9 @@ def __bool__(self) -> Literal[False]: return False +omit = Omit() + + @runtime_checkable class ModelBuilderProtocol(Protocol): @classmethod @@ -220,3 +238,26 @@ class _GenericAlias(Protocol): class HttpxSendArgs(TypedDict, total=False): auth: httpx.Auth follow_redirects: bool + + +_T_co = TypeVar("_T_co", covariant=True) + + +if TYPE_CHECKING: + # This works because str.__contains__ does not accept object (either in typeshed or at runtime) + # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + class SequenceNotStr(Protocol[_T_co]): + @overload + def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... + @overload + def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... + def __contains__(self, value: object, /) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T_co]: ... + def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... + def count(self, value: Any, /) -> int: ... + def __reversed__(self) -> Iterator[_T_co]: ... +else: + # just point this to a normal `Sequence` at runtime to avoid having to special case + # deserializing our custom sequence type + SequenceNotStr = Sequence diff --git a/src/cloudflare/_utils/__init__.py b/src/cloudflare/_utils/__init__.py index d4fda26f3c2..dc64e29a1c0 100644 --- a/src/cloudflare/_utils/__init__.py +++ b/src/cloudflare/_utils/__init__.py @@ -10,7 +10,6 @@ lru_cache as lru_cache, is_mapping as is_mapping, is_tuple_t as is_tuple_t, - parse_date as parse_date, is_iterable as is_iterable, is_sequence as is_sequence, coerce_float as coerce_float, @@ -23,7 +22,6 @@ coerce_boolean as coerce_boolean, coerce_integer as coerce_integer, file_from_path as file_from_path, - parse_datetime as parse_datetime, strip_not_given as strip_not_given, deepcopy_minimal as deepcopy_minimal, get_async_library as get_async_library, @@ -32,12 +30,20 @@ maybe_coerce_boolean as maybe_coerce_boolean, maybe_coerce_integer as maybe_coerce_integer, ) +from ._compat import ( + get_args as get_args, + is_union as is_union, + get_origin as get_origin, + is_typeddict as is_typeddict, + is_literal_type as is_literal_type, +) from ._typing import ( is_list_type as is_list_type, is_union_type as is_union_type, extract_type_arg as extract_type_arg, is_iterable_type as is_iterable_type, is_required_type as is_required_type, + is_sequence_type as is_sequence_type, is_annotated_type as is_annotated_type, is_type_alias_type as is_type_alias_type, strip_annotated_type as strip_annotated_type, @@ -55,3 +61,4 @@ function_has_argument as function_has_argument, assert_signatures_in_sync as assert_signatures_in_sync, ) +from ._datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime diff --git a/src/cloudflare/_utils/_compat.py b/src/cloudflare/_utils/_compat.py new file mode 100644 index 00000000000..dd703233c56 --- /dev/null +++ b/src/cloudflare/_utils/_compat.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +import sys +import typing_extensions +from typing import Any, Type, Union, Literal, Optional +from datetime import date, datetime +from typing_extensions import get_args as _get_args, get_origin as _get_origin + +from .._types import StrBytesIntFloat +from ._datetime_parse import parse_date as _parse_date, parse_datetime as _parse_datetime + +_LITERAL_TYPES = {Literal, typing_extensions.Literal} + + +def get_args(tp: type[Any]) -> tuple[Any, ...]: + return _get_args(tp) + + +def get_origin(tp: type[Any]) -> type[Any] | None: + return _get_origin(tp) + + +def is_union(tp: Optional[Type[Any]]) -> bool: + if sys.version_info < (3, 10): + return tp is Union # type: ignore[comparison-overlap] + else: + import types + + return tp is Union or tp is types.UnionType + + +def is_typeddict(tp: Type[Any]) -> bool: + return typing_extensions.is_typeddict(tp) + + +def is_literal_type(tp: Type[Any]) -> bool: + return get_origin(tp) in _LITERAL_TYPES + + +def parse_date(value: Union[date, StrBytesIntFloat]) -> date: + return _parse_date(value) + + +def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: + return _parse_datetime(value) diff --git a/src/cloudflare/_utils/_datetime_parse.py b/src/cloudflare/_utils/_datetime_parse.py new file mode 100644 index 00000000000..7cb9d9e668c --- /dev/null +++ b/src/cloudflare/_utils/_datetime_parse.py @@ -0,0 +1,136 @@ +""" +This file contains code from https://github.com/pydantic/pydantic/blob/main/pydantic/v1/datetime_parse.py +without the Pydantic v1 specific errors. +""" + +from __future__ import annotations + +import re +from typing import Dict, Union, Optional +from datetime import date, datetime, timezone, timedelta + +from .._types import StrBytesIntFloat + +date_expr = r"(?P\d{4})-(?P\d{1,2})-(?P\d{1,2})" +time_expr = ( + r"(?P\d{1,2}):(?P\d{1,2})" + r"(?::(?P\d{1,2})(?:\.(?P\d{1,6})\d{0,6})?)?" + r"(?PZ|[+-]\d{2}(?::?\d{2})?)?$" +) + +date_re = re.compile(f"{date_expr}$") +datetime_re = re.compile(f"{date_expr}[T ]{time_expr}") + + +EPOCH = datetime(1970, 1, 1) +# if greater than this, the number is in ms, if less than or equal it's in seconds +# (in seconds this is 11th October 2603, in ms it's 20th August 1970) +MS_WATERSHED = int(2e10) +# slightly more than datetime.max in ns - (datetime.max - EPOCH).total_seconds() * 1e9 +MAX_NUMBER = int(3e20) + + +def _get_numeric(value: StrBytesIntFloat, native_expected_type: str) -> Union[None, int, float]: + if isinstance(value, (int, float)): + return value + try: + return float(value) + except ValueError: + return None + except TypeError: + raise TypeError(f"invalid type; expected {native_expected_type}, string, bytes, int or float") from None + + +def _from_unix_seconds(seconds: Union[int, float]) -> datetime: + if seconds > MAX_NUMBER: + return datetime.max + elif seconds < -MAX_NUMBER: + return datetime.min + + while abs(seconds) > MS_WATERSHED: + seconds /= 1000 + dt = EPOCH + timedelta(seconds=seconds) + return dt.replace(tzinfo=timezone.utc) + + +def _parse_timezone(value: Optional[str]) -> Union[None, int, timezone]: + if value == "Z": + return timezone.utc + elif value is not None: + offset_mins = int(value[-2:]) if len(value) > 3 else 0 + offset = 60 * int(value[1:3]) + offset_mins + if value[0] == "-": + offset = -offset + return timezone(timedelta(minutes=offset)) + else: + return None + + +def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: + """ + Parse a datetime/int/float/string and return a datetime.datetime. + + This function supports time zone offsets. When the input contains one, + the output uses a timezone with a fixed offset from UTC. + + Raise ValueError if the input is well formatted but not a valid datetime. + Raise ValueError if the input isn't well formatted. + """ + if isinstance(value, datetime): + return value + + number = _get_numeric(value, "datetime") + if number is not None: + return _from_unix_seconds(number) + + if isinstance(value, bytes): + value = value.decode() + + assert not isinstance(value, (float, int)) + + match = datetime_re.match(value) + if match is None: + raise ValueError("invalid datetime format") + + kw = match.groupdict() + if kw["microsecond"]: + kw["microsecond"] = kw["microsecond"].ljust(6, "0") + + tzinfo = _parse_timezone(kw.pop("tzinfo")) + kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None} + kw_["tzinfo"] = tzinfo + + return datetime(**kw_) # type: ignore + + +def parse_date(value: Union[date, StrBytesIntFloat]) -> date: + """ + Parse a date/int/float/string and return a datetime.date. + + Raise ValueError if the input is well formatted but not a valid date. + Raise ValueError if the input isn't well formatted. + """ + if isinstance(value, date): + if isinstance(value, datetime): + return value.date() + else: + return value + + number = _get_numeric(value, "date") + if number is not None: + return _from_unix_seconds(number).date() + + if isinstance(value, bytes): + value = value.decode() + + assert not isinstance(value, (float, int)) + match = date_re.match(value) + if match is None: + raise ValueError("invalid date format") + + kw = {k: int(v) for k, v in match.groupdict().items()} + + try: + return date(**kw) + except ValueError: + raise ValueError("invalid date format") from None diff --git a/src/cloudflare/_utils/_transform.py b/src/cloudflare/_utils/_transform.py index b0cc20a7355..5207549207e 100644 --- a/src/cloudflare/_utils/_transform.py +++ b/src/cloudflare/_utils/_transform.py @@ -16,18 +16,20 @@ lru_cache, is_mapping, is_iterable, + is_sequence, ) from .._files import is_base64_file_input +from ._compat import get_origin, is_typeddict from ._typing import ( is_list_type, is_union_type, extract_type_arg, is_iterable_type, is_required_type, + is_sequence_type, is_annotated_type, strip_annotated_type, ) -from .._compat import get_origin, model_dump, is_typeddict _T = TypeVar("_T") @@ -167,6 +169,8 @@ def _transform_recursive( Defaults to the same value as the `annotation` argument. """ + from .._compat import model_dump + if inner_type is None: inner_type = annotation @@ -184,6 +188,8 @@ def _transform_recursive( (is_list_type(stripped_type) and is_list(data)) # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + # Sequence[T] + or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str)) ): # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually # intended as an iterable, so we don't transform it. @@ -262,7 +268,7 @@ def _transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue @@ -329,6 +335,8 @@ async def _async_transform_recursive( Defaults to the same value as the `annotation` argument. """ + from .._compat import model_dump + if inner_type is None: inner_type = annotation @@ -346,6 +354,8 @@ async def _async_transform_recursive( (is_list_type(stripped_type) and is_list(data)) # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + # Sequence[T] + or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str)) ): # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually # intended as an iterable, so we don't transform it. @@ -424,7 +434,7 @@ async def _async_transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue diff --git a/src/cloudflare/_utils/_typing.py b/src/cloudflare/_utils/_typing.py index 1bac9542e20..193109f3ad2 100644 --- a/src/cloudflare/_utils/_typing.py +++ b/src/cloudflare/_utils/_typing.py @@ -15,7 +15,7 @@ from ._utils import lru_cache from .._types import InheritsGeneric -from .._compat import is_union as _is_union +from ._compat import is_union as _is_union def is_annotated_type(typ: type) -> bool: @@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool: return (get_origin(typ) or typ) == list +def is_sequence_type(typ: type) -> bool: + origin = get_origin(typ) or typ + return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence + + def is_iterable_type(typ: type) -> bool: """If the given type is `typing.Iterable[T]`""" origin = get_origin(typ) or typ diff --git a/src/cloudflare/_utils/_utils.py b/src/cloudflare/_utils/_utils.py index ea3cf3f2c38..50d59269adb 100644 --- a/src/cloudflare/_utils/_utils.py +++ b/src/cloudflare/_utils/_utils.py @@ -21,8 +21,7 @@ import sniffio -from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike -from .._compat import parse_date as parse_date, parse_datetime as parse_datetime +from .._types import Omit, NotGiven, FileTypes, HeadersLike _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) @@ -64,7 +63,7 @@ def _extract_items( try: key = path[index] except IndexError: - if isinstance(obj, NotGiven): + if not is_given(obj): # no value was provided - we can safely ignore return [] @@ -127,8 +126,8 @@ def _extract_items( return [] -def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]: - return not isinstance(obj, NotGiven) +def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: + return not isinstance(obj, NotGiven) and not isinstance(obj, Omit) # Type safe methods for narrowing types with TypeVars. diff --git a/src/cloudflare/_version.py b/src/cloudflare/_version.py index 0d479c2e651..ffdaa193fd4 100644 --- a/src/cloudflare/_version.py +++ b/src/cloudflare/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "cloudflare" -__version__ = "4.3.1" # x-release-please-version +__version__ = "5.0.0" # x-release-please-version diff --git a/src/cloudflare/pagination.py b/src/cloudflare/pagination.py index 947aca4121a..ee3916506ff 100644 --- a/src/cloudflare/pagination.py +++ b/src/cloudflare/pagination.py @@ -17,6 +17,10 @@ "CursorPaginationResultInfo", "SyncCursorPagination", "AsyncCursorPagination", + "CursorPaginationAfterResultInfo", + "CursorPaginationAfterCursors", + "SyncCursorPaginationAfter", + "AsyncCursorPaginationAfter", "CursorLimitPaginationResultInfo", "SyncCursorLimitPagination", "AsyncCursorLimitPagination", @@ -175,6 +179,62 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"cursor": cursor}) +class CursorPaginationAfterCursors(BaseModel): + after: Optional[str] = None + + +class CursorPaginationAfterResultInfo(BaseModel): + cursors: Optional[CursorPaginationAfterCursors] = None + + +class SyncCursorPaginationAfter(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + result: List[_T] + result_info: Optional[CursorPaginationAfterResultInfo] = None + + @override + def _get_page_items(self) -> List[_T]: + result = self.result + if not result: + return [] + return result + + @override + def next_page_info(self) -> Optional[PageInfo]: + after = None + if self.result_info is not None: + if self.result_info.cursors is not None: + if self.result_info.cursors.after is not None: + after = self.result_info.cursors.after + if not after: + return None + + return PageInfo(params={"cursor": after}) + + +class AsyncCursorPaginationAfter(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + result: List[_T] + result_info: Optional[CursorPaginationAfterResultInfo] = None + + @override + def _get_page_items(self) -> List[_T]: + result = self.result + if not result: + return [] + return result + + @override + def next_page_info(self) -> Optional[PageInfo]: + after = None + if self.result_info is not None: + if self.result_info.cursors is not None: + if self.result_info.cursors.after is not None: + after = self.result_info.cursors.after + if not after: + return None + + return PageInfo(params={"cursor": after}) + + class CursorLimitPaginationResultInfo(BaseModel): count: Optional[int] = None diff --git a/src/cloudflare/resources/abuse_reports.py b/src/cloudflare/resources/abuse_reports.py index e3e3af888d9..5a9ddd12c30 100644 --- a/src/cloudflare/resources/abuse_reports.py +++ b/src/cloudflare/resources/abuse_reports.py @@ -7,7 +7,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,84 +48,44 @@ def with_streaming_response(self) -> AbuseReportsResourceWithStreamingResponse: @overload def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_dmca"], + address1: str, + agent_name: str, + agree: Literal[1], + city: str, + country: str, email: str, email2: str, + host_notification: Literal["send"], name: str, + original_work: str, + owner_notification: Literal["send"], + signature: str, + state: str, urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type - - act: The abuse report type - - email: A valid email of the abuse reporter. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - email2: Should match the value provided in `email` + report_param: The report type for submitted reports. - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). + act: The report type for submitted reports. address1: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). @@ -139,29 +99,19 @@ def create( city: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - comments: Any additional comments about the infringement not exceeding 2000 characters - - company: Text not exceeding 100 characters. This field may be released by Cloudflare to + country: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - country: Text not exceeding 255 characters. This field may be released by Cloudflare to + email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique + email2: Should match the value provided in `email` host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. + name: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). @@ -169,36 +119,31 @@ def create( owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - - reported_country: Text containing 2 characters - - reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - state: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters. This field may be released by Cloudflare to + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). + + comments: Any additional comments about the infringement not exceeding 2000 characters + + company: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - title: Text not exceeding 255 characters + reported_country: Text containing 2 characters - trademark_number: Text not exceeding 1000 characters + reported_user_agent: Text not exceeding 255 characters - trademark_office: Text not exceeding 1000 characters + tele: Text not exceeding 20 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - trademark_symbol: Text not exceeding 1000 characters + title: Text not exceeding 255 characters extra_headers: Send extra headers @@ -213,158 +158,84 @@ def create( @overload def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_trademark"], email: str, email2: str, + host_notification: Literal["send"], + justification: str, name: str, + owner_notification: Literal["send"], + trademark_number: str, + trademark_office: str, + trademark_symbol: str, urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). - - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). - - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports - - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - comments: Any additional comments about the infringement not exceeding 2000 characters - - company: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - country: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. justification: A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 - characters + characters. - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. + trademark_number: Text not exceeding 1000 characters - reported_country: Text containing 2 characters + trademark_office: Text not exceeding 1000 characters - reported_user_agent: Text not exceeding 255 characters + trademark_symbol: Text not exceeding 1000 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique + comments: Any additional comments about the infringement not exceeding 2000 characters - state: Text not exceeding 255 characters. This field may be released by Cloudflare to + company: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). + reported_country: Text containing 2 characters + + reported_user_agent: Text not exceeding 255 characters + tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -378,126 +249,72 @@ def create( @overload def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_general"], email: str, email2: str, + host_notification: Literal["send", "send-anon"], + justification: str, name: str, + owner_notification: Literal["send", "send-anon", "none"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + destination_ips: str | Omit = omit, + ports_protocols: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + source_ips: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). + justification: A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters. - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). - - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters company: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - country: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of + destination_ips: A list of IP addresses separated by ‘\n’ (new line character). The list of destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. + ought to be unique. ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. Each individual @@ -508,28 +325,15 @@ def create( reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + source_ips: A list of IP addresses separated by ‘\n’ (new line character). The list of + source IPs should not exceed 30 IP addresses. Each one of the IP addresses ought + to be unique. tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -543,158 +347,79 @@ def create( @overload def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_phishing"], email: str, email2: str, + host_notification: Literal["send", "send-anon"], + justification: str, name: str, + owner_notification: Literal["send", "send-anon"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + original_work: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). + justification: A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters. - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). - - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters company: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - country: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - reported_country: Text containing 2 characters reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -708,96 +433,65 @@ def create( @overload def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_children"], email: str, email2: str, + host_notification: Literal["send", "send-anon"], + justification: str, name: str, + ncmec_notification: Literal["send", "send-anon"], + owner_notification: Literal["send", "send-anon", "none"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + country: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). + justification: A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters. - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). + ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters @@ -807,60 +501,16 @@ def create( country: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique + reported_country: Text containing 2 characters - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. + reported_user_agent: Text not exceeding 255 characters - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters + tele: Text not exceeding 20 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. + title: Text not exceeding 255 characters - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - - reported_country: Text containing 2 characters - - reported_user_agent: Text not exceeding 255 characters - - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - tele: Text not exceeding 20 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - title: Text not exceeding 255 characters - - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - - extra_headers: Send extra headers + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -873,158 +523,75 @@ def create( @overload def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_threat"], email: str, email2: str, + host_notification: Literal["send", "send-anon"], + justification: str, name: str, + owner_notification: Literal["send", "send-anon"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). - - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). - - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports - - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - comments: Any additional comments about the infringement not exceeding 2000 characters - - company: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - country: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. justification: A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. + characters. - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - - reported_country: Text containing 2 characters + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). - reported_user_agent: Text not exceeding 255 characters + comments: Any additional comments about the infringement not exceeding 2000 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports + company: Text not exceeding 100 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique + reported_country: Text containing 2 characters - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + reported_user_agent: Text not exceeding 255 characters tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1038,71 +605,35 @@ def create( @overload def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_registrar_whois"], email: str, email2: str, name: str, + owner_notification: Literal["send", "send-anon", "none"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). @@ -1112,84 +643,28 @@ def create( name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). - - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). - - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters company: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - country: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - reported_country: Text containing 2 characters reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1203,96 +678,59 @@ def create( @overload def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_ncsei"], email: str, email2: str, + host_notification: Literal["send", "send-anon"], name: str, + ncsei_subject_representation: bool, + owner_notification: Literal["send", "send-anon", "none"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + country: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). + ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters @@ -1302,59 +740,15 @@ def create( country: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - reported_country: Text containing 2 characters reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1365,105 +759,162 @@ def create( """ ... - @required_args(["account_id", "act", "email", "email2", "name", "urls"]) + @required_args( + [ + "account_id", + "act", + "address1", + "agent_name", + "agree", + "city", + "country", + "email", + "email2", + "host_notification", + "name", + "original_work", + "owner_notification", + "signature", + "state", + "urls", + ], + [ + "account_id", + "act", + "email", + "email2", + "host_notification", + "justification", + "name", + "owner_notification", + "trademark_number", + "trademark_office", + "trademark_symbol", + "urls", + ], + [ + "account_id", + "act", + "email", + "email2", + "host_notification", + "justification", + "name", + "owner_notification", + "urls", + ], + [ + "account_id", + "act", + "email", + "email2", + "host_notification", + "justification", + "name", + "ncmec_notification", + "owner_notification", + "urls", + ], + ["account_id", "act", "email", "email2", "name", "owner_notification", "urls"], + [ + "account_id", + "act", + "email", + "email2", + "host_notification", + "name", + "ncsei_subject_representation", + "owner_notification", + "urls", + ], + ) def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_dmca"] + | Literal["abuse_trademark"] + | Literal["abuse_general"] + | Literal["abuse_phishing"] + | Literal["abuse_children"] + | Literal["abuse_threat"] + | Literal["abuse_registrar_whois"] + | Literal["abuse_ncsei"], + address1: str | Omit = omit, + agent_name: str | Omit = omit, + agree: Literal[1] | Omit = omit, + city: str | Omit = omit, + country: str | Omit = omit, email: str, email2: str, + host_notification: Literal["send"] | Literal["send", "send-anon"] | Omit = omit, name: str, + original_work: str | Omit = omit, + owner_notification: Literal["send"] | Literal["send", "send-anon", "none"] | Literal["send", "send-anon"], + signature: str | Omit = omit, + state: str | Omit = omit, urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: str | Omit = omit, + justification: str | Omit = omit, + trademark_number: str | Omit = omit, + trademark_office: str | Omit = omit, + trademark_symbol: str | Omit = omit, + destination_ips: str | Omit = omit, + ports_protocols: str | Omit = omit, + source_ips: str | Omit = omit, + ncmec_notification: Literal["send", "send-anon"] | Omit = omit, + ncsei_subject_representation: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not report_type: - raise ValueError(f"Expected a non-empty value for `report_type` but received {report_type!r}") + if not report_param: + raise ValueError(f"Expected a non-empty value for `report_param` but received {report_param!r}") return self._post( - f"/accounts/{account_id}/abuse-reports/{report_type}", + f"/accounts/{account_id}/abuse-reports/{report_param}", body=maybe_transform( { "act": act, - "email": email, - "email2": email2, - "name": name, - "urls": urls, "address1": address1, "agent_name": agent_name, "agree": agree, "city": city, - "comments": comments, - "company": company, "country": country, - "destination_ips": destination_ips, + "email": email, + "email2": email2, "host_notification": host_notification, - "justification": justification, - "ncmec_notification": ncmec_notification, - "ncsei_subject_representation": ncsei_subject_representation, + "name": name, "original_work": original_work, "owner_notification": owner_notification, - "ports_protocols": ports_protocols, - "reported_country": reported_country, - "reported_user_agent": reported_user_agent, "signature": signature, - "source_ips": source_ips, "state": state, + "urls": urls, + "comments": comments, + "company": company, + "reported_country": reported_country, + "reported_user_agent": reported_user_agent, "tele": tele, "title": title, + "justification": justification, "trademark_number": trademark_number, "trademark_office": trademark_office, "trademark_symbol": trademark_symbol, + "destination_ips": destination_ips, + "ports_protocols": ports_protocols, + "source_ips": source_ips, + "ncmec_notification": ncmec_notification, + "ncsei_subject_representation": ncsei_subject_representation, }, abuse_report_create_params.AbuseReportCreateParams, ), @@ -1501,84 +952,44 @@ def with_streaming_response(self) -> AsyncAbuseReportsResourceWithStreamingRespo @overload async def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_dmca"], + address1: str, + agent_name: str, + agree: Literal[1], + city: str, + country: str, email: str, email2: str, + host_notification: Literal["send"], name: str, + original_work: str, + owner_notification: Literal["send"], + signature: str, + state: str, urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type - - act: The abuse report type - - email: A valid email of the abuse reporter. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - email2: Should match the value provided in `email` + report_param: The report type for submitted reports. - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). + act: The report type for submitted reports. address1: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). @@ -1592,29 +1003,19 @@ async def create( city: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - comments: Any additional comments about the infringement not exceeding 2000 characters - - company: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - country: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. + email: A valid email of the abuse reporter. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters + email2: Should match the value provided in `email` - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. + name: Text not exceeding 255 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). @@ -1622,36 +1023,31 @@ async def create( owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - - reported_country: Text containing 2 characters - - reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - state: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters. This field may be released by Cloudflare to + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). + + comments: Any additional comments about the infringement not exceeding 2000 characters + + company: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - title: Text not exceeding 255 characters + reported_country: Text containing 2 characters - trademark_number: Text not exceeding 1000 characters + reported_user_agent: Text not exceeding 255 characters - trademark_office: Text not exceeding 1000 characters + tele: Text not exceeding 20 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - trademark_symbol: Text not exceeding 1000 characters + title: Text not exceeding 255 characters extra_headers: Send extra headers @@ -1666,158 +1062,84 @@ async def create( @overload async def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_trademark"], email: str, email2: str, + host_notification: Literal["send"], + justification: str, name: str, + owner_notification: Literal["send"], + trademark_number: str, + trademark_office: str, + trademark_symbol: str, urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). - - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). - - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports - - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - comments: Any additional comments about the infringement not exceeding 2000 characters - - company: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - country: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. justification: A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 - characters + characters. - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. + trademark_number: Text not exceeding 1000 characters - reported_country: Text containing 2 characters + trademark_office: Text not exceeding 1000 characters - reported_user_agent: Text not exceeding 255 characters + trademark_symbol: Text not exceeding 1000 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique + comments: Any additional comments about the infringement not exceeding 2000 characters - state: Text not exceeding 255 characters. This field may be released by Cloudflare to + company: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). + reported_country: Text containing 2 characters + + reported_user_agent: Text not exceeding 255 characters + tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1831,126 +1153,72 @@ async def create( @overload async def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_general"], email: str, email2: str, + host_notification: Literal["send", "send-anon"], + justification: str, name: str, + owner_notification: Literal["send", "send-anon", "none"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + destination_ips: str | Omit = omit, + ports_protocols: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + source_ips: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). + justification: A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters. - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). - - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters company: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - country: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of + destination_ips: A list of IP addresses separated by ‘\n’ (new line character). The list of destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. + ought to be unique. ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. Each individual @@ -1961,28 +1229,15 @@ async def create( reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + source_ips: A list of IP addresses separated by ‘\n’ (new line character). The list of + source IPs should not exceed 30 IP addresses. Each one of the IP addresses ought + to be unique. tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1996,158 +1251,79 @@ async def create( @overload async def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_phishing"], email: str, email2: str, + host_notification: Literal["send", "send-anon"], + justification: str, name: str, + owner_notification: Literal["send", "send-anon"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + original_work: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). + justification: A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters. - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports - - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters company: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - country: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - reported_country: Text containing 2 characters reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2161,96 +1337,65 @@ async def create( @overload async def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_children"], email: str, email2: str, + host_notification: Literal["send", "send-anon"], + justification: str, name: str, + ncmec_notification: Literal["send", "send-anon"], + owner_notification: Literal["send", "send-anon", "none"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + country: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). + justification: A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters. - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). + ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters @@ -2260,59 +1405,15 @@ async def create( country: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - reported_country: Text containing 2 characters reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2326,158 +1427,75 @@ async def create( @overload async def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_threat"], email: str, email2: str, + host_notification: Literal["send", "send-anon"], + justification: str, name: str, + owner_notification: Literal["send", "send-anon"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). - - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). - - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports - - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - comments: Any additional comments about the infringement not exceeding 2000 characters - - company: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - country: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. justification: A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. + characters. - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - - reported_country: Text containing 2 characters + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). - reported_user_agent: Text not exceeding 255 characters + comments: Any additional comments about the infringement not exceeding 2000 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports + company: Text not exceeding 100 characters. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique + reported_country: Text containing 2 characters - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + reported_user_agent: Text not exceeding 255 characters tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2491,71 +1509,35 @@ async def create( @overload async def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_registrar_whois"], email: str, email2: str, name: str, + owner_notification: Literal["send", "send-anon", "none"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). @@ -2565,84 +1547,28 @@ async def create( name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). - - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports - - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters company: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - country: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - reported_country: Text containing 2 characters reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2656,96 +1582,59 @@ async def create( @overload async def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_ncsei"], email: str, email2: str, + host_notification: Literal["send", "send-anon"], name: str, + ncsei_subject_representation: bool, + owner_notification: Literal["send", "send-anon", "none"], urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + country: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Submit the Abuse Report of a particular type Args: - report_type: The abuse report type + report_param: The report type for submitted reports. - act: The abuse report type + act: The report type for submitted reports. email: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). email2: Should match the value provided in `email` - name: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - urls: A list of valid URLs separated by ‘ ’ (new line character). The list of the URLs - should not exceed 250 URLs. All URLs should have the same hostname. Each URL - should be unique. This field may be released by Cloudflare to third parties such - as the Lumen Database (https://lumendatabase.org/). + host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - address1: Text not exceeding 100 characters. This field may be released by Cloudflare to + name: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - agent_name: The name of the copyright holder. Text not exceeding 60 characters. This field - may be released by Cloudflare to third parties such as the Lumen Database - (https://lumendatabase.org/). + ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - agree: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports + owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark + reports cannot be anonymous. - city: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + urls: A list of valid URLs separated by ‘\n’ (new line character). The list of the + URLs should not exceed 250 URLs. All URLs should have the same hostname. Each + URL should be unique. This field may be released by Cloudflare to third parties + such as the Lumen Database (https://lumendatabase.org/). comments: Any additional comments about the infringement not exceeding 2000 characters @@ -2755,59 +1644,15 @@ async def create( country: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). - destination_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of - destination IPs should not exceed 30 IP addresses. Each one of the IP addresses - ought to be unique - - host_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - justification: A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - - ncmec_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ncsei_subject_representation: If the submitter is the target of NCSEI in the URLs of the abuse report. - - original_work: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - - owner_notification: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark - reports cannot be anonymous. - - ports_protocols: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total - size of the field should not exceed 2000 characters. Each individual - port/protocol should not exceed 100 characters. The list should not have more - than 30 unique ports and protocols. - reported_country: Text containing 2 characters reported_user_agent: Text not exceeding 255 characters - signature: Required for DMCA reports, should be same as Name. An affirmation that all - information in the report is true and accurate while agreeing to the policies of - Cloudflare's abuse reports - - source_ips: A list of IP addresses separated by ‘ ’ (new line character). The list of source - IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be - unique - - state: Text not exceeding 255 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - tele: Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). title: Text not exceeding 255 characters - trademark_number: Text not exceeding 1000 characters - - trademark_office: Text not exceeding 1000 characters - - trademark_symbol: Text not exceeding 1000 characters - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2818,105 +1663,162 @@ async def create( """ ... - @required_args(["account_id", "act", "email", "email2", "name", "urls"]) + @required_args( + [ + "account_id", + "act", + "address1", + "agent_name", + "agree", + "city", + "country", + "email", + "email2", + "host_notification", + "name", + "original_work", + "owner_notification", + "signature", + "state", + "urls", + ], + [ + "account_id", + "act", + "email", + "email2", + "host_notification", + "justification", + "name", + "owner_notification", + "trademark_number", + "trademark_office", + "trademark_symbol", + "urls", + ], + [ + "account_id", + "act", + "email", + "email2", + "host_notification", + "justification", + "name", + "owner_notification", + "urls", + ], + [ + "account_id", + "act", + "email", + "email2", + "host_notification", + "justification", + "name", + "ncmec_notification", + "owner_notification", + "urls", + ], + ["account_id", "act", "email", "email2", "name", "owner_notification", "urls"], + [ + "account_id", + "act", + "email", + "email2", + "host_notification", + "name", + "ncsei_subject_representation", + "owner_notification", + "urls", + ], + ) async def create( self, - report_type: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + report_param: str, *, account_id: str, - act: Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ], + act: Literal["abuse_dmca"] + | Literal["abuse_trademark"] + | Literal["abuse_general"] + | Literal["abuse_phishing"] + | Literal["abuse_children"] + | Literal["abuse_threat"] + | Literal["abuse_registrar_whois"] + | Literal["abuse_ncsei"], + address1: str | Omit = omit, + agent_name: str | Omit = omit, + agree: Literal[1] | Omit = omit, + city: str | Omit = omit, + country: str | Omit = omit, email: str, email2: str, + host_notification: Literal["send"] | Literal["send", "send-anon"] | Omit = omit, name: str, + original_work: str | Omit = omit, + owner_notification: Literal["send"] | Literal["send", "send-anon", "none"] | Literal["send", "send-anon"], + signature: str | Omit = omit, + state: str | Omit = omit, urls: str, - address1: str | NotGiven = NOT_GIVEN, - agent_name: str | NotGiven = NOT_GIVEN, - agree: Literal[0, 1] | NotGiven = NOT_GIVEN, - city: str | NotGiven = NOT_GIVEN, - comments: str | NotGiven = NOT_GIVEN, - company: str | NotGiven = NOT_GIVEN, - country: str | NotGiven = NOT_GIVEN, - destination_ips: str | NotGiven = NOT_GIVEN, - host_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - justification: str | NotGiven = NOT_GIVEN, - ncmec_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ncsei_subject_representation: bool | NotGiven = NOT_GIVEN, - original_work: str | NotGiven = NOT_GIVEN, - owner_notification: Literal["send", "send-anon", "none"] | NotGiven = NOT_GIVEN, - ports_protocols: str | NotGiven = NOT_GIVEN, - reported_country: str | NotGiven = NOT_GIVEN, - reported_user_agent: str | NotGiven = NOT_GIVEN, - signature: str | NotGiven = NOT_GIVEN, - source_ips: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, - tele: str | NotGiven = NOT_GIVEN, - title: str | NotGiven = NOT_GIVEN, - trademark_number: str | NotGiven = NOT_GIVEN, - trademark_office: str | NotGiven = NOT_GIVEN, - trademark_symbol: str | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + company: str | Omit = omit, + reported_country: str | Omit = omit, + reported_user_agent: str | Omit = omit, + tele: str | Omit = omit, + title: str | Omit = omit, + justification: str | Omit = omit, + trademark_number: str | Omit = omit, + trademark_office: str | Omit = omit, + trademark_symbol: str | Omit = omit, + destination_ips: str | Omit = omit, + ports_protocols: str | Omit = omit, + source_ips: str | Omit = omit, + ncmec_notification: Literal["send", "send-anon"] | Omit = omit, + ncsei_subject_representation: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not report_type: - raise ValueError(f"Expected a non-empty value for `report_type` but received {report_type!r}") + if not report_param: + raise ValueError(f"Expected a non-empty value for `report_param` but received {report_param!r}") return await self._post( - f"/accounts/{account_id}/abuse-reports/{report_type}", + f"/accounts/{account_id}/abuse-reports/{report_param}", body=await async_maybe_transform( { "act": act, - "email": email, - "email2": email2, - "name": name, - "urls": urls, "address1": address1, "agent_name": agent_name, "agree": agree, "city": city, - "comments": comments, - "company": company, "country": country, - "destination_ips": destination_ips, + "email": email, + "email2": email2, "host_notification": host_notification, - "justification": justification, - "ncmec_notification": ncmec_notification, - "ncsei_subject_representation": ncsei_subject_representation, + "name": name, "original_work": original_work, "owner_notification": owner_notification, - "ports_protocols": ports_protocols, - "reported_country": reported_country, - "reported_user_agent": reported_user_agent, "signature": signature, - "source_ips": source_ips, "state": state, + "urls": urls, + "comments": comments, + "company": company, + "reported_country": reported_country, + "reported_user_agent": reported_user_agent, "tele": tele, "title": title, + "justification": justification, "trademark_number": trademark_number, "trademark_office": trademark_office, "trademark_symbol": trademark_symbol, + "destination_ips": destination_ips, + "ports_protocols": ports_protocols, + "source_ips": source_ips, + "ncmec_notification": ncmec_notification, + "ncsei_subject_representation": ncsei_subject_representation, }, abuse_report_create_params.AbuseReportCreateParams, ), diff --git a/src/cloudflare/resources/accounts/accounts.py b/src/cloudflare/resources/accounts/accounts.py index aa9779c2552..aedb92f84e7 100644 --- a/src/cloudflare/resources/accounts/accounts.py +++ b/src/cloudflare/resources/accounts/accounts.py @@ -23,7 +23,7 @@ MembersResourceWithStreamingResponse, AsyncMembersResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .logs.logs import ( @@ -111,14 +111,14 @@ def create( self, *, name: str, - type: Literal["standard", "enterprise"], - unit: account_create_params.Unit | NotGiven = NOT_GIVEN, + type: Literal["standard", "enterprise"] | Omit = omit, + unit: account_create_params.Unit | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Account]: """ Create an account (only available for tenant admins at this time) @@ -126,9 +126,6 @@ def create( Args: name: Account name - type: the type of account being created. For self-serve customers, use standard. for - enterprise customers, use enterprise. - unit: information related to the tenant unit, and optionally, an id of the unit to create the account on. see https://developers.cloudflare.com/tenant/how-to/manage-accounts/ @@ -167,13 +164,15 @@ def update( account_id: str, id: str, name: str, - settings: account_update_params.Settings | NotGiven = NOT_GIVEN, + type: Literal["standard", "enterprise"], + managed_by: account_update_params.ManagedBy | Omit = omit, + settings: account_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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Account]: """ Update an existing account. @@ -185,6 +184,8 @@ def update( name: Account name + managed_by: Parent container details + settings: Account settings extra_headers: Send extra headers @@ -203,6 +204,8 @@ def update( { "id": id, "name": name, + "type": type, + "managed_by": managed_by, "settings": settings, }, account_update_params.AccountUpdateParams, @@ -220,16 +223,16 @@ def update( def list( self, *, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + name: 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Account]: """ List all accounts you have ownership or verified access to. @@ -281,7 +284,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountDeleteResponse]: """Delete a specific account (only available for tenant admins at this time). @@ -323,7 +326,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Account]: """ Get information about a specific account that you are a member of. @@ -398,14 +401,14 @@ async def create( self, *, name: str, - type: Literal["standard", "enterprise"], - unit: account_create_params.Unit | NotGiven = NOT_GIVEN, + type: Literal["standard", "enterprise"] | Omit = omit, + unit: account_create_params.Unit | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Account]: """ Create an account (only available for tenant admins at this time) @@ -413,9 +416,6 @@ async def create( Args: name: Account name - type: the type of account being created. For self-serve customers, use standard. for - enterprise customers, use enterprise. - unit: information related to the tenant unit, and optionally, an id of the unit to create the account on. see https://developers.cloudflare.com/tenant/how-to/manage-accounts/ @@ -454,13 +454,15 @@ async def update( account_id: str, id: str, name: str, - settings: account_update_params.Settings | NotGiven = NOT_GIVEN, + type: Literal["standard", "enterprise"], + managed_by: account_update_params.ManagedBy | Omit = omit, + settings: account_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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Account]: """ Update an existing account. @@ -472,6 +474,8 @@ async def update( name: Account name + managed_by: Parent container details + settings: Account settings extra_headers: Send extra headers @@ -490,6 +494,8 @@ async def update( { "id": id, "name": name, + "type": type, + "managed_by": managed_by, "settings": settings, }, account_update_params.AccountUpdateParams, @@ -507,16 +513,16 @@ async def update( def list( self, *, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + name: 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Account, AsyncV4PagePaginationArray[Account]]: """ List all accounts you have ownership or verified access to. @@ -568,7 +574,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountDeleteResponse]: """Delete a specific account (only available for tenant admins at this time). @@ -610,7 +616,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Account]: """ Get information about a specific account that you are a member of. diff --git a/src/cloudflare/resources/accounts/logs/audit.py b/src/cloudflare/resources/accounts/logs/audit.py index 5a080571e45..a355073bb4f 100644 --- a/src/cloudflare/resources/accounts/logs/audit.py +++ b/src/cloudflare/resources/accounts/logs/audit.py @@ -8,7 +8,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -18,7 +18,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination +from ....pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter from ...._base_client import AsyncPaginator, make_request_options from ....types.accounts.logs import audit_list_params from ....types.accounts.logs.audit_list_response import AuditListResponse @@ -52,37 +52,37 @@ def list( account_id: str, before: Union[str, date], since: Union[str, date], - account_name: audit_list_params.AccountName | NotGiven = NOT_GIVEN, - action_result: audit_list_params.ActionResult | NotGiven = NOT_GIVEN, - action_type: audit_list_params.ActionType | NotGiven = NOT_GIVEN, - actor_context: audit_list_params.ActorContext | NotGiven = NOT_GIVEN, - actor_email: audit_list_params.ActorEmail | NotGiven = NOT_GIVEN, - actor_id: audit_list_params.ActorID | NotGiven = NOT_GIVEN, - actor_ip_address: audit_list_params.ActorIPAddress | NotGiven = NOT_GIVEN, - actor_token_id: audit_list_params.ActorTokenID | NotGiven = NOT_GIVEN, - actor_token_name: audit_list_params.ActorTokenName | NotGiven = NOT_GIVEN, - actor_type: audit_list_params.ActorType | NotGiven = NOT_GIVEN, - audit_log_id: audit_list_params.AuditLogID | NotGiven = NOT_GIVEN, - cursor: str | NotGiven = NOT_GIVEN, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - raw_cf_rayid: audit_list_params.RawCfRayID | NotGiven = NOT_GIVEN, - raw_method: audit_list_params.RawMethod | NotGiven = NOT_GIVEN, - raw_status_code: audit_list_params.RawStatusCode | NotGiven = NOT_GIVEN, - raw_uri: audit_list_params.RawURI | NotGiven = NOT_GIVEN, - resource_id: audit_list_params.ResourceID | NotGiven = NOT_GIVEN, - resource_product: audit_list_params.ResourceProduct | NotGiven = NOT_GIVEN, - resource_scope: audit_list_params.ResourceScope | NotGiven = NOT_GIVEN, - resource_type: audit_list_params.ResourceType | NotGiven = NOT_GIVEN, - zone_id: audit_list_params.ZoneID | NotGiven = NOT_GIVEN, - zone_name: audit_list_params.ZoneName | NotGiven = NOT_GIVEN, + account_name: audit_list_params.AccountName | 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, + audit_log_id: audit_list_params.AuditLogID | 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, + zone_id: audit_list_params.ZoneID | Omit = omit, + zone_name: audit_list_params.ZoneName | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncCursorLimitPagination[AuditListResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncCursorPaginationAfter[AuditListResponse]: """Gets a list of audit logs for an account.

This is the beta release @@ -124,7 +124,7 @@ def list( 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}/logs/audit", - page=SyncCursorLimitPagination[AuditListResponse], + page=SyncCursorPaginationAfter[AuditListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -192,37 +192,37 @@ def list( account_id: str, before: Union[str, date], since: Union[str, date], - account_name: audit_list_params.AccountName | NotGiven = NOT_GIVEN, - action_result: audit_list_params.ActionResult | NotGiven = NOT_GIVEN, - action_type: audit_list_params.ActionType | NotGiven = NOT_GIVEN, - actor_context: audit_list_params.ActorContext | NotGiven = NOT_GIVEN, - actor_email: audit_list_params.ActorEmail | NotGiven = NOT_GIVEN, - actor_id: audit_list_params.ActorID | NotGiven = NOT_GIVEN, - actor_ip_address: audit_list_params.ActorIPAddress | NotGiven = NOT_GIVEN, - actor_token_id: audit_list_params.ActorTokenID | NotGiven = NOT_GIVEN, - actor_token_name: audit_list_params.ActorTokenName | NotGiven = NOT_GIVEN, - actor_type: audit_list_params.ActorType | NotGiven = NOT_GIVEN, - audit_log_id: audit_list_params.AuditLogID | NotGiven = NOT_GIVEN, - cursor: str | NotGiven = NOT_GIVEN, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - raw_cf_rayid: audit_list_params.RawCfRayID | NotGiven = NOT_GIVEN, - raw_method: audit_list_params.RawMethod | NotGiven = NOT_GIVEN, - raw_status_code: audit_list_params.RawStatusCode | NotGiven = NOT_GIVEN, - raw_uri: audit_list_params.RawURI | NotGiven = NOT_GIVEN, - resource_id: audit_list_params.ResourceID | NotGiven = NOT_GIVEN, - resource_product: audit_list_params.ResourceProduct | NotGiven = NOT_GIVEN, - resource_scope: audit_list_params.ResourceScope | NotGiven = NOT_GIVEN, - resource_type: audit_list_params.ResourceType | NotGiven = NOT_GIVEN, - zone_id: audit_list_params.ZoneID | NotGiven = NOT_GIVEN, - zone_name: audit_list_params.ZoneName | NotGiven = NOT_GIVEN, + account_name: audit_list_params.AccountName | 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, + audit_log_id: audit_list_params.AuditLogID | 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, + zone_id: audit_list_params.ZoneID | Omit = omit, + zone_name: audit_list_params.ZoneName | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this 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, AsyncCursorLimitPagination[AuditListResponse]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[AuditListResponse, AsyncCursorPaginationAfter[AuditListResponse]]: """Gets a list of audit logs for an account.

This is the beta release @@ -264,7 +264,7 @@ def list( 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}/logs/audit", - page=AsyncCursorLimitPagination[AuditListResponse], + page=AsyncCursorPaginationAfter[AuditListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/accounts/members.py b/src/cloudflare/resources/accounts/members.py index cf81af9febe..61eb3ff9fc2 100644 --- a/src/cloudflare/resources/accounts/members.py +++ b/src/cloudflare/resources/accounts/members.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Iterable, Optional, cast +from typing import Type, Iterable, Optional, cast from typing_extensions import Literal, overload import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,14 +54,14 @@ def create( *, account_id: str, email: str, - roles: List[str], - status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN, + roles: SequenceNotStr[str], + status: Literal["accepted", "pending"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: """ Add a user to the list of members for this account. @@ -90,13 +90,13 @@ def create( account_id: str, email: str, policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy], - status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN, + status: Literal["accepted", "pending"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: """ Add a user to the list of members for this account. @@ -124,15 +124,15 @@ def create( *, account_id: str, email: str, - roles: List[str] | NotGiven = NOT_GIVEN, - status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN, - policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN, + roles: SequenceNotStr[str] | Omit = omit, + status: Literal["accepted", "pending"] | Omit = omit, + policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -163,13 +163,13 @@ def update( member_id: str, *, account_id: str, - roles: Iterable[Role] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: """ Modify an account member. @@ -203,7 +203,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: """ Modify an account member. @@ -231,14 +231,14 @@ def update( member_id: str, *, account_id: str, - roles: Iterable[Role] | NotGiven = NOT_GIVEN, - policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -267,17 +267,17 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["user.first_name", "user.last_name", "user.email", "status"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["accepted", "pending", "rejected"] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["user.first_name", "user.last_name", "user.email", "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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Member]: """ List all members of an account. @@ -337,7 +337,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MemberDeleteResponse]: """ Remove a member from an account. @@ -381,7 +381,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: """ Get information about a specific member of an account. @@ -442,14 +442,14 @@ async def create( *, account_id: str, email: str, - roles: List[str], - status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN, + roles: SequenceNotStr[str], + status: Literal["accepted", "pending"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: """ Add a user to the list of members for this account. @@ -478,13 +478,13 @@ async def create( account_id: str, email: str, policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy], - status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN, + status: Literal["accepted", "pending"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: """ Add a user to the list of members for this account. @@ -512,15 +512,15 @@ async def create( *, account_id: str, email: str, - roles: List[str] | NotGiven = NOT_GIVEN, - status: Literal["accepted", "pending"] | NotGiven = NOT_GIVEN, - policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN, + roles: SequenceNotStr[str] | Omit = omit, + status: Literal["accepted", "pending"] | Omit = omit, + policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -551,13 +551,13 @@ async def update( member_id: str, *, account_id: str, - roles: Iterable[Role] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: """ Modify an account member. @@ -591,7 +591,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: """ Modify an account member. @@ -619,14 +619,14 @@ async def update( member_id: str, *, account_id: str, - roles: Iterable[Role] | NotGiven = NOT_GIVEN, - policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -655,17 +655,17 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["user.first_name", "user.last_name", "user.email", "status"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["accepted", "pending", "rejected"] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["user.first_name", "user.last_name", "user.email", "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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Member, AsyncV4PagePaginationArray[Member]]: """ List all members of an account. @@ -725,7 +725,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MemberDeleteResponse]: """ Remove a member from an account. @@ -769,7 +769,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: """ Get information about a specific member of an account. diff --git a/src/cloudflare/resources/accounts/roles.py b/src/cloudflare/resources/accounts/roles.py index 8c49fb115a9..399ad9f9449 100644 --- a/src/cloudflare/resources/accounts/roles.py +++ b/src/cloudflare/resources/accounts/roles.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,14 +49,14 @@ def list( self, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Role]: """ Get all available roles for an account. @@ -107,7 +107,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Role]: """ Get information about a specific role for an account. @@ -166,14 +166,14 @@ def list( self, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Role, AsyncV4PagePaginationArray[Role]]: """ Get all available roles for an account. @@ -224,7 +224,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Role]: """ Get information about a specific role for an account. diff --git a/src/cloudflare/resources/accounts/subscriptions.py b/src/cloudflare/resources/accounts/subscriptions.py index cddf77edb7f..7209c025dfa 100644 --- a/src/cloudflare/resources/accounts/subscriptions.py +++ b/src/cloudflare/resources/accounts/subscriptions.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,14 +52,14 @@ def create( self, *, account_id: str, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Subscription: """ Creates an account subscription. @@ -105,14 +105,14 @@ def update( subscription_identifier: str, *, account_id: str, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Subscription: """ Updates an account subscription. @@ -169,7 +169,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubscriptionDeleteResponse: """ Deletes an account's subscription. @@ -214,7 +214,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Subscription]: """ Lists all of an account's subscriptions. @@ -266,14 +266,14 @@ async def create( self, *, account_id: str, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Subscription: """ Creates an account subscription. @@ -319,14 +319,14 @@ async def update( subscription_identifier: str, *, account_id: str, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Subscription: """ Updates an account subscription. @@ -383,7 +383,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubscriptionDeleteResponse: """ Deletes an account's subscription. @@ -428,7 +428,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Subscription, AsyncSinglePage[Subscription]]: """ Lists all of an account's subscriptions. diff --git a/src/cloudflare/resources/accounts/tokens/permission_groups.py b/src/cloudflare/resources/accounts/tokens/permission_groups.py index d98d5235ce0..2efe092f8ec 100644 --- a/src/cloudflare/resources/accounts/tokens/permission_groups.py +++ b/src/cloudflare/resources/accounts/tokens/permission_groups.py @@ -2,9 +2,12 @@ from __future__ import annotations +from typing import Type, Optional, cast + import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 ( @@ -13,8 +16,10 @@ 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.accounts.tokens import permission_group_get_params, permission_group_list_params from ....types.accounts.tokens.permission_group_get_response import PermissionGroupGetResponse from ....types.accounts.tokens.permission_group_list_response import PermissionGroupListResponse @@ -45,12 +50,14 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PermissionGroupListResponse]: """ Find all available permission groups for Account Owned API Tokens @@ -58,6 +65,10 @@ def list( Args: account_id: Account identifier tag. + name: Filter by the name of the permission group. The value must be URL-encoded. + + scope: Filter by the scope of the permission group. The value must be URL-encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -72,7 +83,17 @@ def list( f"/accounts/{account_id}/tokens/permission_groups", page=SyncSinglePage[PermissionGroupListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "name": name, + "scope": scope, + }, + permission_group_list_params.PermissionGroupListParams, + ), ), model=PermissionGroupListResponse, ) @@ -81,19 +102,25 @@ def get( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[PermissionGroupGetResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[PermissionGroupGetResponse]: """ Find all available permission groups for Account Owned API Tokens Args: account_id: Account identifier tag. + name: Filter by the name of the permission group. The value must be URL-encoded. + + scope: Filter by the scope of the permission group. The value must be URL-encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -104,13 +131,23 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( + return self._get( f"/accounts/{account_id}/tokens/permission_groups", - page=SyncSinglePage[PermissionGroupGetResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "name": name, + "scope": scope, + }, + permission_group_get_params.PermissionGroupGetParams, + ), + post_parser=ResultWrapper[Optional[PermissionGroupGetResponse]]._unwrapper, ), - model=PermissionGroupGetResponse, + cast_to=cast(Type[Optional[PermissionGroupGetResponse]], ResultWrapper[PermissionGroupGetResponse]), ) @@ -138,12 +175,14 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PermissionGroupListResponse, AsyncSinglePage[PermissionGroupListResponse]]: """ Find all available permission groups for Account Owned API Tokens @@ -151,6 +190,10 @@ def list( Args: account_id: Account identifier tag. + name: Filter by the name of the permission group. The value must be URL-encoded. + + scope: Filter by the scope of the permission group. The value must be URL-encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -165,28 +208,44 @@ def list( f"/accounts/{account_id}/tokens/permission_groups", page=AsyncSinglePage[PermissionGroupListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "name": name, + "scope": scope, + }, + permission_group_list_params.PermissionGroupListParams, + ), ), model=PermissionGroupListResponse, ) - def get( + async def get( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[PermissionGroupGetResponse, AsyncSinglePage[PermissionGroupGetResponse]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[PermissionGroupGetResponse]: """ Find all available permission groups for Account Owned API Tokens Args: account_id: Account identifier tag. + name: Filter by the name of the permission group. The value must be URL-encoded. + + scope: Filter by the scope of the permission group. The value must be URL-encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -197,13 +256,23 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get_api_list( + return await self._get( f"/accounts/{account_id}/tokens/permission_groups", - page=AsyncSinglePage[PermissionGroupGetResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "name": name, + "scope": scope, + }, + permission_group_get_params.PermissionGroupGetParams, + ), + post_parser=ResultWrapper[Optional[PermissionGroupGetResponse]]._unwrapper, ), - model=PermissionGroupGetResponse, + cast_to=cast(Type[Optional[PermissionGroupGetResponse]], ResultWrapper[PermissionGroupGetResponse]), ) diff --git a/src/cloudflare/resources/accounts/tokens/tokens.py b/src/cloudflare/resources/accounts/tokens/tokens.py index 4f50160a6df..eb6d7826528 100644 --- a/src/cloudflare/resources/accounts/tokens/tokens.py +++ b/src/cloudflare/resources/accounts/tokens/tokens.py @@ -16,7 +16,7 @@ ValueResourceWithStreamingResponse, AsyncValueResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -81,15 +81,15 @@ def create( account_id: str, name: str, policies: Iterable[TokenPolicy], - condition: token_create_params.Condition | NotGiven = NOT_GIVEN, - expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + condition: token_create_params.Condition | Omit = omit, + expires_on: Union[str, datetime] | Omit = omit, + not_before: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenCreateResponse]: """ Create a new Account Owned API token. @@ -145,16 +145,16 @@ def update( account_id: str, name: str, policies: Iterable[TokenPolicy], - status: Literal["active", "disabled", "expired"], - condition: token_update_params.Condition | NotGiven = NOT_GIVEN, - expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + condition: token_update_params.Condition | Omit = omit, + expires_on: Union[str, datetime] | Omit = omit, + not_before: Union[str, datetime] | Omit = omit, + status: Literal["active", "disabled", "expired"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Token]: """ Update an existing token. @@ -168,13 +168,13 @@ def update( policies: List of access policies assigned to the token. - status: Status of the token. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for processing. not_before: The time before which the token MUST NOT be accepted for processing. + status: Status of the token. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -193,10 +193,10 @@ def update( { "name": name, "policies": policies, - "status": status, "condition": condition, "expires_on": expires_on, "not_before": not_before, + "status": status, }, token_update_params.TokenUpdateParams, ), @@ -214,15 +214,15 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Token]: """ List all Account Owned API tokens created for this account. @@ -276,7 +276,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenDeleteResponse]: """ Destroy an Account Owned API token. @@ -320,7 +320,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Token]: """ Get information about a specific Account Owned API token. @@ -363,7 +363,7 @@ def verify( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenVerifyResponse]: """ Test whether a token works. @@ -428,15 +428,15 @@ async def create( account_id: str, name: str, policies: Iterable[TokenPolicy], - condition: token_create_params.Condition | NotGiven = NOT_GIVEN, - expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + condition: token_create_params.Condition | Omit = omit, + expires_on: Union[str, datetime] | Omit = omit, + not_before: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenCreateResponse]: """ Create a new Account Owned API token. @@ -492,16 +492,16 @@ async def update( account_id: str, name: str, policies: Iterable[TokenPolicy], - status: Literal["active", "disabled", "expired"], - condition: token_update_params.Condition | NotGiven = NOT_GIVEN, - expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + condition: token_update_params.Condition | Omit = omit, + expires_on: Union[str, datetime] | Omit = omit, + not_before: Union[str, datetime] | Omit = omit, + status: Literal["active", "disabled", "expired"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Token]: """ Update an existing token. @@ -515,13 +515,13 @@ async def update( policies: List of access policies assigned to the token. - status: Status of the token. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for processing. not_before: The time before which the token MUST NOT be accepted for processing. + status: Status of the token. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -540,10 +540,10 @@ async def update( { "name": name, "policies": policies, - "status": status, "condition": condition, "expires_on": expires_on, "not_before": not_before, + "status": status, }, token_update_params.TokenUpdateParams, ), @@ -561,15 +561,15 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Token, AsyncV4PagePaginationArray[Token]]: """ List all Account Owned API tokens created for this account. @@ -623,7 +623,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenDeleteResponse]: """ Destroy an Account Owned API token. @@ -667,7 +667,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Token]: """ Get information about a specific Account Owned API token. @@ -710,7 +710,7 @@ async def verify( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenVerifyResponse]: """ Test whether a token works. diff --git a/src/cloudflare/resources/accounts/tokens/value.py b/src/cloudflare/resources/accounts/tokens/value.py index 21e9ddc0027..5e76bc54948 100644 --- a/src/cloudflare/resources/accounts/tokens/value.py +++ b/src/cloudflare/resources/accounts/tokens/value.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,7 +55,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Roll the Account Owned API token secret. @@ -122,7 +122,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Roll the Account Owned API token secret. diff --git a/src/cloudflare/resources/acm/total_tls.py b/src/cloudflare/resources/acm/total_tls.py index b815c0c0370..4d8bb472fb3 100644 --- a/src/cloudflare/resources/acm/total_tls.py +++ b/src/cloudflare/resources/acm/total_tls.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,13 +51,13 @@ def create( *, zone_id: str, enabled: bool, - certificate_authority: CertificateAuthority | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TotalTLSCreateResponse]: """ Set Total TLS Settings or disable the feature for a Zone. @@ -108,7 +108,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TotalTLSGetResponse]: """ Get Total TLS Settings for a Zone. @@ -164,13 +164,13 @@ async def create( *, zone_id: str, enabled: bool, - certificate_authority: CertificateAuthority | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TotalTLSCreateResponse]: """ Set Total TLS Settings or disable the feature for a Zone. @@ -221,7 +221,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TotalTLSGetResponse]: """ Get Total TLS Settings for a Zone. diff --git a/src/cloudflare/resources/addressing/address_maps/accounts.py b/src/cloudflare/resources/addressing/address_maps/accounts.py index 42533eb9fc4..9d839d4a42d 100644 --- a/src/cloudflare/resources/addressing/address_maps/accounts.py +++ b/src/cloudflare/resources/addressing/address_maps/accounts.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,7 +53,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountUpdateResponse: """ Add an account as a member of a particular address map. @@ -94,7 +94,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountDeleteResponse: """ Remove an account as a member of a particular address map. @@ -156,7 +156,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountUpdateResponse: """ Add an account as a member of a particular address map. @@ -197,7 +197,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountDeleteResponse: """ Remove an account as a member of a particular address map. diff --git a/src/cloudflare/resources/addressing/address_maps/address_maps.py b/src/cloudflare/resources/addressing/address_maps/address_maps.py index 51effb2d79f..af03cd6994b 100644 --- a/src/cloudflare/resources/addressing/address_maps/address_maps.py +++ b/src/cloudflare/resources/addressing/address_maps/address_maps.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Iterable, Optional, cast +from typing import Type, Iterable, Optional, cast import httpx @@ -30,7 +30,7 @@ AccountsResourceWithStreamingResponse, AsyncAccountsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -88,16 +88,16 @@ def create( self, *, account_id: str, - description: Optional[str] | NotGiven = NOT_GIVEN, - enabled: Optional[bool] | NotGiven = NOT_GIVEN, - ips: List[str] | NotGiven = NOT_GIVEN, - memberships: Iterable[address_map_create_params.Membership] | NotGiven = NOT_GIVEN, + description: Optional[str] | Omit = omit, + enabled: Optional[bool] | Omit = omit, + ips: SequenceNotStr[str] | Omit = omit, + memberships: Iterable[address_map_create_params.Membership] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AddressMapCreateResponse]: """ Create a new address map under the account. @@ -154,7 +154,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[AddressMap]: """ List all address maps owned by the account. @@ -191,7 +191,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AddressMapDeleteResponse: """Delete a particular address map owned by the account. @@ -228,15 +228,15 @@ def edit( address_map_id: str, *, account_id: str, - default_sni: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - enabled: Optional[bool] | NotGiven = NOT_GIVEN, + default_sni: Optional[str] | Omit = omit, + description: Optional[str] | Omit = omit, + enabled: Optional[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AddressMap]: """ Modify properties of an address map owned by the account. @@ -300,7 +300,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AddressMapGetResponse]: """ Show a particular address map owned by the account. @@ -371,16 +371,16 @@ async def create( self, *, account_id: str, - description: Optional[str] | NotGiven = NOT_GIVEN, - enabled: Optional[bool] | NotGiven = NOT_GIVEN, - ips: List[str] | NotGiven = NOT_GIVEN, - memberships: Iterable[address_map_create_params.Membership] | NotGiven = NOT_GIVEN, + description: Optional[str] | Omit = omit, + enabled: Optional[bool] | Omit = omit, + ips: SequenceNotStr[str] | Omit = omit, + memberships: Iterable[address_map_create_params.Membership] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AddressMapCreateResponse]: """ Create a new address map under the account. @@ -437,7 +437,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AddressMap, AsyncSinglePage[AddressMap]]: """ List all address maps owned by the account. @@ -474,7 +474,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AddressMapDeleteResponse: """Delete a particular address map owned by the account. @@ -511,15 +511,15 @@ async def edit( address_map_id: str, *, account_id: str, - default_sni: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - enabled: Optional[bool] | NotGiven = NOT_GIVEN, + default_sni: Optional[str] | Omit = omit, + description: Optional[str] | Omit = omit, + enabled: Optional[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AddressMap]: """ Modify properties of an address map owned by the account. @@ -583,7 +583,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AddressMapGetResponse]: """ Show a particular address map owned by the account. diff --git a/src/cloudflare/resources/addressing/address_maps/ips.py b/src/cloudflare/resources/addressing/address_maps/ips.py index 7c2831ec8ba..78313356374 100644 --- a/src/cloudflare/resources/addressing/address_maps/ips.py +++ b/src/cloudflare/resources/addressing/address_maps/ips.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,7 +54,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPUpdateResponse: """ Add an IP from a prefix owned by the account to a particular address map. @@ -100,7 +100,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPDeleteResponse: """ Remove an IP from a particular address map. @@ -167,7 +167,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPUpdateResponse: """ Add an IP from a prefix owned by the account to a particular address map. @@ -213,7 +213,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPDeleteResponse: """ Remove an IP from a particular address map. diff --git a/src/cloudflare/resources/addressing/address_maps/zones.py b/src/cloudflare/resources/addressing/address_maps/zones.py index fb721f75bbf..e6ac1d4e043 100644 --- a/src/cloudflare/resources/addressing/address_maps/zones.py +++ b/src/cloudflare/resources/addressing/address_maps/zones.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,7 +54,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneUpdateResponse: """ Add a zone as a member of a particular address map. @@ -100,7 +100,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneDeleteResponse: """ Remove a zone as a member of a particular address map. @@ -167,7 +167,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneUpdateResponse: """ Add a zone as a member of a particular address map. @@ -213,7 +213,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneDeleteResponse: """ Remove a zone as a member of a particular address map. diff --git a/src/cloudflare/resources/addressing/loa_documents.py b/src/cloudflare/resources/addressing/loa_documents.py index 211478a293c..a1765c32f97 100644 --- a/src/cloudflare/resources/addressing/loa_documents.py +++ b/src/cloudflare/resources/addressing/loa_documents.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -62,7 +62,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LOADocumentCreateResponse]: """ Submit LOA document (pdf format) under the account. @@ -109,7 +109,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """ Download specified LOA document under the account. @@ -171,7 +171,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LOADocumentCreateResponse]: """ Submit LOA document (pdf format) under the account. @@ -220,7 +220,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """ Download specified LOA document under the account. diff --git a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py index 7eee6d184bc..7b71630f5b2 100644 --- a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py +++ b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,7 +58,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AdvertisementStatusEditResponse]: """ Advertise or withdraw the BGP route for a prefix. @@ -114,7 +114,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AdvertisementStatusGetResponse]: """ View the current advertisement state for a prefix. @@ -184,7 +184,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AdvertisementStatusEditResponse]: """ Advertise or withdraw the BGP route for a prefix. @@ -240,7 +240,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AdvertisementStatusGetResponse]: """ View the current advertisement state for a prefix. @@ -284,12 +284,12 @@ def __init__(self, advertisement_status: AdvertisementStatusResource) -> None: self.edit = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - advertisement_status.edit # pyright: ignore[reportDeprecated], + advertisement_status.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - advertisement_status.get # pyright: ignore[reportDeprecated], + advertisement_status.get, # pyright: ignore[reportDeprecated], ) ) @@ -300,12 +300,12 @@ def __init__(self, advertisement_status: AsyncAdvertisementStatusResource) -> No self.edit = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - advertisement_status.edit # pyright: ignore[reportDeprecated], + advertisement_status.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - advertisement_status.get # pyright: ignore[reportDeprecated], + advertisement_status.get, # pyright: ignore[reportDeprecated], ) ) @@ -316,12 +316,12 @@ def __init__(self, advertisement_status: AdvertisementStatusResource) -> None: self.edit = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - advertisement_status.edit # pyright: ignore[reportDeprecated], + advertisement_status.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - advertisement_status.get # pyright: ignore[reportDeprecated], + advertisement_status.get, # pyright: ignore[reportDeprecated], ) ) @@ -332,11 +332,11 @@ def __init__(self, advertisement_status: AsyncAdvertisementStatusResource) -> No self.edit = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - advertisement_status.edit # pyright: ignore[reportDeprecated], + advertisement_status.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - advertisement_status.get # pyright: ignore[reportDeprecated], + advertisement_status.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py index c93b5901764..5d03d74a151 100644 --- a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,13 +50,13 @@ def create( prefix_id: str, *, account_id: str, - cidr: str | NotGiven = NOT_GIVEN, + cidr: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BGPPrefix]: """ Create a BGP prefix, controlling the BGP advertisement status of a specific @@ -105,7 +105,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[BGPPrefix]: """List all BGP Prefixes within the specified IP Prefix. @@ -146,15 +146,15 @@ def edit( *, account_id: str, prefix_id: str, - asn_prepend_count: int | NotGiven = NOT_GIVEN, - on_demand: bgp_prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN, - withdraw_if_no_route: bool | NotGiven = NOT_GIVEN, + asn_prepend_count: int | Omit = omit, + auto_advertise_withdraw: bool | Omit = omit, + on_demand: bgp_prefix_edit_params.OnDemand | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BGPPrefix]: """ Update the properties of a BGP Prefix, such as the on demand advertisement @@ -169,9 +169,10 @@ def edit( asn_prepend_count: Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute - withdraw_if_no_route: Controls whether the BGP prefix is automatically withdrawn when prefix is - withdrawn from Magic routing table (for Magic Transit customers using Direct - CNI) + auto_advertise_withdraw: Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no + matching BGP prefix in the Magic routing table. When true, Cloudflare will + automatically withdraw the BGP prefix when there are no matching BGP routes, and + will resume advertising when there is at least one matching BGP route. extra_headers: Send extra headers @@ -192,8 +193,8 @@ def edit( body=maybe_transform( { "asn_prepend_count": asn_prepend_count, + "auto_advertise_withdraw": auto_advertise_withdraw, "on_demand": on_demand, - "withdraw_if_no_route": withdraw_if_no_route, }, bgp_prefix_edit_params.BGPPrefixEditParams, ), @@ -218,7 +219,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BGPPrefix]: """ Retrieve a single BGP Prefix according to its identifier @@ -282,13 +283,13 @@ async def create( prefix_id: str, *, account_id: str, - cidr: str | NotGiven = NOT_GIVEN, + cidr: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BGPPrefix]: """ Create a BGP prefix, controlling the BGP advertisement status of a specific @@ -337,7 +338,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[BGPPrefix, AsyncSinglePage[BGPPrefix]]: """List all BGP Prefixes within the specified IP Prefix. @@ -378,15 +379,15 @@ async def edit( *, account_id: str, prefix_id: str, - asn_prepend_count: int | NotGiven = NOT_GIVEN, - on_demand: bgp_prefix_edit_params.OnDemand | NotGiven = NOT_GIVEN, - withdraw_if_no_route: bool | NotGiven = NOT_GIVEN, + asn_prepend_count: int | Omit = omit, + auto_advertise_withdraw: bool | Omit = omit, + on_demand: bgp_prefix_edit_params.OnDemand | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BGPPrefix]: """ Update the properties of a BGP Prefix, such as the on demand advertisement @@ -401,9 +402,10 @@ async def edit( asn_prepend_count: Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute - withdraw_if_no_route: Controls whether the BGP prefix is automatically withdrawn when prefix is - withdrawn from Magic routing table (for Magic Transit customers using Direct - CNI) + auto_advertise_withdraw: Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no + matching BGP prefix in the Magic routing table. When true, Cloudflare will + automatically withdraw the BGP prefix when there are no matching BGP routes, and + will resume advertising when there is at least one matching BGP route. extra_headers: Send extra headers @@ -424,8 +426,8 @@ async def edit( body=await async_maybe_transform( { "asn_prepend_count": asn_prepend_count, + "auto_advertise_withdraw": auto_advertise_withdraw, "on_demand": on_demand, - "withdraw_if_no_route": withdraw_if_no_route, }, bgp_prefix_edit_params.BGPPrefixEditParams, ), @@ -450,7 +452,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BGPPrefix]: """ Retrieve a single BGP Prefix according to its identifier diff --git a/src/cloudflare/resources/addressing/prefixes/delegations.py b/src/cloudflare/resources/addressing/prefixes/delegations.py index d71656994f4..cdc8824f1d3 100644 --- a/src/cloudflare/resources/addressing/prefixes/delegations.py +++ b/src/cloudflare/resources/addressing/prefixes/delegations.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,7 +58,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Delegations]: """ Create a new account delegation for a given IP prefix. @@ -113,7 +113,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Delegations]: """ List all delegations for a given account IP prefix. @@ -155,7 +155,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DelegationDeleteResponse]: """ Delete an account delegation for a given IP prefix. @@ -226,7 +226,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Delegations]: """ Create a new account delegation for a given IP prefix. @@ -281,7 +281,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Delegations, AsyncSinglePage[Delegations]]: """ List all delegations for a given account IP prefix. @@ -323,7 +323,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DelegationDeleteResponse]: """ Delete an account delegation for a given IP prefix. diff --git a/src/cloudflare/resources/addressing/prefixes/prefixes.py b/src/cloudflare/resources/addressing/prefixes/prefixes.py index 2cb1ed99c12..6886f558251 100644 --- a/src/cloudflare/resources/addressing/prefixes/prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/prefixes.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from .delegations import ( @@ -106,7 +106,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Prefix]: """ Add a new prefix under the account. @@ -159,7 +159,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Prefix]: """ List all prefixes owned by the account. @@ -196,7 +196,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PrefixDeleteResponse: """ Delete an unapproved prefix owned by the account. @@ -237,7 +237,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Prefix]: """ Modify the description for a prefix owned by the account. @@ -284,7 +284,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Prefix]: """ List a particular prefix owned by the account. @@ -367,7 +367,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Prefix]: """ Add a new prefix under the account. @@ -420,7 +420,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Prefix, AsyncSinglePage[Prefix]]: """ List all prefixes owned by the account. @@ -457,7 +457,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PrefixDeleteResponse: """ Delete an unapproved prefix owned by the account. @@ -498,7 +498,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Prefix]: """ Modify the description for a prefix owned by the account. @@ -545,7 +545,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Prefix]: """ List a particular prefix owned by the account. diff --git a/src/cloudflare/resources/addressing/prefixes/service_bindings.py b/src/cloudflare/resources/addressing/prefixes/service_bindings.py index 1517b22c602..dfbc7a3c4ef 100644 --- a/src/cloudflare/resources/addressing/prefixes/service_bindings.py +++ b/src/cloudflare/resources/addressing/prefixes/service_bindings.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,14 +51,14 @@ def create( prefix_id: str, *, account_id: str, - cidr: str | NotGiven = NOT_GIVEN, - service_id: str | NotGiven = NOT_GIVEN, + cidr: str | Omit = omit, + service_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceBinding]: """ Creates a new Service Binding, routing traffic to IPs within the given CIDR to a @@ -118,7 +118,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ServiceBinding]: """List the Cloudflare services this prefix is currently bound to. @@ -166,7 +166,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ServiceBindingDeleteResponse: """ Delete a Service Binding @@ -211,7 +211,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceBinding]: """ Fetch a single Service Binding @@ -275,14 +275,14 @@ async def create( prefix_id: str, *, account_id: str, - cidr: str | NotGiven = NOT_GIVEN, - service_id: str | NotGiven = NOT_GIVEN, + cidr: str | Omit = omit, + service_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceBinding]: """ Creates a new Service Binding, routing traffic to IPs within the given CIDR to a @@ -342,7 +342,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ServiceBinding, AsyncSinglePage[ServiceBinding]]: """List the Cloudflare services this prefix is currently bound to. @@ -390,7 +390,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ServiceBindingDeleteResponse: """ Delete a Service Binding @@ -435,7 +435,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceBinding]: """ Fetch a single Service Binding diff --git a/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py b/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py index f490caebc34..e404f48a4d1 100644 --- a/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py +++ b/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py @@ -14,7 +14,7 @@ RegionsResourceWithStreamingResponse, AsyncRegionsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -67,13 +67,13 @@ def create( zone_id: str, hostname: str, region_key: str, - routing: str | NotGiven = NOT_GIVEN, + routing: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RegionalHostnameCreateResponse]: """Create a new Regional Hostname entry. @@ -131,7 +131,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[RegionalHostnameListResponse]: """ List all Regional Hostnames within a zone. @@ -168,7 +168,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RegionalHostnameDeleteResponse: """ Delete the region configuration for a specific Regional Hostname. @@ -210,7 +210,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RegionalHostnameEditResponse]: """Update the configuration for a specific Regional Hostname. @@ -260,7 +260,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RegionalHostnameGetResponse]: """ Fetch the configuration for a specific Regional Hostname, within a zone. @@ -326,13 +326,13 @@ async def create( zone_id: str, hostname: str, region_key: str, - routing: str | NotGiven = NOT_GIVEN, + routing: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RegionalHostnameCreateResponse]: """Create a new Regional Hostname entry. @@ -390,7 +390,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RegionalHostnameListResponse, AsyncSinglePage[RegionalHostnameListResponse]]: """ List all Regional Hostnames within a zone. @@ -427,7 +427,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RegionalHostnameDeleteResponse: """ Delete the region configuration for a specific Regional Hostname. @@ -469,7 +469,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RegionalHostnameEditResponse]: """Update the configuration for a specific Regional Hostname. @@ -521,7 +521,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RegionalHostnameGetResponse]: """ Fetch the configuration for a specific Regional Hostname, within a zone. diff --git a/src/cloudflare/resources/addressing/regional_hostnames/regions.py b/src/cloudflare/resources/addressing/regional_hostnames/regions.py index 77bd67a298d..e94af76ff04 100644 --- a/src/cloudflare/resources/addressing/regional_hostnames/regions.py +++ b/src/cloudflare/resources/addressing/regional_hostnames/regions.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -49,7 +49,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[RegionListResponse]: """ List all Regional Services regions available for use by this account. @@ -106,7 +106,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RegionListResponse, AsyncSinglePage[RegionListResponse]]: """ List all Regional Services regions available for use by this account. diff --git a/src/cloudflare/resources/addressing/services.py b/src/cloudflare/resources/addressing/services.py index 799ce7f0980..959ced7ff44 100644 --- a/src/cloudflare/resources/addressing/services.py +++ b/src/cloudflare/resources/addressing/services.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -49,7 +49,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ServiceListResponse]: """ Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a @@ -109,7 +109,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ServiceListResponse, AsyncSinglePage[ServiceListResponse]]: """ Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a diff --git a/src/cloudflare/resources/ai/__init__.py b/src/cloudflare/resources/ai/__init__.py index 26c6c71d160..ccf8b736c39 100644 --- a/src/cloudflare/resources/ai/__init__.py +++ b/src/cloudflare/resources/ai/__init__.py @@ -40,6 +40,14 @@ FinetunesResourceWithStreamingResponse, AsyncFinetunesResourceWithStreamingResponse, ) +from .to_markdown import ( + ToMarkdownResource, + AsyncToMarkdownResource, + ToMarkdownResourceWithRawResponse, + AsyncToMarkdownResourceWithRawResponse, + ToMarkdownResourceWithStreamingResponse, + AsyncToMarkdownResourceWithStreamingResponse, +) __all__ = [ "FinetunesResource", @@ -66,6 +74,12 @@ "AsyncModelsResourceWithRawResponse", "ModelsResourceWithStreamingResponse", "AsyncModelsResourceWithStreamingResponse", + "ToMarkdownResource", + "AsyncToMarkdownResource", + "ToMarkdownResourceWithRawResponse", + "AsyncToMarkdownResourceWithRawResponse", + "ToMarkdownResourceWithStreamingResponse", + "AsyncToMarkdownResourceWithStreamingResponse", "AIResource", "AsyncAIResource", "AIResourceWithRawResponse", diff --git a/src/cloudflare/resources/ai/ai.py b/src/cloudflare/resources/ai/ai.py index 7f9f0462bbc..9a53d1b3df5 100644 --- a/src/cloudflare/resources/ai/ai.py +++ b/src/cloudflare/resources/ai/ai.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Union, Iterable, Optional, cast +from typing import Any, Union, Iterable, Optional, cast from typing_extensions import overload import httpx @@ -23,7 +23,7 @@ AuthorsResourceWithStreamingResponse, AsyncAuthorsResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ...types.ai import ai_run_params @@ -35,6 +35,14 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper +from .to_markdown import ( + ToMarkdownResource, + AsyncToMarkdownResource, + ToMarkdownResourceWithRawResponse, + AsyncToMarkdownResourceWithRawResponse, + ToMarkdownResourceWithStreamingResponse, + AsyncToMarkdownResourceWithStreamingResponse, +) from .models.models import ( ModelsResource, AsyncModelsResource, @@ -74,6 +82,10 @@ def tasks(self) -> TasksResource: def models(self) -> ModelsResource: return ModelsResource(self._client) + @cached_property + def to_markdown(self) -> ToMarkdownResource: + return ToMarkdownResource(self._client) + @cached_property def with_raw_response(self) -> AIResourceWithRawResponse: """ @@ -105,7 +117,7 @@ def run( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -138,22 +150,22 @@ def run( *, account_id: str, prompt: str, - guidance: float | NotGiven = NOT_GIVEN, - height: int | NotGiven = NOT_GIVEN, - image: Iterable[float] | NotGiven = NOT_GIVEN, - image_b64: str | NotGiven = NOT_GIVEN, - mask: Iterable[float] | NotGiven = NOT_GIVEN, - negative_prompt: str | NotGiven = NOT_GIVEN, - num_steps: int | NotGiven = NOT_GIVEN, - seed: int | NotGiven = NOT_GIVEN, - strength: float | NotGiven = NOT_GIVEN, - width: int | NotGiven = NOT_GIVEN, + guidance: float | Omit = omit, + height: int | Omit = omit, + image: Iterable[float] | Omit = omit, + image_b64: str | Omit = omit, + mask: Iterable[float] | Omit = omit, + negative_prompt: str | Omit = omit, + num_steps: int | Omit = omit, + seed: int | Omit = omit, + strength: float | Omit = omit, + width: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -210,13 +222,13 @@ def run( *, account_id: str, prompt: str, - lang: str | NotGiven = NOT_GIVEN, + lang: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -251,13 +263,13 @@ def run( model_name: str, *, account_id: str, - text: Union[str, List[str]], + text: Union[str, 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -290,14 +302,14 @@ def run( *, account_id: str, audio: Iterable[float], - source_lang: str | NotGiven = NOT_GIVEN, - target_lang: str | NotGiven = NOT_GIVEN, + source_lang: str | Omit = omit, + target_lang: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -341,7 +353,7 @@ def run( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -374,13 +386,13 @@ def run( model_name: str, *, account_id: str, - image: Iterable[float] | NotGiven = NOT_GIVEN, + image: Iterable[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -414,24 +426,24 @@ def run( *, account_id: str, prompt: str, - frequency_penalty: float | NotGiven = NOT_GIVEN, - lora: str | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - raw: bool | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - response_format: ai_run_params.PromptResponseFormat | NotGiven = NOT_GIVEN, - seed: int | NotGiven = NOT_GIVEN, - stream: bool | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_k: int | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + lora: str | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + raw: bool | Omit = omit, + repetition_penalty: float | Omit = omit, + response_format: ai_run_params.PromptResponseFormat | Omit = omit, + seed: int | Omit = omit, + stream: bool | Omit = omit, + temperature: float | Omit = omit, + top_k: int | Omit = omit, + top_p: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -493,25 +505,25 @@ def run( *, account_id: str, messages: Iterable[ai_run_params.MessagesMessage], - frequency_penalty: float | NotGiven = NOT_GIVEN, - functions: Iterable[ai_run_params.MessagesFunction] | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - raw: bool | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - response_format: ai_run_params.MessagesResponseFormat | NotGiven = NOT_GIVEN, - seed: int | NotGiven = NOT_GIVEN, - stream: bool | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - tools: Iterable[ai_run_params.MessagesTool] | NotGiven = NOT_GIVEN, - top_k: int | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + functions: Iterable[ai_run_params.MessagesFunction] | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + raw: bool | Omit = omit, + repetition_penalty: float | Omit = omit, + response_format: ai_run_params.MessagesResponseFormat | Omit = omit, + seed: int | Omit = omit, + stream: bool | Omit = omit, + temperature: float | Omit = omit, + tools: Iterable[ai_run_params.MessagesTool] | Omit = omit, + top_k: int | Omit = omit, + top_p: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -574,13 +586,13 @@ def run( account_id: str, target_lang: str, text: str, - source_lang: str | NotGiven = NOT_GIVEN, + source_lang: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -618,13 +630,13 @@ def run( *, account_id: str, input_text: str, - max_length: int | NotGiven = NOT_GIVEN, + max_length: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -659,22 +671,22 @@ def run( *, account_id: str, image: Iterable[float], - frequency_penalty: float | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - prompt: str | NotGiven = NOT_GIVEN, - raw: bool | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - seed: float | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_k: float | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + prompt: str | Omit = omit, + raw: bool | Omit = omit, + repetition_penalty: float | Omit = omit, + seed: float | Omit = omit, + temperature: float | Omit = omit, + top_k: float | Omit = omit, + top_p: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -735,21 +747,21 @@ def run( account_id: str, image: str, prompt: str, - frequency_penalty: float | NotGiven = NOT_GIVEN, - ignore_eos: bool | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - seed: float | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_k: float | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + ignore_eos: bool | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + repetition_penalty: float | Omit = omit, + seed: float | Omit = omit, + temperature: float | Omit = omit, + top_k: float | Omit = omit, + top_p: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -809,21 +821,21 @@ def run( account_id: str, image: str, messages: Iterable[ai_run_params.Variant13Message], - frequency_penalty: float | NotGiven = NOT_GIVEN, - ignore_eos: bool | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - seed: float | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_k: float | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + ignore_eos: bool | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + repetition_penalty: float | Omit = omit, + seed: float | Omit = omit, + temperature: float | Omit = omit, + top_k: float | Omit = omit, + top_p: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -875,6 +887,45 @@ def run( """ ... + @overload + def run( + self, + model_name: str, + *, + account_id: str, + image: str | Omit = omit, + text: 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + image: Image in base64 encoded format. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @required_args( ["account_id", "text"], ["account_id", "prompt"], @@ -892,45 +943,45 @@ def run( model_name: str, *, account_id: str, - text: str | Union[str, List[str]] | NotGiven = NOT_GIVEN, - prompt: str | NotGiven = NOT_GIVEN, - guidance: float | NotGiven = NOT_GIVEN, - height: int | NotGiven = NOT_GIVEN, - image: Iterable[float] | str | NotGiven = NOT_GIVEN, - image_b64: str | NotGiven = NOT_GIVEN, - mask: Iterable[float] | NotGiven = NOT_GIVEN, - negative_prompt: str | NotGiven = NOT_GIVEN, - num_steps: int | NotGiven = NOT_GIVEN, - seed: int | float | NotGiven = NOT_GIVEN, - strength: float | NotGiven = NOT_GIVEN, - width: int | NotGiven = NOT_GIVEN, - lang: str | NotGiven = NOT_GIVEN, - audio: Iterable[float] | NotGiven = NOT_GIVEN, - source_lang: str | NotGiven = NOT_GIVEN, - target_lang: str | NotGiven = NOT_GIVEN, - frequency_penalty: float | NotGiven = NOT_GIVEN, - lora: str | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - raw: bool | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - response_format: ai_run_params.PromptResponseFormat | NotGiven = NOT_GIVEN, - stream: bool | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_k: int | float | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, - messages: Iterable[ai_run_params.MessagesMessage] | NotGiven = NOT_GIVEN, - functions: Iterable[ai_run_params.MessagesFunction] | NotGiven = NOT_GIVEN, - tools: Iterable[ai_run_params.MessagesTool] | NotGiven = NOT_GIVEN, - input_text: str | NotGiven = NOT_GIVEN, - max_length: int | NotGiven = NOT_GIVEN, - ignore_eos: bool | NotGiven = NOT_GIVEN, + text: str | Union[str, SequenceNotStr[str]] | SequenceNotStr[str] | Omit = omit, + prompt: str | Omit = omit, + guidance: float | Omit = omit, + height: int | Omit = omit, + image: Iterable[float] | str | Omit = omit, + image_b64: str | Omit = omit, + mask: Iterable[float] | Omit = omit, + negative_prompt: str | Omit = omit, + num_steps: int | Omit = omit, + seed: int | float | Omit = omit, + strength: float | Omit = omit, + width: int | Omit = omit, + lang: str | Omit = omit, + audio: Iterable[float] | Omit = omit, + source_lang: str | Omit = omit, + target_lang: str | Omit = omit, + frequency_penalty: float | Omit = omit, + lora: str | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + raw: bool | Omit = omit, + repetition_penalty: float | Omit = omit, + response_format: ai_run_params.PromptResponseFormat | ai_run_params.MessagesResponseFormat | Omit = omit, + stream: bool | Omit = omit, + temperature: float | Omit = omit, + top_k: int | float | Omit = omit, + top_p: float | Omit = omit, + messages: Iterable[ai_run_params.MessagesMessage] | Iterable[ai_run_params.Variant13Message] | Omit = omit, + functions: Iterable[ai_run_params.MessagesFunction] | Omit = omit, + tools: Iterable[ai_run_params.MessagesTool] | Omit = omit, + input_text: str | Omit = omit, + max_length: int | Omit = omit, + ignore_eos: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -1009,6 +1060,10 @@ def tasks(self) -> AsyncTasksResource: def models(self) -> AsyncModelsResource: return AsyncModelsResource(self._client) + @cached_property + def to_markdown(self) -> AsyncToMarkdownResource: + return AsyncToMarkdownResource(self._client) + @cached_property def with_raw_response(self) -> AsyncAIResourceWithRawResponse: """ @@ -1040,7 +1095,7 @@ async def run( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1073,22 +1128,22 @@ async def run( *, account_id: str, prompt: str, - guidance: float | NotGiven = NOT_GIVEN, - height: int | NotGiven = NOT_GIVEN, - image: Iterable[float] | NotGiven = NOT_GIVEN, - image_b64: str | NotGiven = NOT_GIVEN, - mask: Iterable[float] | NotGiven = NOT_GIVEN, - negative_prompt: str | NotGiven = NOT_GIVEN, - num_steps: int | NotGiven = NOT_GIVEN, - seed: int | NotGiven = NOT_GIVEN, - strength: float | NotGiven = NOT_GIVEN, - width: int | NotGiven = NOT_GIVEN, + guidance: float | Omit = omit, + height: int | Omit = omit, + image: Iterable[float] | Omit = omit, + image_b64: str | Omit = omit, + mask: Iterable[float] | Omit = omit, + negative_prompt: str | Omit = omit, + num_steps: int | Omit = omit, + seed: int | Omit = omit, + strength: float | Omit = omit, + width: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1145,13 +1200,13 @@ async def run( *, account_id: str, prompt: str, - lang: str | NotGiven = NOT_GIVEN, + lang: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1186,13 +1241,13 @@ async def run( model_name: str, *, account_id: str, - text: Union[str, List[str]], + text: Union[str, 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1225,14 +1280,14 @@ async def run( *, account_id: str, audio: Iterable[float], - source_lang: str | NotGiven = NOT_GIVEN, - target_lang: str | NotGiven = NOT_GIVEN, + source_lang: str | Omit = omit, + target_lang: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1276,7 +1331,7 @@ async def run( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1309,13 +1364,13 @@ async def run( model_name: str, *, account_id: str, - image: Iterable[float] | NotGiven = NOT_GIVEN, + image: Iterable[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1349,24 +1404,24 @@ async def run( *, account_id: str, prompt: str, - frequency_penalty: float | NotGiven = NOT_GIVEN, - lora: str | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - raw: bool | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - response_format: ai_run_params.PromptResponseFormat | NotGiven = NOT_GIVEN, - seed: int | NotGiven = NOT_GIVEN, - stream: bool | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_k: int | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + lora: str | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + raw: bool | Omit = omit, + repetition_penalty: float | Omit = omit, + response_format: ai_run_params.PromptResponseFormat | Omit = omit, + seed: int | Omit = omit, + stream: bool | Omit = omit, + temperature: float | Omit = omit, + top_k: int | Omit = omit, + top_p: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1428,25 +1483,25 @@ async def run( *, account_id: str, messages: Iterable[ai_run_params.MessagesMessage], - frequency_penalty: float | NotGiven = NOT_GIVEN, - functions: Iterable[ai_run_params.MessagesFunction] | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - raw: bool | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - response_format: ai_run_params.MessagesResponseFormat | NotGiven = NOT_GIVEN, - seed: int | NotGiven = NOT_GIVEN, - stream: bool | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - tools: Iterable[ai_run_params.MessagesTool] | NotGiven = NOT_GIVEN, - top_k: int | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + functions: Iterable[ai_run_params.MessagesFunction] | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + raw: bool | Omit = omit, + repetition_penalty: float | Omit = omit, + response_format: ai_run_params.MessagesResponseFormat | Omit = omit, + seed: int | Omit = omit, + stream: bool | Omit = omit, + temperature: float | Omit = omit, + tools: Iterable[ai_run_params.MessagesTool] | Omit = omit, + top_k: int | Omit = omit, + top_p: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1509,13 +1564,13 @@ async def run( account_id: str, target_lang: str, text: str, - source_lang: str | NotGiven = NOT_GIVEN, + source_lang: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1553,13 +1608,13 @@ async def run( *, account_id: str, input_text: str, - max_length: int | NotGiven = NOT_GIVEN, + max_length: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1594,22 +1649,22 @@ async def run( *, account_id: str, image: Iterable[float], - frequency_penalty: float | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - prompt: str | NotGiven = NOT_GIVEN, - raw: bool | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - seed: float | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_k: float | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + prompt: str | Omit = omit, + raw: bool | Omit = omit, + repetition_penalty: float | Omit = omit, + seed: float | Omit = omit, + temperature: float | Omit = omit, + top_k: float | Omit = omit, + top_p: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1670,21 +1725,21 @@ async def run( account_id: str, image: str, prompt: str, - frequency_penalty: float | NotGiven = NOT_GIVEN, - ignore_eos: bool | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - seed: float | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_k: float | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + ignore_eos: bool | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + repetition_penalty: float | Omit = omit, + seed: float | Omit = omit, + temperature: float | Omit = omit, + top_k: float | Omit = omit, + top_p: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1744,21 +1799,21 @@ async def run( account_id: str, image: str, messages: Iterable[ai_run_params.Variant13Message], - frequency_penalty: float | NotGiven = NOT_GIVEN, - ignore_eos: bool | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - seed: float | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_k: float | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + ignore_eos: bool | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + repetition_penalty: float | Omit = omit, + seed: float | Omit = omit, + temperature: float | Omit = omit, + top_k: float | Omit = omit, + top_p: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: """ This endpoint provides users with the capability to run specific AI models @@ -1810,6 +1865,45 @@ async def run( """ ... + @overload + async def run( + self, + model_name: str, + *, + account_id: str, + image: str | Omit = omit, + text: 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + image: Image in base64 encoded format. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @required_args( ["account_id", "text"], ["account_id", "prompt"], @@ -1827,45 +1921,45 @@ async def run( model_name: str, *, account_id: str, - text: str | Union[str, List[str]] | NotGiven = NOT_GIVEN, - prompt: str | NotGiven = NOT_GIVEN, - guidance: float | NotGiven = NOT_GIVEN, - height: int | NotGiven = NOT_GIVEN, - image: Iterable[float] | str | NotGiven = NOT_GIVEN, - image_b64: str | NotGiven = NOT_GIVEN, - mask: Iterable[float] | NotGiven = NOT_GIVEN, - negative_prompt: str | NotGiven = NOT_GIVEN, - num_steps: int | NotGiven = NOT_GIVEN, - seed: int | float | NotGiven = NOT_GIVEN, - strength: float | NotGiven = NOT_GIVEN, - width: int | NotGiven = NOT_GIVEN, - lang: str | NotGiven = NOT_GIVEN, - audio: Iterable[float] | NotGiven = NOT_GIVEN, - source_lang: str | NotGiven = NOT_GIVEN, - target_lang: str | NotGiven = NOT_GIVEN, - frequency_penalty: float | NotGiven = NOT_GIVEN, - lora: str | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - raw: bool | NotGiven = NOT_GIVEN, - repetition_penalty: float | NotGiven = NOT_GIVEN, - response_format: ai_run_params.PromptResponseFormat | NotGiven = NOT_GIVEN, - stream: bool | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_k: int | float | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, - messages: Iterable[ai_run_params.MessagesMessage] | NotGiven = NOT_GIVEN, - functions: Iterable[ai_run_params.MessagesFunction] | NotGiven = NOT_GIVEN, - tools: Iterable[ai_run_params.MessagesTool] | NotGiven = NOT_GIVEN, - input_text: str | NotGiven = NOT_GIVEN, - max_length: int | NotGiven = NOT_GIVEN, - ignore_eos: bool | NotGiven = NOT_GIVEN, + text: str | Union[str, SequenceNotStr[str]] | SequenceNotStr[str] | Omit = omit, + prompt: str | Omit = omit, + guidance: float | Omit = omit, + height: int | Omit = omit, + image: Iterable[float] | str | Omit = omit, + image_b64: str | Omit = omit, + mask: Iterable[float] | Omit = omit, + negative_prompt: str | Omit = omit, + num_steps: int | Omit = omit, + seed: int | float | Omit = omit, + strength: float | Omit = omit, + width: int | Omit = omit, + lang: str | Omit = omit, + audio: Iterable[float] | Omit = omit, + source_lang: str | Omit = omit, + target_lang: str | Omit = omit, + frequency_penalty: float | Omit = omit, + lora: str | Omit = omit, + max_tokens: int | Omit = omit, + presence_penalty: float | Omit = omit, + raw: bool | Omit = omit, + repetition_penalty: float | Omit = omit, + response_format: ai_run_params.PromptResponseFormat | ai_run_params.MessagesResponseFormat | Omit = omit, + stream: bool | Omit = omit, + temperature: float | Omit = omit, + top_k: int | float | Omit = omit, + top_p: float | Omit = omit, + messages: Iterable[ai_run_params.MessagesMessage] | Iterable[ai_run_params.Variant13Message] | Omit = omit, + functions: Iterable[ai_run_params.MessagesFunction] | Omit = omit, + tools: Iterable[ai_run_params.MessagesTool] | Omit = omit, + input_text: str | Omit = omit, + max_length: int | Omit = omit, + ignore_eos: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AIRunResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -1951,6 +2045,10 @@ def tasks(self) -> TasksResourceWithRawResponse: def models(self) -> ModelsResourceWithRawResponse: return ModelsResourceWithRawResponse(self._ai.models) + @cached_property + def to_markdown(self) -> ToMarkdownResourceWithRawResponse: + return ToMarkdownResourceWithRawResponse(self._ai.to_markdown) + class AsyncAIResourceWithRawResponse: def __init__(self, ai: AsyncAIResource) -> None: @@ -1976,6 +2074,10 @@ def tasks(self) -> AsyncTasksResourceWithRawResponse: def models(self) -> AsyncModelsResourceWithRawResponse: return AsyncModelsResourceWithRawResponse(self._ai.models) + @cached_property + def to_markdown(self) -> AsyncToMarkdownResourceWithRawResponse: + return AsyncToMarkdownResourceWithRawResponse(self._ai.to_markdown) + class AIResourceWithStreamingResponse: def __init__(self, ai: AIResource) -> None: @@ -2001,6 +2103,10 @@ def tasks(self) -> TasksResourceWithStreamingResponse: def models(self) -> ModelsResourceWithStreamingResponse: return ModelsResourceWithStreamingResponse(self._ai.models) + @cached_property + def to_markdown(self) -> ToMarkdownResourceWithStreamingResponse: + return ToMarkdownResourceWithStreamingResponse(self._ai.to_markdown) + class AsyncAIResourceWithStreamingResponse: def __init__(self, ai: AsyncAIResource) -> None: @@ -2025,3 +2131,7 @@ def tasks(self) -> AsyncTasksResourceWithStreamingResponse: @cached_property def models(self) -> AsyncModelsResourceWithStreamingResponse: return AsyncModelsResourceWithStreamingResponse(self._ai.models) + + @cached_property + def to_markdown(self) -> AsyncToMarkdownResourceWithStreamingResponse: + return AsyncToMarkdownResourceWithStreamingResponse(self._ai.to_markdown) diff --git a/src/cloudflare/resources/ai/authors.py b/src/cloudflare/resources/ai/authors.py index f5c5ce9877d..8f3ceeb8486 100644 --- a/src/cloudflare/resources/ai/authors.py +++ b/src/cloudflare/resources/ai/authors.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -48,7 +48,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[object]: """ Author Search @@ -103,7 +103,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[object, AsyncSinglePage[object]]: """ Author Search diff --git a/src/cloudflare/resources/ai/finetunes/assets.py b/src/cloudflare/resources/ai/finetunes/assets.py index f1da603332b..50ce6bb6cae 100644 --- a/src/cloudflare/resources/ai/finetunes/assets.py +++ b/src/cloudflare/resources/ai/finetunes/assets.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import Type, Mapping, cast +from typing import Mapping, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from ...._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given from ...._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -16,7 +16,6 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper from ...._base_client import make_request_options from ....types.ai.finetunes import asset_create_params from ....types.ai.finetunes.asset_create_response import AssetCreateResponse @@ -49,14 +48,14 @@ def create( finetune_id: str, *, account_id: str, - file: FileTypes | NotGiven = NOT_GIVEN, - file_name: str | NotGiven = NOT_GIVEN, + file: FileTypes | Omit = omit, + file_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AssetCreateResponse: """ Upload a Finetune Asset @@ -90,13 +89,9 @@ def create( body=maybe_transform(body, asset_create_params.AssetCreateParams), files=files, options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[AssetCreateResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[AssetCreateResponse], ResultWrapper[AssetCreateResponse]), + cast_to=AssetCreateResponse, ) @@ -125,14 +120,14 @@ async def create( finetune_id: str, *, account_id: str, - file: FileTypes | NotGiven = NOT_GIVEN, - file_name: str | NotGiven = NOT_GIVEN, + file: FileTypes | Omit = omit, + file_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AssetCreateResponse: """ Upload a Finetune Asset @@ -166,13 +161,9 @@ async def create( body=await async_maybe_transform(body, asset_create_params.AssetCreateParams), files=files, options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[AssetCreateResponse]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[AssetCreateResponse], ResultWrapper[AssetCreateResponse]), + cast_to=AssetCreateResponse, ) diff --git a/src/cloudflare/resources/ai/finetunes/finetunes.py b/src/cloudflare/resources/ai/finetunes/finetunes.py index 47de3973b44..e998763b6f2 100644 --- a/src/cloudflare/resources/ai/finetunes/finetunes.py +++ b/src/cloudflare/resources/ai/finetunes/finetunes.py @@ -22,7 +22,7 @@ PublicResourceWithStreamingResponse, AsyncPublicResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 ....types.ai import finetune_create_params @@ -75,14 +75,14 @@ def create( account_id: str, model: str, name: str, - description: str | NotGiven = NOT_GIVEN, - public: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + public: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FinetuneCreateResponse: """ Create a new Finetune @@ -128,7 +128,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FinetuneListResponse: """ List Finetunes @@ -191,14 +191,14 @@ async def create( account_id: str, model: str, name: str, - description: str | NotGiven = NOT_GIVEN, - public: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + public: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FinetuneCreateResponse: """ Create a new Finetune @@ -244,7 +244,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FinetuneListResponse: """ List Finetunes diff --git a/src/cloudflare/resources/ai/finetunes/public.py b/src/cloudflare/resources/ai/finetunes/public.py index c8d542c985e..0e8f9e74988 100644 --- a/src/cloudflare/resources/ai/finetunes/public.py +++ b/src/cloudflare/resources/ai/finetunes/public.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -46,15 +46,15 @@ def list( self, *, account_id: str, - limit: float | NotGiven = NOT_GIVEN, - offset: float | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, + limit: float | Omit = omit, + offset: float | Omit = omit, + order_by: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PublicListResponse]: """ List Public Finetunes @@ -121,15 +121,15 @@ def list( self, *, account_id: str, - limit: float | NotGiven = NOT_GIVEN, - offset: float | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, + limit: float | Omit = omit, + offset: float | Omit = omit, + order_by: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PublicListResponse, AsyncSinglePage[PublicListResponse]]: """ List Public Finetunes diff --git a/src/cloudflare/resources/ai/models/models.py b/src/cloudflare/resources/ai/models/models.py index 74f1ac1ad34..9d6d4f9c83d 100644 --- a/src/cloudflare/resources/ai/models/models.py +++ b/src/cloudflare/resources/ai/models/models.py @@ -12,7 +12,7 @@ SchemaResourceWithStreamingResponse, AsyncSchemaResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform from ...._compat import cached_property from ....types.ai import model_list_params @@ -57,19 +57,19 @@ def list( self, *, account_id: str, - author: str | NotGiven = NOT_GIVEN, - hide_experimental: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - source: float | NotGiven = NOT_GIVEN, - task: str | NotGiven = NOT_GIVEN, + author: str | Omit = omit, + hide_experimental: bool | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: str | Omit = omit, + source: float | Omit = omit, + task: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[object]: """ Model Search @@ -148,19 +148,19 @@ def list( self, *, account_id: str, - author: str | NotGiven = NOT_GIVEN, - hide_experimental: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - source: float | NotGiven = NOT_GIVEN, - task: str | NotGiven = NOT_GIVEN, + author: str | Omit = omit, + hide_experimental: bool | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: str | Omit = omit, + source: float | Omit = omit, + task: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[object, AsyncV4PagePaginationArray[object]]: """ Model Search diff --git a/src/cloudflare/resources/ai/models/schema.py b/src/cloudflare/resources/ai/models/schema.py index a388ffb8beb..2f12236dd38 100644 --- a/src/cloudflare/resources/ai/models/schema.py +++ b/src/cloudflare/resources/ai/models/schema.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,7 +53,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Get Model Schema @@ -115,7 +115,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Get Model Schema diff --git a/src/cloudflare/resources/ai/tasks.py b/src/cloudflare/resources/ai/tasks.py index 16b130e6805..26fcd51f8b0 100644 --- a/src/cloudflare/resources/ai/tasks.py +++ b/src/cloudflare/resources/ai/tasks.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -48,7 +48,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[object]: """ Task Search @@ -103,7 +103,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[object, AsyncSinglePage[object]]: """ Task Search diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/datasets/health.py b/src/cloudflare/resources/ai/to_markdown.py similarity index 51% rename from src/cloudflare/resources/cloudforce_one/threat_events/datasets/health.py rename to src/cloudflare/resources/ai/to_markdown.py index 9d45aeebd89..c7080fd87a9 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/datasets/health.py +++ b/src/cloudflare/resources/ai/to_markdown.py @@ -4,44 +4,46 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._compat import cached_property -from ....._resource import SyncAPIResource, AsyncAPIResource -from ....._response import ( +from ..._files import read_file_content +from ..._types import Body, Query, Headers, NotGiven, FileContent, 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 ....._base_client import make_request_options -from .....types.cloudforce_one.threat_events.datasets.health_get_response import HealthGetResponse +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.ai.to_markdown_transform_response import ToMarkdownTransformResponse -__all__ = ["HealthResource", "AsyncHealthResource"] +__all__ = ["ToMarkdownResource", "AsyncToMarkdownResource"] -class HealthResource(SyncAPIResource): +class ToMarkdownResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> HealthResourceWithRawResponse: + def with_raw_response(self) -> ToMarkdownResourceWithRawResponse: """ 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 HealthResourceWithRawResponse(self) + return ToMarkdownResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> HealthResourceWithStreamingResponse: + def with_streaming_response(self) -> ToMarkdownResourceWithStreamingResponse: """ 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 HealthResourceWithStreamingResponse(self) + return ToMarkdownResourceWithStreamingResponse(self) - def get( + def transform( self, - dataset_id: str, + file: FileContent, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -49,16 +51,12 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthGetResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncSinglePage[ToMarkdownTransformResponse]: """ - Benchmark Durable Object warmup + Convert Files into Markdown Args: - account_id: Account ID. - - dataset_id: Dataset ID. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -69,40 +67,42 @@ def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not dataset_id: - raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") - return self._get( - f"/accounts/{account_id}/cloudforce-one/events/dataset/{dataset_id}/health", + extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})} + return self._get_api_list( + f"/accounts/{account_id}/ai/tomarkdown", + page=SyncSinglePage[ToMarkdownTransformResponse], + body=read_file_content(file), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=HealthGetResponse, + model=ToMarkdownTransformResponse, + method="post", ) -class AsyncHealthResource(AsyncAPIResource): +class AsyncToMarkdownResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncHealthResourceWithRawResponse: + def with_raw_response(self) -> AsyncToMarkdownResourceWithRawResponse: """ 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 AsyncHealthResourceWithRawResponse(self) + return AsyncToMarkdownResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncHealthResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncToMarkdownResourceWithStreamingResponse: """ 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 AsyncHealthResourceWithStreamingResponse(self) + return AsyncToMarkdownResourceWithStreamingResponse(self) - async def get( + def transform( self, - dataset_id: str, + file: FileContent, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -110,16 +110,12 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthGetResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ToMarkdownTransformResponse, AsyncSinglePage[ToMarkdownTransformResponse]]: """ - Benchmark Durable Object warmup + Convert Files into Markdown Args: - account_id: Account ID. - - dataset_id: Dataset ID. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -130,48 +126,50 @@ async def get( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not dataset_id: - raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") - return await self._get( - f"/accounts/{account_id}/cloudforce-one/events/dataset/{dataset_id}/health", + extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})} + return self._get_api_list( + f"/accounts/{account_id}/ai/tomarkdown", + page=AsyncSinglePage[ToMarkdownTransformResponse], + body=read_file_content(file), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=HealthGetResponse, + model=ToMarkdownTransformResponse, + method="post", ) -class HealthResourceWithRawResponse: - def __init__(self, health: HealthResource) -> None: - self._health = health +class ToMarkdownResourceWithRawResponse: + def __init__(self, to_markdown: ToMarkdownResource) -> None: + self._to_markdown = to_markdown - self.get = to_raw_response_wrapper( - health.get, + self.transform = to_raw_response_wrapper( + to_markdown.transform, ) -class AsyncHealthResourceWithRawResponse: - def __init__(self, health: AsyncHealthResource) -> None: - self._health = health +class AsyncToMarkdownResourceWithRawResponse: + def __init__(self, to_markdown: AsyncToMarkdownResource) -> None: + self._to_markdown = to_markdown - self.get = async_to_raw_response_wrapper( - health.get, + self.transform = async_to_raw_response_wrapper( + to_markdown.transform, ) -class HealthResourceWithStreamingResponse: - def __init__(self, health: HealthResource) -> None: - self._health = health +class ToMarkdownResourceWithStreamingResponse: + def __init__(self, to_markdown: ToMarkdownResource) -> None: + self._to_markdown = to_markdown - self.get = to_streamed_response_wrapper( - health.get, + self.transform = to_streamed_response_wrapper( + to_markdown.transform, ) -class AsyncHealthResourceWithStreamingResponse: - def __init__(self, health: AsyncHealthResource) -> None: - self._health = health +class AsyncToMarkdownResourceWithStreamingResponse: + def __init__(self, to_markdown: AsyncToMarkdownResource) -> None: + self._to_markdown = to_markdown - self.get = async_to_streamed_response_wrapper( - health.get, + self.transform = async_to_streamed_response_wrapper( + to_markdown.transform, ) diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py index d665650c3d4..4deeb83f17e 100644 --- a/src/cloudflare/resources/ai_gateway/ai_gateway.py +++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, Iterable, Optional, cast from typing_extensions import Literal import httpx @@ -23,7 +23,7 @@ URLsResourceWithStreamingResponse, AsyncURLsResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .datasets import ( DatasetsResource, @@ -121,17 +121,17 @@ def create( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], - authentication: bool | NotGiven = NOT_GIVEN, - log_management: Optional[int] | NotGiven = NOT_GIVEN, - log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | NotGiven = NOT_GIVEN, - logpush: bool | NotGiven = NOT_GIVEN, - logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, + authentication: bool | Omit = omit, + log_management: Optional[int] | Omit = omit, + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit, + logpush: bool | Omit = omit, + logpush_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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayCreateResponse: """ Create a new Gateway @@ -189,17 +189,21 @@ def update( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], - authentication: bool | NotGiven = NOT_GIVEN, - log_management: Optional[int] | NotGiven = NOT_GIVEN, - log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | NotGiven = NOT_GIVEN, - logpush: bool | NotGiven = NOT_GIVEN, - logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, + authentication: bool | Omit = omit, + dlp: ai_gateway_update_params.DLP | Omit = omit, + log_management: Optional[int] | Omit = omit, + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit, + logpush: bool | Omit = omit, + logpush_public_key: Optional[str] | Omit = omit, + otel: Optional[Iterable[ai_gateway_update_params.Otel]] | Omit = omit, + store_id: Optional[str] | Omit = omit, + stripe: Optional[ai_gateway_update_params.Stripe] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayUpdateResponse: """ Update a Gateway @@ -230,10 +234,14 @@ def update( "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, "authentication": authentication, + "dlp": dlp, "log_management": log_management, "log_management_strategy": log_management_strategy, "logpush": logpush, "logpush_public_key": logpush_public_key, + "otel": otel, + "store_id": store_id, + "stripe": stripe, }, ai_gateway_update_params.AIGatewayUpdateParams, ), @@ -251,15 +259,15 @@ def list( self, *, account_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[AIGatewayListResponse]: """ List Gateways @@ -307,7 +315,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayDeleteResponse: """ Delete a Gateway @@ -349,7 +357,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayGetResponse: """ Fetch a Gateway @@ -433,17 +441,17 @@ async def create( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], - authentication: bool | NotGiven = NOT_GIVEN, - log_management: Optional[int] | NotGiven = NOT_GIVEN, - log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | NotGiven = NOT_GIVEN, - logpush: bool | NotGiven = NOT_GIVEN, - logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, + authentication: bool | Omit = omit, + log_management: Optional[int] | Omit = omit, + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit, + logpush: bool | Omit = omit, + logpush_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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayCreateResponse: """ Create a new Gateway @@ -501,17 +509,21 @@ async def update( rate_limiting_interval: Optional[int], rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], - authentication: bool | NotGiven = NOT_GIVEN, - log_management: Optional[int] | NotGiven = NOT_GIVEN, - log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | NotGiven = NOT_GIVEN, - logpush: bool | NotGiven = NOT_GIVEN, - logpush_public_key: Optional[str] | NotGiven = NOT_GIVEN, + authentication: bool | Omit = omit, + dlp: ai_gateway_update_params.DLP | Omit = omit, + log_management: Optional[int] | Omit = omit, + log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit, + logpush: bool | Omit = omit, + logpush_public_key: Optional[str] | Omit = omit, + otel: Optional[Iterable[ai_gateway_update_params.Otel]] | Omit = omit, + store_id: Optional[str] | Omit = omit, + stripe: Optional[ai_gateway_update_params.Stripe] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayUpdateResponse: """ Update a Gateway @@ -542,10 +554,14 @@ async def update( "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, "authentication": authentication, + "dlp": dlp, "log_management": log_management, "log_management_strategy": log_management_strategy, "logpush": logpush, "logpush_public_key": logpush_public_key, + "otel": otel, + "store_id": store_id, + "stripe": stripe, }, ai_gateway_update_params.AIGatewayUpdateParams, ), @@ -563,15 +579,15 @@ def list( self, *, account_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AIGatewayListResponse, AsyncV4PagePaginationArray[AIGatewayListResponse]]: """ List Gateways @@ -619,7 +635,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayDeleteResponse: """ Delete a Gateway @@ -661,7 +677,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayGetResponse: """ Fetch a Gateway diff --git a/src/cloudflare/resources/ai_gateway/datasets.py b/src/cloudflare/resources/ai_gateway/datasets.py index 1f7a6f69882..bb256a33205 100644 --- a/src/cloudflare/resources/ai_gateway/datasets.py +++ b/src/cloudflare/resources/ai_gateway/datasets.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -62,7 +62,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetCreateResponse: """ Create a new Dataset @@ -116,7 +116,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetUpdateResponse: """ Update a Dataset @@ -163,17 +163,17 @@ def list( gateway_id: str, *, account_id: str, - enable: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + enable: bool | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[DatasetListResponse]: """ List Datasets @@ -228,7 +228,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetDeleteResponse: """ Delete a Dataset @@ -273,7 +273,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetGetResponse: """ Fetch a Dataset @@ -341,7 +341,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetCreateResponse: """ Create a new Dataset @@ -395,7 +395,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetUpdateResponse: """ Update a Dataset @@ -442,17 +442,17 @@ def list( gateway_id: str, *, account_id: str, - enable: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + enable: bool | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DatasetListResponse, AsyncV4PagePaginationArray[DatasetListResponse]]: """ List Datasets @@ -507,7 +507,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetDeleteResponse: """ Delete a Dataset @@ -552,7 +552,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetGetResponse: """ Fetch a Dataset diff --git a/src/cloudflare/resources/ai_gateway/evaluation_types.py b/src/cloudflare/resources/ai_gateway/evaluation_types.py index 047c5936dec..ed06314835d 100644 --- a/src/cloudflare/resources/ai_gateway/evaluation_types.py +++ b/src/cloudflare/resources/ai_gateway/evaluation_types.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,16 +48,16 @@ def list( self, *, account_id: str, - order_by: str | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + order_by: str | Omit = omit, + order_by_direction: Literal["asc", "desc"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[EvaluationTypeListResponse]: """ List Evaluators @@ -119,16 +119,16 @@ def list( self, *, account_id: str, - order_by: str | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + order_by: str | Omit = omit, + order_by_direction: Literal["asc", "desc"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EvaluationTypeListResponse, AsyncV4PagePaginationArray[EvaluationTypeListResponse]]: """ List Evaluators diff --git a/src/cloudflare/resources/ai_gateway/evaluations.py b/src/cloudflare/resources/ai_gateway/evaluations.py index b57f840d9b3..e3d9fd87309 100644 --- a/src/cloudflare/resources/ai_gateway/evaluations.py +++ b/src/cloudflare/resources/ai_gateway/evaluations.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import Type, cast import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,15 +53,15 @@ def create( gateway_id: str, *, account_id: str, - dataset_ids: List[str], - evaluation_type_ids: List[str], + dataset_ids: SequenceNotStr[str], + evaluation_type_ids: SequenceNotStr[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationCreateResponse: """ Create a new Evaluation @@ -106,17 +106,17 @@ def list( gateway_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - processed: bool | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + processed: bool | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[EvaluationListResponse]: """ List Evaluations @@ -171,7 +171,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationDeleteResponse: """ Delete a Evaluation @@ -216,7 +216,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationGetResponse: """ Fetch a Evaluation @@ -276,15 +276,15 @@ async def create( gateway_id: str, *, account_id: str, - dataset_ids: List[str], - evaluation_type_ids: List[str], + dataset_ids: SequenceNotStr[str], + evaluation_type_ids: SequenceNotStr[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationCreateResponse: """ Create a new Evaluation @@ -329,17 +329,17 @@ def list( gateway_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - processed: bool | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + processed: bool | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EvaluationListResponse, AsyncV4PagePaginationArray[EvaluationListResponse]]: """ List Evaluations @@ -394,7 +394,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationDeleteResponse: """ Delete a Evaluation @@ -439,7 +439,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationGetResponse: """ Fetch a Evaluation diff --git a/src/cloudflare/resources/ai_gateway/logs.py b/src/cloudflare/resources/ai_gateway/logs.py index d2336f16603..8518d36781c 100644 --- a/src/cloudflare/resources/ai_gateway/logs.py +++ b/src/cloudflare/resources/ai_gateway/logs.py @@ -8,7 +8,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,40 +54,40 @@ def list( gateway_id: str, *, account_id: str, - cached: bool | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - end_date: Union[str, datetime] | NotGiven = NOT_GIVEN, - feedback: Literal[0, 1] | NotGiven = NOT_GIVEN, - filters: Iterable[log_list_params.Filter] | NotGiven = NOT_GIVEN, - max_cost: float | NotGiven = NOT_GIVEN, - max_duration: float | NotGiven = NOT_GIVEN, - max_tokens_in: float | NotGiven = NOT_GIVEN, - max_tokens_out: float | NotGiven = NOT_GIVEN, - max_total_tokens: float | NotGiven = NOT_GIVEN, - meta_info: bool | NotGiven = NOT_GIVEN, - min_cost: float | NotGiven = NOT_GIVEN, - min_duration: float | NotGiven = NOT_GIVEN, - min_tokens_in: float | NotGiven = NOT_GIVEN, - min_tokens_out: float | NotGiven = NOT_GIVEN, - min_total_tokens: float | NotGiven = NOT_GIVEN, - model: str | NotGiven = NOT_GIVEN, - model_type: str | NotGiven = NOT_GIVEN, - order_by: Literal["created_at", "provider", "model", "model_type", "success", "cached"] | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - provider: str | NotGiven = NOT_GIVEN, - request_content_type: str | NotGiven = NOT_GIVEN, - response_content_type: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - start_date: Union[str, datetime] | NotGiven = NOT_GIVEN, - success: bool | NotGiven = NOT_GIVEN, + cached: bool | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + end_date: Union[str, datetime] | Omit = omit, + feedback: Literal[0, 1] | Omit = omit, + filters: Iterable[log_list_params.Filter] | Omit = omit, + max_cost: float | Omit = omit, + max_duration: float | Omit = omit, + max_tokens_in: float | Omit = omit, + max_tokens_out: float | Omit = omit, + max_total_tokens: float | Omit = omit, + meta_info: bool | Omit = omit, + min_cost: float | Omit = omit, + min_duration: float | Omit = omit, + min_tokens_in: float | Omit = omit, + min_tokens_out: float | Omit = omit, + min_total_tokens: float | Omit = omit, + model: str | Omit = omit, + model_type: str | Omit = omit, + order_by: Literal["created_at", "provider", "model", "model_type", "success", "cached"] | Omit = omit, + order_by_direction: Literal["asc", "desc"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + provider: str | Omit = omit, + request_content_type: str | Omit = omit, + response_content_type: str | Omit = omit, + search: str | Omit = omit, + start_date: Union[str, datetime] | Omit = omit, + success: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[LogListResponse]: """ List Gateway Logs @@ -157,8 +157,8 @@ def delete( gateway_id: str, *, account_id: str, - filters: Iterable[log_delete_params.Filter] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, + filters: Iterable[log_delete_params.Filter] | Omit = omit, + limit: int | Omit = omit, order_by: Literal[ "created_at", "provider", @@ -172,14 +172,14 @@ def delete( "duration", "feedback", ] - | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + | Omit = omit, + order_by_direction: Literal["asc", "desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LogDeleteResponse: """ Delete Gateway Logs @@ -225,15 +225,15 @@ def edit( *, account_id: str, gateway_id: str, - feedback: Optional[float] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN, - score: Optional[float] | NotGiven = NOT_GIVEN, + feedback: Optional[float] | Omit = omit, + metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit, + score: Optional[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Patch Gateway Log @@ -286,7 +286,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LogGetResponse: """ Get Gateway Log Detail @@ -331,7 +331,7 @@ def request( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Get Gateway Log Request @@ -372,7 +372,7 @@ def response( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Get Gateway Log Response @@ -428,40 +428,40 @@ def list( gateway_id: str, *, account_id: str, - cached: bool | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - end_date: Union[str, datetime] | NotGiven = NOT_GIVEN, - feedback: Literal[0, 1] | NotGiven = NOT_GIVEN, - filters: Iterable[log_list_params.Filter] | NotGiven = NOT_GIVEN, - max_cost: float | NotGiven = NOT_GIVEN, - max_duration: float | NotGiven = NOT_GIVEN, - max_tokens_in: float | NotGiven = NOT_GIVEN, - max_tokens_out: float | NotGiven = NOT_GIVEN, - max_total_tokens: float | NotGiven = NOT_GIVEN, - meta_info: bool | NotGiven = NOT_GIVEN, - min_cost: float | NotGiven = NOT_GIVEN, - min_duration: float | NotGiven = NOT_GIVEN, - min_tokens_in: float | NotGiven = NOT_GIVEN, - min_tokens_out: float | NotGiven = NOT_GIVEN, - min_total_tokens: float | NotGiven = NOT_GIVEN, - model: str | NotGiven = NOT_GIVEN, - model_type: str | NotGiven = NOT_GIVEN, - order_by: Literal["created_at", "provider", "model", "model_type", "success", "cached"] | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - provider: str | NotGiven = NOT_GIVEN, - request_content_type: str | NotGiven = NOT_GIVEN, - response_content_type: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - start_date: Union[str, datetime] | NotGiven = NOT_GIVEN, - success: bool | NotGiven = NOT_GIVEN, + cached: bool | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + end_date: Union[str, datetime] | Omit = omit, + feedback: Literal[0, 1] | Omit = omit, + filters: Iterable[log_list_params.Filter] | Omit = omit, + max_cost: float | Omit = omit, + max_duration: float | Omit = omit, + max_tokens_in: float | Omit = omit, + max_tokens_out: float | Omit = omit, + max_total_tokens: float | Omit = omit, + meta_info: bool | Omit = omit, + min_cost: float | Omit = omit, + min_duration: float | Omit = omit, + min_tokens_in: float | Omit = omit, + min_tokens_out: float | Omit = omit, + min_total_tokens: float | Omit = omit, + model: str | Omit = omit, + model_type: str | Omit = omit, + order_by: Literal["created_at", "provider", "model", "model_type", "success", "cached"] | Omit = omit, + order_by_direction: Literal["asc", "desc"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + provider: str | Omit = omit, + request_content_type: str | Omit = omit, + response_content_type: str | Omit = omit, + search: str | Omit = omit, + start_date: Union[str, datetime] | Omit = omit, + success: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[LogListResponse, AsyncV4PagePaginationArray[LogListResponse]]: """ List Gateway Logs @@ -531,8 +531,8 @@ async def delete( gateway_id: str, *, account_id: str, - filters: Iterable[log_delete_params.Filter] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, + filters: Iterable[log_delete_params.Filter] | Omit = omit, + limit: int | Omit = omit, order_by: Literal[ "created_at", "provider", @@ -546,14 +546,14 @@ async def delete( "duration", "feedback", ] - | NotGiven = NOT_GIVEN, - order_by_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + | Omit = omit, + order_by_direction: Literal["asc", "desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LogDeleteResponse: """ Delete Gateway Logs @@ -599,15 +599,15 @@ async def edit( *, account_id: str, gateway_id: str, - feedback: Optional[float] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN, - score: Optional[float] | NotGiven = NOT_GIVEN, + feedback: Optional[float] | Omit = omit, + metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit, + score: Optional[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Patch Gateway Log @@ -660,7 +660,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LogGetResponse: """ Get Gateway Log Detail @@ -705,7 +705,7 @@ async def request( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Get Gateway Log Request @@ -746,7 +746,7 @@ async def response( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Get Gateway Log Response diff --git a/src/cloudflare/resources/ai_gateway/urls.py b/src/cloudflare/resources/ai_gateway/urls.py index d29f1b62794..8f660faa164 100644 --- a/src/cloudflare/resources/ai_gateway/urls.py +++ b/src/cloudflare/resources/ai_gateway/urls.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -53,7 +53,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Get Gateway URL @@ -119,7 +119,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Get Gateway URL diff --git a/src/cloudflare/resources/alerting/available_alerts.py b/src/cloudflare/resources/alerting/available_alerts.py index 713f9e8db34..1286d27f1e6 100644 --- a/src/cloudflare/resources/alerting/available_alerts.py +++ b/src/cloudflare/resources/alerting/available_alerts.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -51,7 +51,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AvailableAlertListResponse]: """ Gets a list of all alert types for which an account is eligible. @@ -111,7 +111,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AvailableAlertListResponse]: """ Gets a list of all alert types for which an account is eligible. diff --git a/src/cloudflare/resources/alerting/destinations/eligible.py b/src/cloudflare/resources/alerting/destinations/eligible.py index b93d17a6409..76a61c05f51 100644 --- a/src/cloudflare/resources/alerting/destinations/eligible.py +++ b/src/cloudflare/resources/alerting/destinations/eligible.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EligibleGetResponse]: """ Get a list of all delivery mechanism types for which an account is eligible. @@ -111,7 +111,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EligibleGetResponse]: """ Get a list of all delivery mechanism types for which an account is eligible. diff --git a/src/cloudflare/resources/alerting/destinations/pagerduty.py b/src/cloudflare/resources/alerting/destinations/pagerduty.py index 035b26f0af8..223dfead7a8 100644 --- a/src/cloudflare/resources/alerting/destinations/pagerduty.py +++ b/src/cloudflare/resources/alerting/destinations/pagerduty.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -55,7 +55,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PagerdutyCreateResponse]: """ Creates a new token for integrating with PagerDuty. @@ -94,7 +94,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PagerdutyDeleteResponse: """ Deletes all the PagerDuty Services connected to the account. @@ -129,7 +129,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Pagerduty]: """ Get a list of all configured PagerDuty services. @@ -166,7 +166,7 @@ def link( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PagerdutyLinkResponse]: """ Links PagerDuty with the account using the integration token. @@ -230,7 +230,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PagerdutyCreateResponse]: """ Creates a new token for integrating with PagerDuty. @@ -269,7 +269,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PagerdutyDeleteResponse: """ Deletes all the PagerDuty Services connected to the account. @@ -304,7 +304,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Pagerduty, AsyncSinglePage[Pagerduty]]: """ Get a list of all configured PagerDuty services. @@ -341,7 +341,7 @@ async def link( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PagerdutyLinkResponse]: """ Links PagerDuty with the account using the integration token. diff --git a/src/cloudflare/resources/alerting/destinations/webhooks.py b/src/cloudflare/resources/alerting/destinations/webhooks.py index 09c887d2d93..9a83705a4fd 100644 --- a/src/cloudflare/resources/alerting/destinations/webhooks.py +++ b/src/cloudflare/resources/alerting/destinations/webhooks.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,13 +54,13 @@ def create( account_id: str, name: str, url: str, - secret: str | NotGiven = NOT_GIVEN, + secret: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[WebhookCreateResponse]: """ Creates a new webhook destination. @@ -114,13 +114,13 @@ def update( account_id: str, name: str, url: str, - secret: str | NotGiven = NOT_GIVEN, + secret: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[WebhookUpdateResponse]: """ Update a webhook destination. @@ -180,7 +180,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Webhooks]: """ Gets a list of all configured webhook destinations. @@ -217,7 +217,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WebhookDeleteResponse: """ Delete a configured webhook destination. @@ -257,7 +257,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Webhooks]: """ Get details for a single webhooks destination. @@ -318,13 +318,13 @@ async def create( account_id: str, name: str, url: str, - secret: str | NotGiven = NOT_GIVEN, + secret: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[WebhookCreateResponse]: """ Creates a new webhook destination. @@ -378,13 +378,13 @@ async def update( account_id: str, name: str, url: str, - secret: str | NotGiven = NOT_GIVEN, + secret: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[WebhookUpdateResponse]: """ Update a webhook destination. @@ -444,7 +444,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Webhooks, AsyncSinglePage[Webhooks]]: """ Gets a list of all configured webhook destinations. @@ -481,7 +481,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WebhookDeleteResponse: """ Delete a configured webhook destination. @@ -521,7 +521,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Webhooks]: """ Get details for a single webhooks destination. diff --git a/src/cloudflare/resources/alerting/history.py b/src/cloudflare/resources/alerting/history.py index 23733d5fa65..8eee416174e 100644 --- a/src/cloudflare/resources/alerting/history.py +++ b/src/cloudflare/resources/alerting/history.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,16 +49,16 @@ def list( self, *, account_id: str, - before: Union[str, datetime] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, + before: Union[str, datetime] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + since: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[History]: """Gets a list of history records for notifications sent to an account. @@ -135,16 +135,16 @@ def list( self, *, account_id: str, - before: Union[str, datetime] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, + before: Union[str, datetime] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + since: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[History, AsyncV4PagePaginationArray[History]]: """Gets a list of history records for notifications sent to an account. diff --git a/src/cloudflare/resources/alerting/policies.py b/src/cloudflare/resources/alerting/policies.py index 352c836cc12..8f8115ecd60 100644 --- a/src/cloudflare/resources/alerting/policies.py +++ b/src/cloudflare/resources/alerting/policies.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,6 +56,7 @@ def create( *, account_id: str, alert_type: Literal[ + "abuse_report_alert", "access_custom_certificate_expiration_type", "advanced_ddos_attack_l4_alert", "advanced_ddos_attack_l7_alert", @@ -127,15 +128,15 @@ def create( enabled: bool, mechanisms: MechanismParam, name: str, - alert_interval: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - filters: PolicyFilterParam | NotGiven = NOT_GIVEN, + alert_interval: str | Omit = omit, + description: str | Omit = omit, + filters: PolicyFilterParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyCreateResponse]: """ Creates a new Notification policy. @@ -202,8 +203,9 @@ def update( policy_id: str, *, account_id: str, - alert_interval: str | NotGiven = NOT_GIVEN, + alert_interval: str | Omit = omit, alert_type: Literal[ + "abuse_report_alert", "access_custom_certificate_expiration_type", "advanced_ddos_attack_l4_alert", "advanced_ddos_attack_l7_alert", @@ -272,18 +274,18 @@ def update( "web_analytics_metrics_update", "zone_aop_custom_certificate_expiration_type", ] - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - filters: PolicyFilterParam | NotGiven = NOT_GIVEN, - mechanisms: MechanismParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + filters: PolicyFilterParam | Omit = omit, + mechanisms: MechanismParam | 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyUpdateResponse]: """ Update a Notification policy. @@ -358,7 +360,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Policy]: """ Get a list of all Notification policies. @@ -395,7 +397,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyDeleteResponse: """ Delete a Notification policy. @@ -435,7 +437,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Policy]: """ Get details for a single policy. @@ -495,6 +497,7 @@ async def create( *, account_id: str, alert_type: Literal[ + "abuse_report_alert", "access_custom_certificate_expiration_type", "advanced_ddos_attack_l4_alert", "advanced_ddos_attack_l7_alert", @@ -566,15 +569,15 @@ async def create( enabled: bool, mechanisms: MechanismParam, name: str, - alert_interval: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - filters: PolicyFilterParam | NotGiven = NOT_GIVEN, + alert_interval: str | Omit = omit, + description: str | Omit = omit, + filters: PolicyFilterParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyCreateResponse]: """ Creates a new Notification policy. @@ -641,8 +644,9 @@ async def update( policy_id: str, *, account_id: str, - alert_interval: str | NotGiven = NOT_GIVEN, + alert_interval: str | Omit = omit, alert_type: Literal[ + "abuse_report_alert", "access_custom_certificate_expiration_type", "advanced_ddos_attack_l4_alert", "advanced_ddos_attack_l7_alert", @@ -711,18 +715,18 @@ async def update( "web_analytics_metrics_update", "zone_aop_custom_certificate_expiration_type", ] - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - filters: PolicyFilterParam | NotGiven = NOT_GIVEN, - mechanisms: MechanismParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + filters: PolicyFilterParam | Omit = omit, + mechanisms: MechanismParam | 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyUpdateResponse]: """ Update a Notification policy. @@ -797,7 +801,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Policy, AsyncSinglePage[Policy]]: """ Get a list of all Notification policies. @@ -834,7 +838,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PolicyDeleteResponse: """ Delete a Notification policy. @@ -874,7 +878,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Policy]: """ Get details for a single policy. diff --git a/src/cloudflare/resources/api_gateway/configurations.py b/src/cloudflare/resources/api_gateway/configurations.py index 7e9a062efaa..6d693fd0996 100644 --- a/src/cloudflare/resources/api_gateway/configurations.py +++ b/src/cloudflare/resources/api_gateway/configurations.py @@ -2,12 +2,11 @@ from __future__ import annotations -from typing import List, Type, Iterable, cast -from typing_extensions import Literal +from typing import Type, Iterable, cast import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -19,9 +18,8 @@ ) from ..._wrappers import ResultWrapper from ..._base_client import make_request_options -from ...types.api_gateway import configuration_get_params, configuration_update_params +from ...types.api_gateway import configuration_update_params from ...types.api_gateway.configuration import Configuration -from ...types.api_gateway.configuration_update_response import ConfigurationUpdateResponse __all__ = ["ConfigurationsResource", "AsyncConfigurationsResource"] @@ -56,10 +54,10 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationUpdateResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Configuration: """ - Set configuration properties + Update configuration properties Args: zone_id: Identifier. @@ -81,22 +79,25 @@ def update( configuration_update_params.ConfigurationUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=ConfigurationUpdateResponse, + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) def get( self, *, zone_id: str, - properties: List[Literal["auth_id_characteristics"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Retrieve information about specific configuration properties @@ -104,8 +105,6 @@ def get( Args: zone_id: Identifier. - properties: Requests information about certain properties. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -123,7 +122,6 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"properties": properties}, configuration_get_params.ConfigurationGetParams), post_parser=ResultWrapper[Configuration]._unwrapper, ), cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), @@ -160,10 +158,10 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigurationUpdateResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Configuration: """ - Set configuration properties + Update configuration properties Args: zone_id: Identifier. @@ -185,22 +183,25 @@ async def update( configuration_update_params.ConfigurationUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=ConfigurationUpdateResponse, + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) async def get( self, *, zone_id: str, - properties: List[Literal["auth_id_characteristics"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Retrieve information about specific configuration properties @@ -208,8 +209,6 @@ async def get( Args: zone_id: Identifier. - properties: Requests information about certain properties. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -227,9 +226,6 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( - {"properties": properties}, configuration_get_params.ConfigurationGetParams - ), post_parser=ResultWrapper[Configuration]._unwrapper, ), cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), diff --git a/src/cloudflare/resources/api_gateway/discovery/discovery.py b/src/cloudflare/resources/api_gateway/discovery/discovery.py index a55f40cb832..a465c6fc4a9 100644 --- a/src/cloudflare/resources/api_gateway/discovery/discovery.py +++ b/src/cloudflare/resources/api_gateway/discovery/discovery.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from .operations import ( OperationsResource, @@ -63,7 +63,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DiscoveryGetResponse: """ Retrieve the most up to date view of discovered operations, rendered as OpenAPI @@ -128,7 +128,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DiscoveryGetResponse: """ Retrieve the most up to date view of discovered operations, rendered as OpenAPI diff --git a/src/cloudflare/resources/api_gateway/discovery/operations.py b/src/cloudflare/resources/api_gateway/discovery/operations.py index db65d954216..76aeb31fde9 100644 --- a/src/cloudflare/resources/api_gateway/discovery/operations.py +++ b/src/cloudflare/resources/api_gateway/discovery/operations.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Dict, List, Type, cast +from typing import Dict, Type, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,23 +52,23 @@ def list( self, *, zone_id: str, - diff: bool | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - endpoint: str | NotGiven = NOT_GIVEN, - host: List[str] | NotGiven = NOT_GIVEN, - method: List[str] | NotGiven = NOT_GIVEN, + diff: bool | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + endpoint: str | Omit = omit, + host: SequenceNotStr[str] | Omit = omit, + method: SequenceNotStr[str] | Omit = omit, order: Literal["host", "method", "endpoint", "traffic_stats.requests", "traffic_stats.last_updated"] - | NotGiven = NOT_GIVEN, - origin: Literal["ML", "SessionIdentifier", "LabelDiscovery"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - state: Literal["review", "saved", "ignored"] | NotGiven = NOT_GIVEN, + | Omit = omit, + origin: Literal["ML", "SessionIdentifier", "LabelDiscovery"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + state: Literal["review", "saved", "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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[DiscoveryOperation]: """ Retrieve the most up to date view of discovered operations @@ -156,7 +156,7 @@ def bulk_edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationBulkEditResponse: """ Update the `state` on one or more discovered operations @@ -192,13 +192,13 @@ def edit( operation_id: str, *, zone_id: str, - state: Literal["review", "ignored"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationEditResponse: """ Update the `state` on a discovered operation @@ -263,23 +263,23 @@ def list( self, *, zone_id: str, - diff: bool | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - endpoint: str | NotGiven = NOT_GIVEN, - host: List[str] | NotGiven = NOT_GIVEN, - method: List[str] | NotGiven = NOT_GIVEN, + diff: bool | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + endpoint: str | Omit = omit, + host: SequenceNotStr[str] | Omit = omit, + method: SequenceNotStr[str] | Omit = omit, order: Literal["host", "method", "endpoint", "traffic_stats.requests", "traffic_stats.last_updated"] - | NotGiven = NOT_GIVEN, - origin: Literal["ML", "SessionIdentifier", "LabelDiscovery"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - state: Literal["review", "saved", "ignored"] | NotGiven = NOT_GIVEN, + | Omit = omit, + origin: Literal["ML", "SessionIdentifier", "LabelDiscovery"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + state: Literal["review", "saved", "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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DiscoveryOperation, AsyncV4PagePaginationArray[DiscoveryOperation]]: """ Retrieve the most up to date view of discovered operations @@ -367,7 +367,7 @@ async def bulk_edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationBulkEditResponse: """ Update the `state` on one or more discovered operations @@ -403,13 +403,13 @@ async def edit( operation_id: str, *, zone_id: str, - state: Literal["review", "ignored"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationEditResponse: """ Update the `state` on a discovered operation diff --git a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py index 828ebad4865..1434470cfad 100644 --- a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py +++ b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import Type, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -48,13 +48,13 @@ def create( self, *, zone_id: str, - hosts: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FallthroughCreateResponse: """ Generate fallthrough WAF expression template from a set of API hosts @@ -112,13 +112,13 @@ async def create( self, *, zone_id: str, - hosts: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FallthroughCreateResponse: """ Generate fallthrough WAF expression template from a set of API hosts diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py index 5e168e8238f..1a6038c3688 100644 --- a/src/cloudflare/resources/api_gateway/operations/operations.py +++ b/src/cloudflare/resources/api_gateway/operations/operations.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -80,7 +80,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationCreateResponse: """Add one operation to a zone. @@ -136,20 +136,20 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - endpoint: str | NotGiven = NOT_GIVEN, - feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | NotGiven = NOT_GIVEN, - host: List[str] | NotGiven = NOT_GIVEN, - method: List[str] | NotGiven = NOT_GIVEN, - order: Literal["method", "host", "endpoint", "thresholds.$key"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + endpoint: str | Omit = omit, + feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, + host: SequenceNotStr[str] | Omit = omit, + method: SequenceNotStr[str] | Omit = omit, + order: Literal["method", "host", "endpoint", "thresholds.$key"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[OperationListResponse]: """ Retrieve information about all operations on a zone @@ -221,7 +221,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationDeleteResponse: """ Delete an operation @@ -261,7 +261,7 @@ def bulk_create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[OperationBulkCreateResponse]: """Add one or more operations to a zone. @@ -304,7 +304,7 @@ def bulk_delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationBulkDeleteResponse: """ Delete multiple operations @@ -335,13 +335,13 @@ def get( operation_id: str, *, zone_id: str, - feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationGetResponse: """ Retrieve information about an operation @@ -417,7 +417,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationCreateResponse: """Add one operation to a zone. @@ -473,20 +473,20 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - endpoint: str | NotGiven = NOT_GIVEN, - feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | NotGiven = NOT_GIVEN, - host: List[str] | NotGiven = NOT_GIVEN, - method: List[str] | NotGiven = NOT_GIVEN, - order: Literal["method", "host", "endpoint", "thresholds.$key"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + endpoint: str | Omit = omit, + feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, + host: SequenceNotStr[str] | Omit = omit, + method: SequenceNotStr[str] | Omit = omit, + order: Literal["method", "host", "endpoint", "thresholds.$key"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OperationListResponse, AsyncV4PagePaginationArray[OperationListResponse]]: """ Retrieve information about all operations on a zone @@ -558,7 +558,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationDeleteResponse: """ Delete an operation @@ -598,7 +598,7 @@ def bulk_create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OperationBulkCreateResponse, AsyncSinglePage[OperationBulkCreateResponse]]: """Add one or more operations to a zone. @@ -641,7 +641,7 @@ async def bulk_delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationBulkDeleteResponse: """ Delete multiple operations @@ -672,13 +672,13 @@ async def get( operation_id: str, *, zone_id: str, - feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationGetResponse: """ Retrieve information about an operation diff --git a/src/cloudflare/resources/api_gateway/operations/schema_validation.py b/src/cloudflare/resources/api_gateway/operations/schema_validation.py index 39718458f87..5b526d920a8 100644 --- a/src/cloudflare/resources/api_gateway/operations/schema_validation.py +++ b/src/cloudflare/resources/api_gateway/operations/schema_validation.py @@ -2,12 +2,13 @@ from __future__ import annotations +import typing_extensions from typing import Type, Optional, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,18 +53,21 @@ def with_streaming_response(self) -> SchemaValidationResourceWithStreamingRespon """ return SchemaValidationResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def update( self, operation_id: str, *, zone_id: str, - mitigation_action: Optional[Literal["log", "block", "none"]] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaValidationUpdateResponse: """ Updates operation-level schema validation settings on the zone @@ -105,6 +109,9 @@ def update( cast_to=SchemaValidationUpdateResponse, ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def edit( self, *, @@ -115,7 +122,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingsMultipleRequest: """ Updates multiple operation-level schema validation settings on the zone @@ -146,6 +153,9 @@ def edit( cast_to=cast(Type[SettingsMultipleRequest], ResultWrapper[SettingsMultipleRequest]), ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def get( self, operation_id: str, @@ -156,7 +166,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaValidationGetResponse: """ Retrieves operation-level schema validation settings on the zone @@ -207,18 +217,21 @@ def with_streaming_response(self) -> AsyncSchemaValidationResourceWithStreamingR """ return AsyncSchemaValidationResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) async def update( self, operation_id: str, *, zone_id: str, - mitigation_action: Optional[Literal["log", "block", "none"]] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaValidationUpdateResponse: """ Updates operation-level schema validation settings on the zone @@ -260,6 +273,9 @@ async def update( cast_to=SchemaValidationUpdateResponse, ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) async def edit( self, *, @@ -270,7 +286,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingsMultipleRequest: """ Updates multiple operation-level schema validation settings on the zone @@ -303,6 +319,9 @@ async def edit( cast_to=cast(Type[SettingsMultipleRequest], ResultWrapper[SettingsMultipleRequest]), ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) async def get( self, operation_id: str, @@ -313,7 +332,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaValidationGetResponse: """ Retrieves operation-level schema validation settings on the zone @@ -348,14 +367,20 @@ class SchemaValidationResourceWithRawResponse: def __init__(self, schema_validation: SchemaValidationResource) -> None: self._schema_validation = schema_validation - self.update = to_raw_response_wrapper( - schema_validation.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + schema_validation.update, # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_raw_response_wrapper( - schema_validation.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + schema_validation.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - schema_validation.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + schema_validation.get, # pyright: ignore[reportDeprecated], + ) ) @@ -363,14 +388,20 @@ class AsyncSchemaValidationResourceWithRawResponse: def __init__(self, schema_validation: AsyncSchemaValidationResource) -> None: self._schema_validation = schema_validation - self.update = async_to_raw_response_wrapper( - schema_validation.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + schema_validation.update, # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_raw_response_wrapper( - schema_validation.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + schema_validation.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - schema_validation.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + schema_validation.get, # pyright: ignore[reportDeprecated], + ) ) @@ -378,14 +409,20 @@ class SchemaValidationResourceWithStreamingResponse: def __init__(self, schema_validation: SchemaValidationResource) -> None: self._schema_validation = schema_validation - self.update = to_streamed_response_wrapper( - schema_validation.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + schema_validation.update, # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_streamed_response_wrapper( - schema_validation.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + schema_validation.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - schema_validation.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + schema_validation.get, # pyright: ignore[reportDeprecated], + ) ) @@ -393,12 +430,18 @@ class AsyncSchemaValidationResourceWithStreamingResponse: def __init__(self, schema_validation: AsyncSchemaValidationResource) -> None: self._schema_validation = schema_validation - self.update = async_to_streamed_response_wrapper( - schema_validation.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + schema_validation.update, # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_streamed_response_wrapper( - schema_validation.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + schema_validation.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - schema_validation.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + schema_validation.get, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/api_gateway/schemas.py b/src/cloudflare/resources/api_gateway/schemas.py index 61db8233e2d..2559e6e21c2 100644 --- a/src/cloudflare/resources/api_gateway/schemas.py +++ b/src/cloudflare/resources/api_gateway/schemas.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,14 +49,14 @@ def list( self, *, zone_id: str, - feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | NotGiven = NOT_GIVEN, - host: List[str] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaListResponse: """ Retrieve operations and features as OpenAPI schemas @@ -124,14 +124,14 @@ async def list( self, *, zone_id: str, - feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | NotGiven = NOT_GIVEN, - host: List[str] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaListResponse: """ Retrieve operations and features as OpenAPI schemas diff --git a/src/cloudflare/resources/api_gateway/settings/schema_validation.py b/src/cloudflare/resources/api_gateway/settings/schema_validation.py index 37610d80629..edc6f969c00 100644 --- a/src/cloudflare/resources/api_gateway/settings/schema_validation.py +++ b/src/cloudflare/resources/api_gateway/settings/schema_validation.py @@ -2,12 +2,13 @@ from __future__ import annotations +import typing_extensions from typing import Optional from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -44,18 +45,21 @@ def with_streaming_response(self) -> SchemaValidationResourceWithStreamingRespon """ return SchemaValidationResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def update( self, *, zone_id: str, validation_default_mitigation_action: Literal["none", "log", "block"], - validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Settings: """ Updates zone level schema validation settings on the zone @@ -106,18 +110,21 @@ def update( cast_to=Settings, ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def edit( self, *, zone_id: str, - validation_default_mitigation_action: Optional[Literal["none", "log", "block"]] | NotGiven = NOT_GIVEN, - validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Settings: """ Updates zone level schema validation settings on the zone @@ -169,6 +176,9 @@ def edit( cast_to=Settings, ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def get( self, *, @@ -178,7 +188,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Settings: """ Retrieves zone level schema validation settings currently set on the zone @@ -225,18 +235,21 @@ def with_streaming_response(self) -> AsyncSchemaValidationResourceWithStreamingR """ return AsyncSchemaValidationResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) async def update( self, *, zone_id: str, validation_default_mitigation_action: Literal["none", "log", "block"], - validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Settings: """ Updates zone level schema validation settings on the zone @@ -287,18 +300,21 @@ async def update( cast_to=Settings, ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) async def edit( self, *, zone_id: str, - validation_default_mitigation_action: Optional[Literal["none", "log", "block"]] | NotGiven = NOT_GIVEN, - validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Settings: """ Updates zone level schema validation settings on the zone @@ -350,6 +366,9 @@ async def edit( cast_to=Settings, ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) async def get( self, *, @@ -359,7 +378,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Settings: """ Retrieves zone level schema validation settings currently set on the zone @@ -390,14 +409,20 @@ class SchemaValidationResourceWithRawResponse: def __init__(self, schema_validation: SchemaValidationResource) -> None: self._schema_validation = schema_validation - self.update = to_raw_response_wrapper( - schema_validation.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + schema_validation.update, # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_raw_response_wrapper( - schema_validation.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + schema_validation.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - schema_validation.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + schema_validation.get, # pyright: ignore[reportDeprecated], + ) ) @@ -405,14 +430,20 @@ class AsyncSchemaValidationResourceWithRawResponse: def __init__(self, schema_validation: AsyncSchemaValidationResource) -> None: self._schema_validation = schema_validation - self.update = async_to_raw_response_wrapper( - schema_validation.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + schema_validation.update, # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_raw_response_wrapper( - schema_validation.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + schema_validation.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - schema_validation.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + schema_validation.get, # pyright: ignore[reportDeprecated], + ) ) @@ -420,14 +451,20 @@ class SchemaValidationResourceWithStreamingResponse: def __init__(self, schema_validation: SchemaValidationResource) -> None: self._schema_validation = schema_validation - self.update = to_streamed_response_wrapper( - schema_validation.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + schema_validation.update, # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_streamed_response_wrapper( - schema_validation.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + schema_validation.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - schema_validation.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + schema_validation.get, # pyright: ignore[reportDeprecated], + ) ) @@ -435,12 +472,18 @@ class AsyncSchemaValidationResourceWithStreamingResponse: def __init__(self, schema_validation: AsyncSchemaValidationResource) -> None: self._schema_validation = schema_validation - self.update = async_to_streamed_response_wrapper( - schema_validation.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + schema_validation.update, # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_streamed_response_wrapper( - schema_validation.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + schema_validation.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - schema_validation.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + schema_validation.get, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py index eba45a77d93..01861b64473 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py @@ -2,9 +2,11 @@ from __future__ import annotations +import typing_extensions + import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -42,18 +44,21 @@ def with_streaming_response(self) -> HostsResourceWithStreamingResponse: """ return HostsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def list( self, *, zone_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[HostListResponse]: """ Retrieve schema hosts in a zone @@ -115,18 +120,21 @@ def with_streaming_response(self) -> AsyncHostsResourceWithStreamingResponse: """ return AsyncHostsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def list( self, *, zone_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[HostListResponse, AsyncV4PagePaginationArray[HostListResponse]]: """ Retrieve schema hosts in a zone @@ -172,8 +180,10 @@ class HostsResourceWithRawResponse: def __init__(self, hosts: HostsResource) -> None: self._hosts = hosts - self.list = to_raw_response_wrapper( - hosts.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + hosts.list, # pyright: ignore[reportDeprecated], + ) ) @@ -181,8 +191,10 @@ class AsyncHostsResourceWithRawResponse: def __init__(self, hosts: AsyncHostsResource) -> None: self._hosts = hosts - self.list = async_to_raw_response_wrapper( - hosts.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + hosts.list, # pyright: ignore[reportDeprecated], + ) ) @@ -190,8 +202,10 @@ class HostsResourceWithStreamingResponse: def __init__(self, hosts: HostsResource) -> None: self._hosts = hosts - self.list = to_streamed_response_wrapper( - hosts.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + hosts.list, # pyright: ignore[reportDeprecated], + ) ) @@ -199,6 +213,8 @@ class AsyncHostsResourceWithStreamingResponse: def __init__(self, hosts: AsyncHostsResource) -> None: self._hosts = hosts - self.list = async_to_streamed_response_wrapper( - hosts.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + hosts.list, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/api_gateway/user_schemas/operations.py b/src/cloudflare/resources/api_gateway/user_schemas/operations.py index a75cd28dbfb..d5a04f5f875 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/operations.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/operations.py @@ -2,12 +2,13 @@ from __future__ import annotations +import typing_extensions from typing import Any, List, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -45,24 +46,27 @@ def with_streaming_response(self) -> OperationsResourceWithStreamingResponse: """ return OperationsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def list( self, schema_id: str, *, zone_id: str, - endpoint: str | NotGiven = NOT_GIVEN, - feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | NotGiven = NOT_GIVEN, - host: List[str] | NotGiven = NOT_GIVEN, - method: List[str] | NotGiven = NOT_GIVEN, - operation_status: Literal["new", "existing"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + endpoint: str | Omit = omit, + feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, + host: SequenceNotStr[str] | Omit = omit, + method: SequenceNotStr[str] | Omit = omit, + operation_status: Literal["new", "existing"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[OperationListResponse]: """Retrieves all operations from the schema. @@ -148,24 +152,27 @@ def with_streaming_response(self) -> AsyncOperationsResourceWithStreamingRespons """ return AsyncOperationsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def list( self, schema_id: str, *, zone_id: str, - endpoint: str | NotGiven = NOT_GIVEN, - feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | NotGiven = NOT_GIVEN, - host: List[str] | NotGiven = NOT_GIVEN, - method: List[str] | NotGiven = NOT_GIVEN, - operation_status: Literal["new", "existing"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + endpoint: str | Omit = omit, + feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, + host: SequenceNotStr[str] | Omit = omit, + method: SequenceNotStr[str] | Omit = omit, + operation_status: Literal["new", "existing"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OperationListResponse, AsyncV4PagePaginationArray[OperationListResponse]]: """Retrieves all operations from the schema. @@ -235,8 +242,10 @@ class OperationsResourceWithRawResponse: def __init__(self, operations: OperationsResource) -> None: self._operations = operations - self.list = to_raw_response_wrapper( - operations.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + operations.list, # pyright: ignore[reportDeprecated], + ) ) @@ -244,8 +253,10 @@ class AsyncOperationsResourceWithRawResponse: def __init__(self, operations: AsyncOperationsResource) -> None: self._operations = operations - self.list = async_to_raw_response_wrapper( - operations.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + operations.list, # pyright: ignore[reportDeprecated], + ) ) @@ -253,8 +264,10 @@ class OperationsResourceWithStreamingResponse: def __init__(self, operations: OperationsResource) -> None: self._operations = operations - self.list = to_streamed_response_wrapper( - operations.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + operations.list, # pyright: ignore[reportDeprecated], + ) ) @@ -262,6 +275,8 @@ class AsyncOperationsResourceWithStreamingResponse: def __init__(self, operations: AsyncOperationsResource) -> None: self._operations = operations - self.list = async_to_streamed_response_wrapper( - operations.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + operations.list, # pyright: ignore[reportDeprecated], + ) ) 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 3c2921267ff..6b7e365670d 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Type, Mapping, cast from typing_extensions import Literal @@ -15,7 +16,7 @@ HostsResourceWithStreamingResponse, AsyncHostsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from ...._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given from ...._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from ...._compat import cached_property from .operations import ( @@ -77,20 +78,23 @@ def with_streaming_response(self) -> UserSchemasResourceWithStreamingResponse: """ return UserSchemasResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def create( self, *, zone_id: str, file: FileTypes, kind: Literal["openapi_v3"], - name: str | NotGiven = NOT_GIVEN, - validation_enabled: Literal["true", "false"] | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + validation_enabled: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaUpload: """ Upload a schema to a zone @@ -143,20 +147,23 @@ def create( cast_to=cast(Type[SchemaUpload], ResultWrapper[SchemaUpload]), ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def list( self, *, zone_id: str, - omit_source: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - validation_enabled: bool | NotGiven = NOT_GIVEN, + omit_source: bool | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[PublicSchema]: """ Retrieve information about all schemas on a zone @@ -203,6 +210,9 @@ def list( model=PublicSchema, ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def delete( self, schema_id: str, @@ -213,7 +223,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UserSchemaDeleteResponse: """ Delete a schema @@ -241,18 +251,21 @@ def delete( cast_to=UserSchemaDeleteResponse, ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def edit( self, schema_id: str, *, zone_id: str, - validation_enabled: Literal[True] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PublicSchema: """ Enable validation for a schema @@ -289,18 +302,21 @@ def edit( cast_to=cast(Type[PublicSchema], ResultWrapper[PublicSchema]), ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def get( self, schema_id: str, *, zone_id: str, - omit_source: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PublicSchema: """ Retrieve information about a specific schema on a zone @@ -364,20 +380,23 @@ def with_streaming_response(self) -> AsyncUserSchemasResourceWithStreamingRespon """ return AsyncUserSchemasResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) async def create( self, *, zone_id: str, file: FileTypes, kind: Literal["openapi_v3"], - name: str | NotGiven = NOT_GIVEN, - validation_enabled: Literal["true", "false"] | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + validation_enabled: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaUpload: """ Upload a schema to a zone @@ -430,20 +449,23 @@ async def create( cast_to=cast(Type[SchemaUpload], ResultWrapper[SchemaUpload]), ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) def list( self, *, zone_id: str, - omit_source: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - validation_enabled: bool | NotGiven = NOT_GIVEN, + omit_source: bool | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PublicSchema, AsyncV4PagePaginationArray[PublicSchema]]: """ Retrieve information about all schemas on a zone @@ -490,6 +512,9 @@ def list( model=PublicSchema, ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) async def delete( self, schema_id: str, @@ -500,7 +525,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UserSchemaDeleteResponse: """ Delete a schema @@ -528,18 +553,21 @@ async def delete( cast_to=UserSchemaDeleteResponse, ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) async def edit( self, schema_id: str, *, zone_id: str, - validation_enabled: Literal[True] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PublicSchema: """ Enable validation for a schema @@ -576,18 +604,21 @@ async def edit( cast_to=cast(Type[PublicSchema], ResultWrapper[PublicSchema]), ) + @typing_extensions.deprecated( + "Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead." + ) async def get( self, schema_id: str, *, zone_id: str, - omit_source: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PublicSchema: """ Retrieve information about a specific schema on a zone @@ -629,20 +660,30 @@ class UserSchemasResourceWithRawResponse: def __init__(self, user_schemas: UserSchemasResource) -> None: self._user_schemas = user_schemas - self.create = to_raw_response_wrapper( - user_schemas.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + user_schemas.create, # pyright: ignore[reportDeprecated], + ) ) - self.list = to_raw_response_wrapper( - user_schemas.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + user_schemas.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_raw_response_wrapper( - user_schemas.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + user_schemas.delete, # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_raw_response_wrapper( - user_schemas.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + user_schemas.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - user_schemas.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + user_schemas.get, # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -658,20 +699,30 @@ class AsyncUserSchemasResourceWithRawResponse: def __init__(self, user_schemas: AsyncUserSchemasResource) -> None: self._user_schemas = user_schemas - self.create = async_to_raw_response_wrapper( - user_schemas.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + user_schemas.create, # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_raw_response_wrapper( - user_schemas.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + user_schemas.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_raw_response_wrapper( - user_schemas.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + user_schemas.delete, # pyright: ignore[reportDeprecated], + ) ) - self.edit = async_to_raw_response_wrapper( - user_schemas.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + user_schemas.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - user_schemas.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + user_schemas.get, # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -687,20 +738,30 @@ class UserSchemasResourceWithStreamingResponse: def __init__(self, user_schemas: UserSchemasResource) -> None: self._user_schemas = user_schemas - self.create = to_streamed_response_wrapper( - user_schemas.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + user_schemas.create, # pyright: ignore[reportDeprecated], + ) ) - self.list = to_streamed_response_wrapper( - user_schemas.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + user_schemas.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_streamed_response_wrapper( - user_schemas.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + user_schemas.delete, # pyright: ignore[reportDeprecated], + ) ) - self.edit = to_streamed_response_wrapper( - user_schemas.edit, + self.edit = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + user_schemas.edit, # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - user_schemas.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + user_schemas.get, # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -716,20 +777,30 @@ class AsyncUserSchemasResourceWithStreamingResponse: def __init__(self, user_schemas: AsyncUserSchemasResource) -> None: self._user_schemas = user_schemas - self.create = async_to_streamed_response_wrapper( - user_schemas.create, - ) - self.list = async_to_streamed_response_wrapper( - user_schemas.list, - ) - self.delete = async_to_streamed_response_wrapper( - user_schemas.delete, - ) - self.edit = async_to_streamed_response_wrapper( - user_schemas.edit, - ) - self.get = async_to_streamed_response_wrapper( - user_schemas.get, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + user_schemas.create, # pyright: ignore[reportDeprecated], + ) + ) + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + user_schemas.list, # pyright: ignore[reportDeprecated], + ) + ) + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + user_schemas.delete, # pyright: ignore[reportDeprecated], + ) + ) + self.edit = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + user_schemas.edit, # pyright: ignore[reportDeprecated], + ) + ) + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + user_schemas.get, # pyright: ignore[reportDeprecated], + ) ) @cached_property diff --git a/src/cloudflare/resources/argo/smart_routing.py b/src/cloudflare/resources/argo/smart_routing.py index 28c30e54c30..d45d9be9c4d 100644 --- a/src/cloudflare/resources/argo/smart_routing.py +++ b/src/cloudflare/resources/argo/smart_routing.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Any, cast +from typing import Type, cast from typing_extensions import Literal import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,15 +56,15 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SmartRoutingEditResponse: """ - Updates enablement of Argo Smart Routing. + Configures the value of the Argo Smart Routing enablement setting. Args: - zone_id: Identifier + zone_id: Specifies the zone associated with the API call. - value: Enables Argo Smart Routing. + value: Specifies the enablement value of Argo Smart Routing. extra_headers: Send extra headers @@ -76,22 +76,17 @@ def edit( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - SmartRoutingEditResponse, - self._patch( - f"/zones/{zone_id}/argo/smart_routing", - body=maybe_transform({"value": value}, smart_routing_edit_params.SmartRoutingEditParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[SmartRoutingEditResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SmartRoutingEditResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._patch( + f"/zones/{zone_id}/argo/smart_routing", + body=maybe_transform({"value": value}, smart_routing_edit_params.SmartRoutingEditParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[SmartRoutingEditResponse]._unwrapper, ), + cast_to=cast(Type[SmartRoutingEditResponse], ResultWrapper[SmartRoutingEditResponse]), ) def get( @@ -103,13 +98,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SmartRoutingGetResponse: """ - Get Argo Smart Routing setting + Retrieves the value of Argo Smart Routing enablement setting. Args: - zone_id: Identifier + zone_id: Specifies the zone associated with the API call. extra_headers: Send extra headers @@ -121,21 +116,16 @@ def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - SmartRoutingGetResponse, - self._get( - f"/zones/{zone_id}/argo/smart_routing", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[SmartRoutingGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SmartRoutingGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get( + f"/zones/{zone_id}/argo/smart_routing", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[SmartRoutingGetResponse]._unwrapper, ), + cast_to=cast(Type[SmartRoutingGetResponse], ResultWrapper[SmartRoutingGetResponse]), ) @@ -169,15 +159,15 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SmartRoutingEditResponse: """ - Updates enablement of Argo Smart Routing. + Configures the value of the Argo Smart Routing enablement setting. Args: - zone_id: Identifier + zone_id: Specifies the zone associated with the API call. - value: Enables Argo Smart Routing. + value: Specifies the enablement value of Argo Smart Routing. extra_headers: Send extra headers @@ -189,22 +179,17 @@ async def edit( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - SmartRoutingEditResponse, - await self._patch( - f"/zones/{zone_id}/argo/smart_routing", - body=await async_maybe_transform({"value": value}, smart_routing_edit_params.SmartRoutingEditParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[SmartRoutingEditResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SmartRoutingEditResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._patch( + f"/zones/{zone_id}/argo/smart_routing", + body=await async_maybe_transform({"value": value}, smart_routing_edit_params.SmartRoutingEditParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[SmartRoutingEditResponse]._unwrapper, ), + cast_to=cast(Type[SmartRoutingEditResponse], ResultWrapper[SmartRoutingEditResponse]), ) async def get( @@ -216,13 +201,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SmartRoutingGetResponse: """ - Get Argo Smart Routing setting + Retrieves the value of Argo Smart Routing enablement setting. Args: - zone_id: Identifier + zone_id: Specifies the zone associated with the API call. extra_headers: Send extra headers @@ -234,21 +219,16 @@ async def get( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - SmartRoutingGetResponse, - await self._get( - f"/zones/{zone_id}/argo/smart_routing", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[SmartRoutingGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[SmartRoutingGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._get( + f"/zones/{zone_id}/argo/smart_routing", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[SmartRoutingGetResponse]._unwrapper, ), + cast_to=cast(Type[SmartRoutingGetResponse], ResultWrapper[SmartRoutingGetResponse]), ) diff --git a/src/cloudflare/resources/argo/tiered_caching.py b/src/cloudflare/resources/argo/tiered_caching.py index 5d512f70a6a..9662940b73c 100644 --- a/src/cloudflare/resources/argo/tiered_caching.py +++ b/src/cloudflare/resources/argo/tiered_caching.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TieredCachingEditResponse]: """ Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of @@ -72,7 +72,7 @@ def edit( resources. Args: - zone_id: Identifier + zone_id: Identifier. value: Enables Tiered Caching. @@ -108,7 +108,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TieredCachingGetResponse]: """ Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of @@ -124,7 +124,7 @@ def get( resources. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -179,7 +179,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TieredCachingEditResponse]: """ Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of @@ -195,7 +195,7 @@ async def edit( resources. Args: - zone_id: Identifier + zone_id: Identifier. value: Enables Tiered Caching. @@ -231,7 +231,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TieredCachingGetResponse]: """ Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of @@ -247,7 +247,7 @@ async def get( resources. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/audit_logs.py b/src/cloudflare/resources/audit_logs.py index bcb31f75e13..1a682f5ac0e 100644 --- a/src/cloudflare/resources/audit_logs.py +++ b/src/cloudflare/resources/audit_logs.py @@ -8,7 +8,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,23 +50,23 @@ def list( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - action: audit_log_list_params.Action | NotGiven = NOT_GIVEN, - actor: audit_log_list_params.Actor | NotGiven = NOT_GIVEN, - before: Union[Union[str, date], Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - export: bool | NotGiven = NOT_GIVEN, - hide_user_logs: bool | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - since: Union[Union[str, date], Union[str, datetime]] | NotGiven = NOT_GIVEN, - zone: audit_log_list_params.Zone | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[AuditLog]: """Gets a list of audit logs for an account. @@ -157,23 +157,23 @@ def list( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - action: audit_log_list_params.Action | NotGiven = NOT_GIVEN, - actor: audit_log_list_params.Actor | NotGiven = NOT_GIVEN, - before: Union[Union[str, date], Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - export: bool | NotGiven = NOT_GIVEN, - hide_user_logs: bool | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - since: Union[Union[str, date], Union[str, datetime]] | NotGiven = NOT_GIVEN, - zone: audit_log_list_params.Zone | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AuditLog, AsyncV4PagePaginationArray[AuditLog]]: """Gets a list of audit logs for an account. diff --git a/src/cloudflare/resources/billing/profiles.py b/src/cloudflare/resources/billing/profiles.py index 16e7235a279..f3272600105 100644 --- a/src/cloudflare/resources/billing/profiles.py +++ b/src/cloudflare/resources/billing/profiles.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -53,7 +53,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProfileGetResponse: """ Gets the current billing profile for the account. @@ -114,7 +114,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProfileGetResponse: """ Gets the current billing profile for the account. @@ -151,7 +151,7 @@ def __init__(self, profiles: ProfilesResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - profiles.get # pyright: ignore[reportDeprecated], + profiles.get, # pyright: ignore[reportDeprecated], ) ) @@ -162,7 +162,7 @@ def __init__(self, profiles: AsyncProfilesResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - profiles.get # pyright: ignore[reportDeprecated], + profiles.get, # pyright: ignore[reportDeprecated], ) ) @@ -173,7 +173,7 @@ def __init__(self, profiles: ProfilesResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - profiles.get # pyright: ignore[reportDeprecated], + profiles.get, # pyright: ignore[reportDeprecated], ) ) @@ -184,6 +184,6 @@ def __init__(self, profiles: AsyncProfilesResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - profiles.get # pyright: ignore[reportDeprecated], + profiles.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/bot_management.py b/src/cloudflare/resources/bot_management.py index f3a541ea1f7..07b76763411 100644 --- a/src/cloudflare/resources/bot_management.py +++ b/src/cloudflare/resources/bot_management.py @@ -7,7 +7,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,16 +51,18 @@ def update( self, *, zone_id: str, - ai_bots_protection: Literal["block", "disabled"] | NotGiven = NOT_GIVEN, - crawler_protection: Literal["enabled", "disabled"] | NotGiven = NOT_GIVEN, - enable_js: bool | NotGiven = NOT_GIVEN, - fight_mode: bool | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementUpdateResponse]: """ Updates the Bot Management configuration for a zone. @@ -128,7 +130,10 @@ def update( Args: zone_id: Identifier. - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. + 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. @@ -137,6 +142,9 @@ def update( 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 @@ -152,19 +160,21 @@ def update( self, *, zone_id: str, - ai_bots_protection: Literal["block", "disabled"] | NotGiven = NOT_GIVEN, - crawler_protection: Literal["enabled", "disabled"] | NotGiven = NOT_GIVEN, - enable_js: bool | NotGiven = NOT_GIVEN, - optimize_wordpress: bool | NotGiven = NOT_GIVEN, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, - sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementUpdateResponse]: """ Updates the Bot Management configuration for a zone. @@ -232,13 +242,19 @@ def update( Args: zone_id: Identifier. - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. + 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. @@ -264,20 +280,22 @@ def update( self, *, zone_id: str, - ai_bots_protection: Literal["block", "disabled"] | NotGiven = NOT_GIVEN, - crawler_protection: Literal["enabled", "disabled"] | NotGiven = NOT_GIVEN, - enable_js: bool | NotGiven = NOT_GIVEN, - optimize_wordpress: bool | NotGiven = NOT_GIVEN, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, - sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementUpdateResponse]: """ Updates the Bot Management configuration for a zone. @@ -345,13 +363,19 @@ def update( Args: zone_id: Identifier. - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. + 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. @@ -379,17 +403,20 @@ def update( self, *, zone_id: str, - ai_bots_protection: Literal["block", "disabled"] | NotGiven = NOT_GIVEN, - auto_update_model: bool | NotGiven = NOT_GIVEN, - crawler_protection: Literal["enabled", "disabled"] | NotGiven = NOT_GIVEN, - enable_js: bool | NotGiven = NOT_GIVEN, - suppress_session_score: bool | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementUpdateResponse]: """ Updates the Bot Management configuration for a zone. @@ -457,17 +484,26 @@ def update( Args: zone_id: Identifier. - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. + 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. @@ -486,23 +522,26 @@ def update( self, *, zone_id: str, - ai_bots_protection: Literal["block", "disabled"] | NotGiven = NOT_GIVEN, - crawler_protection: Literal["enabled", "disabled"] | NotGiven = NOT_GIVEN, - enable_js: bool | NotGiven = NOT_GIVEN, - fight_mode: bool | NotGiven = NOT_GIVEN, - optimize_wordpress: bool | NotGiven = NOT_GIVEN, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, - sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, - sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - auto_update_model: bool | NotGiven = NOT_GIVEN, - suppress_session_score: bool | NotGiven = NOT_GIVEN, + 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, + 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}") @@ -513,15 +552,18 @@ def update( 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, @@ -548,7 +590,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementGetResponse]: """ Retrieve a zone's Bot Management Config @@ -609,16 +651,18 @@ async def update( self, *, zone_id: str, - ai_bots_protection: Literal["block", "disabled"] | NotGiven = NOT_GIVEN, - crawler_protection: Literal["enabled", "disabled"] | NotGiven = NOT_GIVEN, - enable_js: bool | NotGiven = NOT_GIVEN, - fight_mode: bool | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementUpdateResponse]: """ Updates the Bot Management configuration for a zone. @@ -686,7 +730,10 @@ async def update( Args: zone_id: Identifier. - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. + 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. @@ -695,6 +742,9 @@ async def update( 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 @@ -710,19 +760,21 @@ async def update( self, *, zone_id: str, - ai_bots_protection: Literal["block", "disabled"] | NotGiven = NOT_GIVEN, - crawler_protection: Literal["enabled", "disabled"] | NotGiven = NOT_GIVEN, - enable_js: bool | NotGiven = NOT_GIVEN, - optimize_wordpress: bool | NotGiven = NOT_GIVEN, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, - sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementUpdateResponse]: """ Updates the Bot Management configuration for a zone. @@ -790,13 +842,19 @@ async def update( Args: zone_id: Identifier. - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. + 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. @@ -822,20 +880,22 @@ async def update( self, *, zone_id: str, - ai_bots_protection: Literal["block", "disabled"] | NotGiven = NOT_GIVEN, - crawler_protection: Literal["enabled", "disabled"] | NotGiven = NOT_GIVEN, - enable_js: bool | NotGiven = NOT_GIVEN, - optimize_wordpress: bool | NotGiven = NOT_GIVEN, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, - sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementUpdateResponse]: """ Updates the Bot Management configuration for a zone. @@ -903,13 +963,19 @@ async def update( Args: zone_id: Identifier. - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. + 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. @@ -937,17 +1003,20 @@ async def update( self, *, zone_id: str, - ai_bots_protection: Literal["block", "disabled"] | NotGiven = NOT_GIVEN, - auto_update_model: bool | NotGiven = NOT_GIVEN, - crawler_protection: Literal["enabled", "disabled"] | NotGiven = NOT_GIVEN, - enable_js: bool | NotGiven = NOT_GIVEN, - suppress_session_score: bool | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementUpdateResponse]: """ Updates the Bot Management configuration for a zone. @@ -1015,17 +1084,26 @@ async def update( Args: zone_id: Identifier. - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. + 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. @@ -1044,23 +1122,26 @@ async def update( self, *, zone_id: str, - ai_bots_protection: Literal["block", "disabled"] | NotGiven = NOT_GIVEN, - crawler_protection: Literal["enabled", "disabled"] | NotGiven = NOT_GIVEN, - enable_js: bool | NotGiven = NOT_GIVEN, - fight_mode: bool | NotGiven = NOT_GIVEN, - optimize_wordpress: bool | NotGiven = NOT_GIVEN, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, - sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, - sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - auto_update_model: bool | NotGiven = NOT_GIVEN, - suppress_session_score: bool | NotGiven = NOT_GIVEN, + 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, + 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}") @@ -1071,15 +1152,18 @@ async def update( 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, @@ -1106,7 +1190,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementGetResponse]: """ Retrieve a zone's Bot Management Config diff --git a/src/cloudflare/resources/botnet_feed/asn.py b/src/cloudflare/resources/botnet_feed/asn.py index 5fd0185a673..285845ee622 100755 --- a/src/cloudflare/resources/botnet_feed/asn.py +++ b/src/cloudflare/resources/botnet_feed/asn.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,13 +51,13 @@ def day_report( asn_id: int, *, account_id: str, - date: Union[str, datetime] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ASNDayReportResponse]: """ Gets all the data the botnet tracking database has for a given ASN registered to @@ -100,7 +100,7 @@ def full_report( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ASNFullReportResponse]: """ Gets all the data the botnet threat feed tracking database has for a given ASN @@ -157,13 +157,13 @@ async def day_report( asn_id: int, *, account_id: str, - date: Union[str, datetime] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ASNDayReportResponse]: """ Gets all the data the botnet tracking database has for a given ASN registered to @@ -206,7 +206,7 @@ async def full_report( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ASNFullReportResponse]: """ Gets all the data the botnet threat feed tracking database has for a given ASN diff --git a/src/cloudflare/resources/botnet_feed/configs/asn.py b/src/cloudflare/resources/botnet_feed/configs/asn.py index db2b4a80978..e8cf0754eb4 100755 --- a/src/cloudflare/resources/botnet_feed/configs/asn.py +++ b/src/cloudflare/resources/botnet_feed/configs/asn.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -53,7 +53,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ASNDeleteResponse]: """ Delete an ASN from botnet threat feed for a given user. @@ -92,7 +92,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ASNGetResponse]: """ Gets a list of all ASNs registered for a user for the DDoS Botnet Feed API. @@ -153,7 +153,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ASNDeleteResponse]: """ Delete an ASN from botnet threat feed for a given user. @@ -192,7 +192,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ASNGetResponse]: """ Gets a list of all ASNs registered for a user for the DDoS Botnet Feed API. diff --git a/src/cloudflare/resources/brand_protection/__init__.py b/src/cloudflare/resources/brand_protection/__init__.py new file mode 100644 index 00000000000..1660f110c9b --- /dev/null +++ b/src/cloudflare/resources/brand_protection/__init__.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .logos import ( + LogosResource, + AsyncLogosResource, + LogosResourceWithRawResponse, + AsyncLogosResourceWithRawResponse, + LogosResourceWithStreamingResponse, + AsyncLogosResourceWithStreamingResponse, +) +from .matches import ( + MatchesResource, + AsyncMatchesResource, + MatchesResourceWithRawResponse, + AsyncMatchesResourceWithRawResponse, + MatchesResourceWithStreamingResponse, + AsyncMatchesResourceWithStreamingResponse, +) +from .queries import ( + QueriesResource, + AsyncQueriesResource, + QueriesResourceWithRawResponse, + AsyncQueriesResourceWithRawResponse, + QueriesResourceWithStreamingResponse, + AsyncQueriesResourceWithStreamingResponse, +) +from .logo_matches import ( + LogoMatchesResource, + AsyncLogoMatchesResource, + LogoMatchesResourceWithRawResponse, + AsyncLogoMatchesResourceWithRawResponse, + LogoMatchesResourceWithStreamingResponse, + AsyncLogoMatchesResourceWithStreamingResponse, +) +from .brand_protection import ( + BrandProtectionResource, + AsyncBrandProtectionResource, + BrandProtectionResourceWithRawResponse, + AsyncBrandProtectionResourceWithRawResponse, + BrandProtectionResourceWithStreamingResponse, + AsyncBrandProtectionResourceWithStreamingResponse, +) + +__all__ = [ + "QueriesResource", + "AsyncQueriesResource", + "QueriesResourceWithRawResponse", + "AsyncQueriesResourceWithRawResponse", + "QueriesResourceWithStreamingResponse", + "AsyncQueriesResourceWithStreamingResponse", + "MatchesResource", + "AsyncMatchesResource", + "MatchesResourceWithRawResponse", + "AsyncMatchesResourceWithRawResponse", + "MatchesResourceWithStreamingResponse", + "AsyncMatchesResourceWithStreamingResponse", + "LogosResource", + "AsyncLogosResource", + "LogosResourceWithRawResponse", + "AsyncLogosResourceWithRawResponse", + "LogosResourceWithStreamingResponse", + "AsyncLogosResourceWithStreamingResponse", + "LogoMatchesResource", + "AsyncLogoMatchesResource", + "LogoMatchesResourceWithRawResponse", + "AsyncLogoMatchesResourceWithRawResponse", + "LogoMatchesResourceWithStreamingResponse", + "AsyncLogoMatchesResourceWithStreamingResponse", + "BrandProtectionResource", + "AsyncBrandProtectionResource", + "BrandProtectionResourceWithRawResponse", + "AsyncBrandProtectionResourceWithRawResponse", + "BrandProtectionResourceWithStreamingResponse", + "AsyncBrandProtectionResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/brand_protection.py b/src/cloudflare/resources/brand_protection/brand_protection.py similarity index 54% rename from src/cloudflare/resources/brand_protection.py rename to src/cloudflare/resources/brand_protection/brand_protection.py index 659ee0c7e7c..efe44ec7d57 100644 --- a/src/cloudflare/resources/brand_protection.py +++ b/src/cloudflare/resources/brand_protection/brand_protection.py @@ -2,30 +2,74 @@ from __future__ import annotations -from typing import List, Type, Iterable, Optional, cast - import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( +from .logos import ( + LogosResource, + AsyncLogosResource, + LogosResourceWithRawResponse, + AsyncLogosResourceWithRawResponse, + LogosResourceWithStreamingResponse, + AsyncLogosResourceWithStreamingResponse, +) +from .matches import ( + MatchesResource, + AsyncMatchesResource, + MatchesResourceWithRawResponse, + AsyncMatchesResourceWithRawResponse, + MatchesResourceWithStreamingResponse, + AsyncMatchesResourceWithStreamingResponse, +) +from .queries import ( + QueriesResource, + AsyncQueriesResource, + QueriesResourceWithRawResponse, + AsyncQueriesResourceWithRawResponse, + QueriesResourceWithStreamingResponse, + AsyncQueriesResourceWithStreamingResponse, +) +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.brand_protection import brand_protection_submit_params, brand_protection_url_info_params -from ..types.brand_protection.info import Info -from ..types.brand_protection.submit import Submit +from ...pagination import SyncSinglePage, AsyncSinglePage +from .logo_matches import ( + LogoMatchesResource, + AsyncLogoMatchesResource, + LogoMatchesResourceWithRawResponse, + AsyncLogoMatchesResourceWithRawResponse, + LogoMatchesResourceWithStreamingResponse, + AsyncLogoMatchesResourceWithStreamingResponse, +) +from ..._base_client import AsyncPaginator, make_request_options +from ...types.brand_protection.brand_protection_submit_response import BrandProtectionSubmitResponse +from ...types.brand_protection.brand_protection_url_info_response import BrandProtectionURLInfoResponse __all__ = ["BrandProtectionResource", "AsyncBrandProtectionResource"] class BrandProtectionResource(SyncAPIResource): + @cached_property + def queries(self) -> QueriesResource: + return QueriesResource(self._client) + + @cached_property + def matches(self) -> MatchesResource: + return MatchesResource(self._client) + + @cached_property + def logos(self) -> LogosResource: + return LogosResource(self._client) + + @cached_property + def logo_matches(self) -> LogoMatchesResource: + return LogoMatchesResource(self._client) + @cached_property def with_raw_response(self) -> BrandProtectionResourceWithRawResponse: """ @@ -49,22 +93,17 @@ def submit( self, *, account_id: str, - url: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Submit]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BrandProtectionSubmitResponse: """ - Submit suspicious URL for scanning. + Return new URL submissions Args: - account_id: Identifier. - - url: URL(s) to filter submissions results by. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -77,40 +116,27 @@ def submit( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( f"/accounts/{account_id}/brand-protection/submit", - body=maybe_transform({"url": url}, brand_protection_submit_params.BrandProtectionSubmitParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[Submit]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[Submit]], ResultWrapper[Submit]), + cast_to=BrandProtectionSubmitResponse, ) def url_info( self, *, account_id: str, - url: List[str] | NotGiven = NOT_GIVEN, - url_id: Iterable[int] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Info]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncSinglePage[BrandProtectionURLInfoResponse]: """ - Gets phishing details about a URL. + Return submitted URLs based on ID Args: - account_id: Identifier. - - url: Submission URL(s) to filter submission results by. - - url_id: Submission ID(s) to filter submission results by. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -121,27 +147,33 @@ def url_info( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( + return self._get_api_list( f"/accounts/{account_id}/brand-protection/url-info", + page=SyncSinglePage[BrandProtectionURLInfoResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "url": url, - "url_id": url_id, - }, - brand_protection_url_info_params.BrandProtectionURLInfoParams, - ), - post_parser=ResultWrapper[Optional[Info]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[Info]], ResultWrapper[Info]), + model=BrandProtectionURLInfoResponse, ) class AsyncBrandProtectionResource(AsyncAPIResource): + @cached_property + def queries(self) -> AsyncQueriesResource: + return AsyncQueriesResource(self._client) + + @cached_property + def matches(self) -> AsyncMatchesResource: + return AsyncMatchesResource(self._client) + + @cached_property + def logos(self) -> AsyncLogosResource: + return AsyncLogosResource(self._client) + + @cached_property + def logo_matches(self) -> AsyncLogoMatchesResource: + return AsyncLogoMatchesResource(self._client) + @cached_property def with_raw_response(self) -> AsyncBrandProtectionResourceWithRawResponse: """ @@ -165,22 +197,17 @@ async def submit( self, *, account_id: str, - url: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Submit]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BrandProtectionSubmitResponse: """ - Submit suspicious URL for scanning. + Return new URL submissions Args: - account_id: Identifier. - - url: URL(s) to filter submissions results by. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -193,40 +220,27 @@ async def submit( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( f"/accounts/{account_id}/brand-protection/submit", - body=await async_maybe_transform({"url": url}, brand_protection_submit_params.BrandProtectionSubmitParams), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[Submit]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[Submit]], ResultWrapper[Submit]), + cast_to=BrandProtectionSubmitResponse, ) - async def url_info( + def url_info( self, *, account_id: str, - url: List[str] | NotGiven = NOT_GIVEN, - url_id: Iterable[int] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Info]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[BrandProtectionURLInfoResponse, AsyncSinglePage[BrandProtectionURLInfoResponse]]: """ - Gets phishing details about a URL. + Return submitted URLs based on ID Args: - account_id: Identifier. - - url: Submission URL(s) to filter submission results by. - - url_id: Submission ID(s) to filter submission results by. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -237,23 +251,13 @@ async def url_info( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( + return self._get_api_list( f"/accounts/{account_id}/brand-protection/url-info", + page=AsyncSinglePage[BrandProtectionURLInfoResponse], options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "url": url, - "url_id": url_id, - }, - brand_protection_url_info_params.BrandProtectionURLInfoParams, - ), - post_parser=ResultWrapper[Optional[Info]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[Info]], ResultWrapper[Info]), + model=BrandProtectionURLInfoResponse, ) @@ -268,6 +272,22 @@ def __init__(self, brand_protection: BrandProtectionResource) -> None: brand_protection.url_info, ) + @cached_property + def queries(self) -> QueriesResourceWithRawResponse: + return QueriesResourceWithRawResponse(self._brand_protection.queries) + + @cached_property + def matches(self) -> MatchesResourceWithRawResponse: + return MatchesResourceWithRawResponse(self._brand_protection.matches) + + @cached_property + def logos(self) -> LogosResourceWithRawResponse: + return LogosResourceWithRawResponse(self._brand_protection.logos) + + @cached_property + def logo_matches(self) -> LogoMatchesResourceWithRawResponse: + return LogoMatchesResourceWithRawResponse(self._brand_protection.logo_matches) + class AsyncBrandProtectionResourceWithRawResponse: def __init__(self, brand_protection: AsyncBrandProtectionResource) -> None: @@ -280,6 +300,22 @@ def __init__(self, brand_protection: AsyncBrandProtectionResource) -> None: brand_protection.url_info, ) + @cached_property + def queries(self) -> AsyncQueriesResourceWithRawResponse: + return AsyncQueriesResourceWithRawResponse(self._brand_protection.queries) + + @cached_property + def matches(self) -> AsyncMatchesResourceWithRawResponse: + return AsyncMatchesResourceWithRawResponse(self._brand_protection.matches) + + @cached_property + def logos(self) -> AsyncLogosResourceWithRawResponse: + return AsyncLogosResourceWithRawResponse(self._brand_protection.logos) + + @cached_property + def logo_matches(self) -> AsyncLogoMatchesResourceWithRawResponse: + return AsyncLogoMatchesResourceWithRawResponse(self._brand_protection.logo_matches) + class BrandProtectionResourceWithStreamingResponse: def __init__(self, brand_protection: BrandProtectionResource) -> None: @@ -292,6 +328,22 @@ def __init__(self, brand_protection: BrandProtectionResource) -> None: brand_protection.url_info, ) + @cached_property + def queries(self) -> QueriesResourceWithStreamingResponse: + return QueriesResourceWithStreamingResponse(self._brand_protection.queries) + + @cached_property + def matches(self) -> MatchesResourceWithStreamingResponse: + return MatchesResourceWithStreamingResponse(self._brand_protection.matches) + + @cached_property + def logos(self) -> LogosResourceWithStreamingResponse: + return LogosResourceWithStreamingResponse(self._brand_protection.logos) + + @cached_property + def logo_matches(self) -> LogoMatchesResourceWithStreamingResponse: + return LogoMatchesResourceWithStreamingResponse(self._brand_protection.logo_matches) + class AsyncBrandProtectionResourceWithStreamingResponse: def __init__(self, brand_protection: AsyncBrandProtectionResource) -> None: @@ -303,3 +355,19 @@ def __init__(self, brand_protection: AsyncBrandProtectionResource) -> None: self.url_info = async_to_streamed_response_wrapper( brand_protection.url_info, ) + + @cached_property + def queries(self) -> AsyncQueriesResourceWithStreamingResponse: + return AsyncQueriesResourceWithStreamingResponse(self._brand_protection.queries) + + @cached_property + def matches(self) -> AsyncMatchesResourceWithStreamingResponse: + return AsyncMatchesResourceWithStreamingResponse(self._brand_protection.matches) + + @cached_property + def logos(self) -> AsyncLogosResourceWithStreamingResponse: + return AsyncLogosResourceWithStreamingResponse(self._brand_protection.logos) + + @cached_property + def logo_matches(self) -> AsyncLogoMatchesResourceWithStreamingResponse: + return AsyncLogoMatchesResourceWithStreamingResponse(self._brand_protection.logo_matches) diff --git a/src/cloudflare/resources/brand_protection/logo_matches.py b/src/cloudflare/resources/brand_protection/logo_matches.py new file mode 100644 index 00000000000..abe100862e5 --- /dev/null +++ b/src/cloudflare/resources/brand_protection/logo_matches.py @@ -0,0 +1,300 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +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 ..._base_client import make_request_options +from ...types.brand_protection import logo_match_get_params, logo_match_download_params +from ...types.brand_protection.logo_match_get_response import LogoMatchGetResponse +from ...types.brand_protection.logo_match_download_response import LogoMatchDownloadResponse + +__all__ = ["LogoMatchesResource", "AsyncLogoMatchesResource"] + + +class LogoMatchesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LogoMatchesResourceWithRawResponse: + """ + 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 LogoMatchesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LogoMatchesResourceWithStreamingResponse: + """ + 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 LogoMatchesResourceWithStreamingResponse(self) + + def download( + self, + *, + account_id: str, + limit: str | Omit = omit, + logo_id: SequenceNotStr[str] | Omit = omit, + offset: 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, + ) -> LogoMatchDownloadResponse: + """ + Return matches as CSV for logo queries based on ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/brand-protection/logo-matches/download", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "logo_id": logo_id, + "offset": offset, + }, + logo_match_download_params.LogoMatchDownloadParams, + ), + ), + cast_to=LogoMatchDownloadResponse, + ) + + def get( + self, + *, + account_id: str, + limit: str | Omit = omit, + logo_id: SequenceNotStr[str] | Omit = omit, + offset: 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, + ) -> LogoMatchGetResponse: + """ + Return matches for logo queries based on ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/brand-protection/logo-matches", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "logo_id": logo_id, + "offset": offset, + }, + logo_match_get_params.LogoMatchGetParams, + ), + ), + cast_to=LogoMatchGetResponse, + ) + + +class AsyncLogoMatchesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLogoMatchesResourceWithRawResponse: + """ + 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 AsyncLogoMatchesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLogoMatchesResourceWithStreamingResponse: + """ + 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 AsyncLogoMatchesResourceWithStreamingResponse(self) + + async def download( + self, + *, + account_id: str, + limit: str | Omit = omit, + logo_id: SequenceNotStr[str] | Omit = omit, + offset: 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, + ) -> LogoMatchDownloadResponse: + """ + Return matches as CSV for logo queries based on ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/brand-protection/logo-matches/download", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "logo_id": logo_id, + "offset": offset, + }, + logo_match_download_params.LogoMatchDownloadParams, + ), + ), + cast_to=LogoMatchDownloadResponse, + ) + + async def get( + self, + *, + account_id: str, + limit: str | Omit = omit, + logo_id: SequenceNotStr[str] | Omit = omit, + offset: 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, + ) -> LogoMatchGetResponse: + """ + Return matches for logo queries based on ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/brand-protection/logo-matches", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "logo_id": logo_id, + "offset": offset, + }, + logo_match_get_params.LogoMatchGetParams, + ), + ), + cast_to=LogoMatchGetResponse, + ) + + +class LogoMatchesResourceWithRawResponse: + def __init__(self, logo_matches: LogoMatchesResource) -> None: + self._logo_matches = logo_matches + + self.download = to_raw_response_wrapper( + logo_matches.download, + ) + self.get = to_raw_response_wrapper( + logo_matches.get, + ) + + +class AsyncLogoMatchesResourceWithRawResponse: + def __init__(self, logo_matches: AsyncLogoMatchesResource) -> None: + self._logo_matches = logo_matches + + self.download = async_to_raw_response_wrapper( + logo_matches.download, + ) + self.get = async_to_raw_response_wrapper( + logo_matches.get, + ) + + +class LogoMatchesResourceWithStreamingResponse: + def __init__(self, logo_matches: LogoMatchesResource) -> None: + self._logo_matches = logo_matches + + self.download = to_streamed_response_wrapper( + logo_matches.download, + ) + self.get = to_streamed_response_wrapper( + logo_matches.get, + ) + + +class AsyncLogoMatchesResourceWithStreamingResponse: + def __init__(self, logo_matches: AsyncLogoMatchesResource) -> None: + self._logo_matches = logo_matches + + self.download = async_to_streamed_response_wrapper( + logo_matches.download, + ) + self.get = async_to_streamed_response_wrapper( + logo_matches.get, + ) diff --git a/src/cloudflare/resources/brand_protection/logos.py b/src/cloudflare/resources/brand_protection/logos.py new file mode 100644 index 00000000000..fb55402f7e7 --- /dev/null +++ b/src/cloudflare/resources/brand_protection/logos.py @@ -0,0 +1,283 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, FileTypes, 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 ..._base_client import make_request_options +from ...types.brand_protection import logo_create_params +from ...types.brand_protection.logo_create_response import LogoCreateResponse + +__all__ = ["LogosResource", "AsyncLogosResource"] + + +class LogosResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LogosResourceWithRawResponse: + """ + 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 LogosResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LogosResourceWithStreamingResponse: + """ + 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 LogosResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + match_type: str | Omit = omit, + tag: str | Omit = omit, + threshold: float | Omit = omit, + image: FileTypes | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LogoCreateResponse: + """ + Return new saved logo queries created from image files + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + 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}/brand-protection/logos", + body=maybe_transform({"image": image}, logo_create_params.LogoCreateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "match_type": match_type, + "tag": tag, + "threshold": threshold, + }, + logo_create_params.LogoCreateParams, + ), + ), + cast_to=LogoCreateResponse, + ) + + def delete( + self, + logo_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, + ) -> None: + """ + Return a success message after deleting saved logo queries by ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not logo_id: + raise ValueError(f"Expected a non-empty value for `logo_id` but received {logo_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + f"/accounts/{account_id}/brand-protection/logos/{logo_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + +class AsyncLogosResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLogosResourceWithRawResponse: + """ + 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 AsyncLogosResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLogosResourceWithStreamingResponse: + """ + 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 AsyncLogosResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + match_type: str | Omit = omit, + tag: str | Omit = omit, + threshold: float | Omit = omit, + image: FileTypes | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LogoCreateResponse: + """ + Return new saved logo queries created from image files + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + 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}/brand-protection/logos", + body=await async_maybe_transform({"image": image}, logo_create_params.LogoCreateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "match_type": match_type, + "tag": tag, + "threshold": threshold, + }, + logo_create_params.LogoCreateParams, + ), + ), + cast_to=LogoCreateResponse, + ) + + async def delete( + self, + logo_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, + ) -> None: + """ + Return a success message after deleting saved logo queries by ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not logo_id: + raise ValueError(f"Expected a non-empty value for `logo_id` but received {logo_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + f"/accounts/{account_id}/brand-protection/logos/{logo_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + +class LogosResourceWithRawResponse: + def __init__(self, logos: LogosResource) -> None: + self._logos = logos + + self.create = to_raw_response_wrapper( + logos.create, + ) + self.delete = to_raw_response_wrapper( + logos.delete, + ) + + +class AsyncLogosResourceWithRawResponse: + def __init__(self, logos: AsyncLogosResource) -> None: + self._logos = logos + + self.create = async_to_raw_response_wrapper( + logos.create, + ) + self.delete = async_to_raw_response_wrapper( + logos.delete, + ) + + +class LogosResourceWithStreamingResponse: + def __init__(self, logos: LogosResource) -> None: + self._logos = logos + + self.create = to_streamed_response_wrapper( + logos.create, + ) + self.delete = to_streamed_response_wrapper( + logos.delete, + ) + + +class AsyncLogosResourceWithStreamingResponse: + def __init__(self, logos: AsyncLogosResource) -> None: + self._logos = logos + + self.create = async_to_streamed_response_wrapper( + logos.create, + ) + self.delete = async_to_streamed_response_wrapper( + logos.delete, + ) diff --git a/src/cloudflare/resources/brand_protection/matches.py b/src/cloudflare/resources/brand_protection/matches.py new file mode 100644 index 00000000000..cf18f113e32 --- /dev/null +++ b/src/cloudflare/resources/brand_protection/matches.py @@ -0,0 +1,308 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +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 ..._base_client import make_request_options +from ...types.brand_protection import match_get_params, match_download_params +from ...types.brand_protection.match_get_response import MatchGetResponse +from ...types.brand_protection.match_download_response import MatchDownloadResponse + +__all__ = ["MatchesResource", "AsyncMatchesResource"] + + +class MatchesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> MatchesResourceWithRawResponse: + """ + 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 MatchesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> MatchesResourceWithStreamingResponse: + """ + 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 MatchesResourceWithStreamingResponse(self) + + def download( + self, + *, + account_id: str, + id: str | Omit = omit, + include_domain_id: bool | Omit = omit, + 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MatchDownloadResponse: + """ + Return matches as CSV for string queries based on ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/brand-protection/matches/download", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "include_domain_id": include_domain_id, + "limit": limit, + "offset": offset, + }, + match_download_params.MatchDownloadParams, + ), + ), + cast_to=MatchDownloadResponse, + ) + + def get( + self, + *, + account_id: str, + id: str | Omit = omit, + include_domain_id: bool | Omit = omit, + 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MatchGetResponse: + """ + Return matches for string queries based on ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/brand-protection/matches", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "include_domain_id": include_domain_id, + "limit": limit, + "offset": offset, + }, + match_get_params.MatchGetParams, + ), + ), + cast_to=MatchGetResponse, + ) + + +class AsyncMatchesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncMatchesResourceWithRawResponse: + """ + 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 AsyncMatchesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncMatchesResourceWithStreamingResponse: + """ + 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 AsyncMatchesResourceWithStreamingResponse(self) + + async def download( + self, + *, + account_id: str, + id: str | Omit = omit, + include_domain_id: bool | Omit = omit, + 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MatchDownloadResponse: + """ + Return matches as CSV for string queries based on ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/brand-protection/matches/download", + 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, + "include_domain_id": include_domain_id, + "limit": limit, + "offset": offset, + }, + match_download_params.MatchDownloadParams, + ), + ), + cast_to=MatchDownloadResponse, + ) + + async def get( + self, + *, + account_id: str, + id: str | Omit = omit, + include_domain_id: bool | Omit = omit, + 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MatchGetResponse: + """ + Return matches for string queries based on ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/brand-protection/matches", + 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, + "include_domain_id": include_domain_id, + "limit": limit, + "offset": offset, + }, + match_get_params.MatchGetParams, + ), + ), + cast_to=MatchGetResponse, + ) + + +class MatchesResourceWithRawResponse: + def __init__(self, matches: MatchesResource) -> None: + self._matches = matches + + self.download = to_raw_response_wrapper( + matches.download, + ) + self.get = to_raw_response_wrapper( + matches.get, + ) + + +class AsyncMatchesResourceWithRawResponse: + def __init__(self, matches: AsyncMatchesResource) -> None: + self._matches = matches + + self.download = async_to_raw_response_wrapper( + matches.download, + ) + self.get = async_to_raw_response_wrapper( + matches.get, + ) + + +class MatchesResourceWithStreamingResponse: + def __init__(self, matches: MatchesResource) -> None: + self._matches = matches + + self.download = to_streamed_response_wrapper( + matches.download, + ) + self.get = to_streamed_response_wrapper( + matches.get, + ) + + +class AsyncMatchesResourceWithStreamingResponse: + def __init__(self, matches: AsyncMatchesResource) -> None: + self._matches = matches + + self.download = async_to_streamed_response_wrapper( + matches.download, + ) + self.get = async_to_streamed_response_wrapper( + matches.get, + ) diff --git a/src/cloudflare/resources/brand_protection/queries.py b/src/cloudflare/resources/brand_protection/queries.py new file mode 100644 index 00000000000..4b7ead75a1c --- /dev/null +++ b/src/cloudflare/resources/brand_protection/queries.py @@ -0,0 +1,419 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Iterable +from datetime import datetime + +import httpx + +from ..._types import Body, Omit, Query, Headers, NoneType, 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 ..._base_client import make_request_options +from ...types.brand_protection import query_bulk_params, query_create_params, query_delete_params + +__all__ = ["QueriesResource", "AsyncQueriesResource"] + + +class QueriesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> QueriesResourceWithRawResponse: + """ + 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 QueriesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> QueriesResourceWithStreamingResponse: + """ + 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 QueriesResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + id: str | Omit = omit, + query_scan: bool | Omit = omit, + query_tag: str | Omit = omit, + max_time: Union[str, datetime, None] | Omit = omit, + min_time: Union[str, datetime, None] | Omit = omit, + body_scan: bool | Omit = omit, + string_matches: object | Omit = omit, + body_tag: 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, + ) -> None: + """ + Return a success message after creating new saved string queries + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + 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 {})} + return self._post( + f"/accounts/{account_id}/brand-protection/queries", + body=maybe_transform( + { + "max_time": max_time, + "min_time": min_time, + "body_scan": body_scan, + "string_matches": string_matches, + "body_tag": body_tag, + }, + query_create_params.QueryCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "query_scan": query_scan, + "query_tag": query_tag, + }, + query_create_params.QueryCreateParams, + ), + ), + cast_to=NoneType, + ) + + def delete( + self, + *, + account_id: str, + id: str | Omit = omit, + scan: bool | Omit = omit, + tag: 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, + ) -> None: + """ + Return a success message after deleting saved string queries by ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + 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 {})} + return self._delete( + f"/accounts/{account_id}/brand-protection/queries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "scan": scan, + "tag": tag, + }, + query_delete_params.QueryDeleteParams, + ), + ), + cast_to=NoneType, + ) + + def bulk( + self, + *, + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> None: + """ + Return a success message after creating new saved string queries in bulk + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + 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 {})} + return self._post( + f"/accounts/{account_id}/brand-protection/queries/bulk", + body=maybe_transform({"queries": queries}, query_bulk_params.QueryBulkParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + +class AsyncQueriesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncQueriesResourceWithRawResponse: + """ + 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 AsyncQueriesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncQueriesResourceWithStreamingResponse: + """ + 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 AsyncQueriesResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + id: str | Omit = omit, + query_scan: bool | Omit = omit, + query_tag: str | Omit = omit, + max_time: Union[str, datetime, None] | Omit = omit, + min_time: Union[str, datetime, None] | Omit = omit, + body_scan: bool | Omit = omit, + string_matches: object | Omit = omit, + body_tag: 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, + ) -> None: + """ + Return a success message after creating new saved string queries + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + 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 {})} + return await self._post( + f"/accounts/{account_id}/brand-protection/queries", + body=await async_maybe_transform( + { + "max_time": max_time, + "min_time": min_time, + "body_scan": body_scan, + "string_matches": string_matches, + "body_tag": body_tag, + }, + query_create_params.QueryCreateParams, + ), + 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, + "query_scan": query_scan, + "query_tag": query_tag, + }, + query_create_params.QueryCreateParams, + ), + ), + cast_to=NoneType, + ) + + async def delete( + self, + *, + account_id: str, + id: str | Omit = omit, + scan: bool | Omit = omit, + tag: 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, + ) -> None: + """ + Return a success message after deleting saved string queries by ID + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + 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 {})} + return await self._delete( + f"/accounts/{account_id}/brand-protection/queries", + 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, + "scan": scan, + "tag": tag, + }, + query_delete_params.QueryDeleteParams, + ), + ), + cast_to=NoneType, + ) + + async def bulk( + self, + *, + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> None: + """ + Return a success message after creating new saved string queries in bulk + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + 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 {})} + return await self._post( + f"/accounts/{account_id}/brand-protection/queries/bulk", + body=await async_maybe_transform({"queries": queries}, query_bulk_params.QueryBulkParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + +class QueriesResourceWithRawResponse: + def __init__(self, queries: QueriesResource) -> None: + self._queries = queries + + self.create = to_raw_response_wrapper( + queries.create, + ) + self.delete = to_raw_response_wrapper( + queries.delete, + ) + self.bulk = to_raw_response_wrapper( + queries.bulk, + ) + + +class AsyncQueriesResourceWithRawResponse: + def __init__(self, queries: AsyncQueriesResource) -> None: + self._queries = queries + + self.create = async_to_raw_response_wrapper( + queries.create, + ) + self.delete = async_to_raw_response_wrapper( + queries.delete, + ) + self.bulk = async_to_raw_response_wrapper( + queries.bulk, + ) + + +class QueriesResourceWithStreamingResponse: + def __init__(self, queries: QueriesResource) -> None: + self._queries = queries + + self.create = to_streamed_response_wrapper( + queries.create, + ) + self.delete = to_streamed_response_wrapper( + queries.delete, + ) + self.bulk = to_streamed_response_wrapper( + queries.bulk, + ) + + +class AsyncQueriesResourceWithStreamingResponse: + def __init__(self, queries: AsyncQueriesResource) -> None: + self._queries = queries + + self.create = async_to_streamed_response_wrapper( + queries.create, + ) + self.delete = async_to_streamed_response_wrapper( + queries.delete, + ) + self.bulk = async_to_streamed_response_wrapper( + queries.bulk, + ) diff --git a/src/cloudflare/resources/browser_rendering/content.py b/src/cloudflare/resources/browser_rendering/content.py index 6ff78d62f8b..6b3e72d4426 100644 --- a/src/cloudflare/resources/browser_rendering/content.py +++ b/src/cloudflare/resources/browser_rendering/content.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,11 +49,11 @@ def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[content_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[content_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[content_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[content_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -76,14 +76,14 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: content_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[content_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: content_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: content_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[content_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: content_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -106,20 +106,20 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: content_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: content_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: content_create_params.Viewport | Omit = omit, + wait_for_selector: content_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Fetches rendered HTML content from provided URL or HTML. @@ -244,11 +244,11 @@ async def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[content_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[content_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[content_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[content_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -271,14 +271,14 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: content_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[content_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: content_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: content_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[content_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: content_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -301,20 +301,20 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: content_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: content_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: content_create_params.Viewport | Omit = omit, + wait_for_selector: content_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Fetches rendered HTML content from provided URL or HTML. diff --git a/src/cloudflare/resources/browser_rendering/json.py b/src/cloudflare/resources/browser_rendering/json.py index 50ee1edef9c..b2b44fb99c5 100644 --- a/src/cloudflare/resources/browser_rendering/json.py +++ b/src/cloudflare/resources/browser_rendering/json.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,11 +49,11 @@ def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[json_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[json_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[json_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[json_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -76,15 +76,16 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: json_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[json_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: json_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - prompt: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: json_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[json_create_params.Cookie] | Omit = omit, + custom_ai: Iterable[json_create_params.CustomAI] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: json_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + prompt: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -107,21 +108,21 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - response_format: json_create_params.ResponseFormat | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: json_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: json_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + response_format: json_create_params.ResponseFormat | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: json_create_params.Viewport | Omit = omit, + wait_for_selector: json_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JsonCreateResponse: """Gets json from a webpage from a provided URL or HTML. @@ -153,6 +154,10 @@ def create( cookies: Check [options](https://pptr.dev/api/puppeteer.page.setcookie). + custom_ai: Optional list of custom AI models to use for the request. The models will be + tried in the order provided, and in case a model returns an error, the next one + will be used as fallback. + goto_options: Check [options](https://pptr.dev/api/puppeteer.gotooptions). html: Set the content of the page, eg: `

Hello World!!

`. Either `html` or @@ -195,6 +200,7 @@ def create( "authenticate": authenticate, "best_attempt": best_attempt, "cookies": cookies, + "custom_ai": custom_ai, "emulate_media_type": emulate_media_type, "goto_options": goto_options, "html": html, @@ -248,11 +254,11 @@ async def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[json_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[json_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[json_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[json_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -275,15 +281,16 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: json_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[json_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: json_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - prompt: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: json_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[json_create_params.Cookie] | Omit = omit, + custom_ai: Iterable[json_create_params.CustomAI] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: json_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + prompt: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -306,21 +313,21 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - response_format: json_create_params.ResponseFormat | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: json_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: json_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + response_format: json_create_params.ResponseFormat | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: json_create_params.Viewport | Omit = omit, + wait_for_selector: json_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JsonCreateResponse: """Gets json from a webpage from a provided URL or HTML. @@ -352,6 +359,10 @@ async def create( cookies: Check [options](https://pptr.dev/api/puppeteer.page.setcookie). + custom_ai: Optional list of custom AI models to use for the request. The models will be + tried in the order provided, and in case a model returns an error, the next one + will be used as fallback. + goto_options: Check [options](https://pptr.dev/api/puppeteer.gotooptions). html: Set the content of the page, eg: `

Hello World!!

`. Either `html` or @@ -394,6 +405,7 @@ async def create( "authenticate": authenticate, "best_attempt": best_attempt, "cookies": cookies, + "custom_ai": custom_ai, "emulate_media_type": emulate_media_type, "goto_options": goto_options, "html": html, diff --git a/src/cloudflare/resources/browser_rendering/links.py b/src/cloudflare/resources/browser_rendering/links.py index 0d06a72bee7..75ecc4c041a 100644 --- a/src/cloudflare/resources/browser_rendering/links.py +++ b/src/cloudflare/resources/browser_rendering/links.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,11 +49,11 @@ def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[link_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[link_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[link_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[link_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -76,14 +76,15 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: link_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[link_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: link_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: link_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[link_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + exclude_external_links: bool | Omit = omit, + goto_options: link_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -106,21 +107,21 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: link_create_params.Viewport | NotGiven = NOT_GIVEN, - visible_links_only: bool | NotGiven = NOT_GIVEN, - wait_for_selector: link_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: link_create_params.Viewport | Omit = omit, + visible_links_only: bool | Omit = omit, + wait_for_selector: link_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LinkCreateResponse: """ Get links from a web page. @@ -193,6 +194,7 @@ def create( "best_attempt": best_attempt, "cookies": cookies, "emulate_media_type": emulate_media_type, + "exclude_external_links": exclude_external_links, "goto_options": goto_options, "html": html, "reject_request_pattern": reject_request_pattern, @@ -244,11 +246,11 @@ async def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[link_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[link_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[link_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[link_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -271,14 +273,15 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: link_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[link_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: link_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: link_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[link_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + exclude_external_links: bool | Omit = omit, + goto_options: link_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -301,21 +304,21 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: link_create_params.Viewport | NotGiven = NOT_GIVEN, - visible_links_only: bool | NotGiven = NOT_GIVEN, - wait_for_selector: link_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: link_create_params.Viewport | Omit = omit, + visible_links_only: bool | Omit = omit, + wait_for_selector: link_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LinkCreateResponse: """ Get links from a web page. @@ -388,6 +391,7 @@ async def create( "best_attempt": best_attempt, "cookies": cookies, "emulate_media_type": emulate_media_type, + "exclude_external_links": exclude_external_links, "goto_options": goto_options, "html": html, "reject_request_pattern": reject_request_pattern, diff --git a/src/cloudflare/resources/browser_rendering/markdown.py b/src/cloudflare/resources/browser_rendering/markdown.py index b5992be4ac7..2e73c8a707a 100644 --- a/src/cloudflare/resources/browser_rendering/markdown.py +++ b/src/cloudflare/resources/browser_rendering/markdown.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,11 +49,11 @@ def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[markdown_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[markdown_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[markdown_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[markdown_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -76,14 +76,14 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: markdown_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[markdown_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: markdown_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: markdown_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[markdown_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: markdown_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -106,20 +106,20 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: markdown_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: markdown_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: markdown_create_params.Viewport | Omit = omit, + wait_for_selector: markdown_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Gets markdown of a webpage from provided URL or HTML. @@ -244,11 +244,11 @@ async def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[markdown_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[markdown_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[markdown_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[markdown_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -271,14 +271,14 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: markdown_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[markdown_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: markdown_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: markdown_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[markdown_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: markdown_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -301,20 +301,20 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: markdown_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: markdown_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: markdown_create_params.Viewport | Omit = omit, + wait_for_selector: markdown_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Gets markdown of a webpage from provided URL or HTML. diff --git a/src/cloudflare/resources/browser_rendering/pdf.py b/src/cloudflare/resources/browser_rendering/pdf.py index 4b82c076245..cbdbc80bfde 100644 --- a/src/cloudflare/resources/browser_rendering/pdf.py +++ b/src/cloudflare/resources/browser_rendering/pdf.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,11 +51,11 @@ def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[pdf_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[pdf_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[pdf_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[pdf_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -78,14 +78,15 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: pdf_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[pdf_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: pdf_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: pdf_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[pdf_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: pdf_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + pdf_options: pdf_create_params.PDFOptions | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -108,20 +109,20 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: pdf_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: pdf_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: pdf_create_params.Viewport | Omit = omit, + wait_for_selector: pdf_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """Fetches rendered PDF from provided URL or HTML. @@ -158,6 +159,8 @@ def create( html: Set the content of the page, eg: `

Hello World!!

`. Either `html` or `url` must be set. + pdf_options: Check [options](https://pptr.dev/api/puppeteer.pdfoptions). + reject_request_pattern: Block undesired requests that match the provided regex patterns, eg. '/^.\\**\\..(css)'. @@ -199,6 +202,7 @@ def create( "emulate_media_type": emulate_media_type, "goto_options": goto_options, "html": html, + "pdf_options": pdf_options, "reject_request_pattern": reject_request_pattern, "reject_resource_types": reject_resource_types, "set_extra_http_headers": set_extra_http_headers, @@ -246,11 +250,11 @@ async def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[pdf_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[pdf_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[pdf_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[pdf_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -273,14 +277,15 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: pdf_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[pdf_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: pdf_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: pdf_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[pdf_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: pdf_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + pdf_options: pdf_create_params.PDFOptions | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -303,20 +308,20 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: pdf_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: pdf_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: pdf_create_params.Viewport | Omit = omit, + wait_for_selector: pdf_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """Fetches rendered PDF from provided URL or HTML. @@ -353,6 +358,8 @@ async def create( html: Set the content of the page, eg: `

Hello World!!

`. Either `html` or `url` must be set. + pdf_options: Check [options](https://pptr.dev/api/puppeteer.pdfoptions). + reject_request_pattern: Block undesired requests that match the provided regex patterns, eg. '/^.\\**\\..(css)'. @@ -394,6 +401,7 @@ async def create( "emulate_media_type": emulate_media_type, "goto_options": goto_options, "html": html, + "pdf_options": pdf_options, "reject_request_pattern": reject_request_pattern, "reject_resource_types": reject_resource_types, "set_extra_http_headers": set_extra_http_headers, diff --git a/src/cloudflare/resources/browser_rendering/scrape.py b/src/cloudflare/resources/browser_rendering/scrape.py index 39dd955afbb..f7d74567f21 100644 --- a/src/cloudflare/resources/browser_rendering/scrape.py +++ b/src/cloudflare/resources/browser_rendering/scrape.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,11 +50,11 @@ def create( *, account_id: str, elements: Iterable[scrape_create_params.Element], - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[scrape_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[scrape_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[scrape_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[scrape_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -77,14 +77,14 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: scrape_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[scrape_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: scrape_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: scrape_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[scrape_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: scrape_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -107,20 +107,20 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: scrape_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: scrape_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: scrape_create_params.Viewport | Omit = omit, + wait_for_selector: scrape_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScrapeCreateResponse: """ Get meta attributes like height, width, text and others of selected elements. @@ -245,11 +245,11 @@ async def create( *, account_id: str, elements: Iterable[scrape_create_params.Element], - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[scrape_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[scrape_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[scrape_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[scrape_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -272,14 +272,14 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: scrape_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[scrape_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: scrape_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: scrape_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[scrape_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: scrape_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -302,20 +302,20 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: scrape_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: scrape_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: scrape_create_params.Viewport | Omit = omit, + wait_for_selector: scrape_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScrapeCreateResponse: """ Get meta attributes like height, width, text and others of selected elements. diff --git a/src/cloudflare/resources/browser_rendering/screenshot.py b/src/cloudflare/resources/browser_rendering/screenshot.py index c14d69ece43..57e975ee619 100644 --- a/src/cloudflare/resources/browser_rendering/screenshot.py +++ b/src/cloudflare/resources/browser_rendering/screenshot.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,11 +48,11 @@ def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[screenshot_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[screenshot_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[screenshot_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[screenshot_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -75,14 +75,14 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: screenshot_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[screenshot_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: screenshot_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: screenshot_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[screenshot_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: screenshot_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -105,23 +105,23 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - screenshot_options: screenshot_create_params.ScreenshotOptions | NotGiven = NOT_GIVEN, - scroll_page: bool | NotGiven = NOT_GIVEN, - selector: str | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: screenshot_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: screenshot_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + screenshot_options: screenshot_create_params.ScreenshotOptions | Omit = omit, + scroll_page: bool | Omit = omit, + selector: str | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: screenshot_create_params.Viewport | Omit = omit, + wait_for_selector: screenshot_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScreenshotCreateResponse: """Takes a screenshot of a webpage from provided URL or HTML. @@ -251,11 +251,11 @@ async def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[screenshot_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[screenshot_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[screenshot_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[screenshot_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -278,14 +278,14 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: screenshot_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[screenshot_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: screenshot_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: screenshot_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[screenshot_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: screenshot_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -308,23 +308,23 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - screenshot_options: screenshot_create_params.ScreenshotOptions | NotGiven = NOT_GIVEN, - scroll_page: bool | NotGiven = NOT_GIVEN, - selector: str | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: screenshot_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: screenshot_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + screenshot_options: screenshot_create_params.ScreenshotOptions | Omit = omit, + scroll_page: bool | Omit = omit, + selector: str | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: screenshot_create_params.Viewport | Omit = omit, + wait_for_selector: screenshot_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScreenshotCreateResponse: """Takes a screenshot of a webpage from provided URL or HTML. diff --git a/src/cloudflare/resources/browser_rendering/snapshot.py b/src/cloudflare/resources/browser_rendering/snapshot.py index 98c28d00ced..c9f4d732fcd 100644 --- a/src/cloudflare/resources/browser_rendering/snapshot.py +++ b/src/cloudflare/resources/browser_rendering/snapshot.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,11 +49,11 @@ def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[snapshot_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[snapshot_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[snapshot_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[snapshot_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -76,14 +76,14 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: snapshot_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[snapshot_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: snapshot_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: snapshot_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[snapshot_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: snapshot_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -106,21 +106,21 @@ def create( "other", ] ] - | NotGiven = NOT_GIVEN, - screenshot_options: snapshot_create_params.ScreenshotOptions | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: snapshot_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: snapshot_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + screenshot_options: snapshot_create_params.ScreenshotOptions | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: snapshot_create_params.Viewport | Omit = omit, + wait_for_selector: snapshot_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SnapshotCreateResponse]: """Returns the page's HTML content and screenshot. @@ -247,11 +247,11 @@ async def create( self, *, account_id: str, - cache_ttl: float | NotGiven = NOT_GIVEN, - action_timeout: float | NotGiven = NOT_GIVEN, - add_script_tag: Iterable[snapshot_create_params.AddScriptTag] | NotGiven = NOT_GIVEN, - add_style_tag: Iterable[snapshot_create_params.AddStyleTag] | NotGiven = NOT_GIVEN, - allow_request_pattern: List[str] | NotGiven = NOT_GIVEN, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[snapshot_create_params.AddScriptTag] | Omit = omit, + add_style_tag: Iterable[snapshot_create_params.AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, allow_resource_types: List[ Literal[ "document", @@ -274,14 +274,14 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - authenticate: snapshot_create_params.Authenticate | NotGiven = NOT_GIVEN, - best_attempt: bool | NotGiven = NOT_GIVEN, - cookies: Iterable[snapshot_create_params.Cookie] | NotGiven = NOT_GIVEN, - emulate_media_type: str | NotGiven = NOT_GIVEN, - goto_options: snapshot_create_params.GotoOptions | NotGiven = NOT_GIVEN, - html: str | NotGiven = NOT_GIVEN, - reject_request_pattern: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + authenticate: snapshot_create_params.Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[snapshot_create_params.Cookie] | Omit = omit, + emulate_media_type: str | Omit = omit, + goto_options: snapshot_create_params.GotoOptions | Omit = omit, + html: str | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, reject_resource_types: List[ Literal[ "document", @@ -304,21 +304,21 @@ async def create( "other", ] ] - | NotGiven = NOT_GIVEN, - screenshot_options: snapshot_create_params.ScreenshotOptions | NotGiven = NOT_GIVEN, - set_extra_http_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - set_java_script_enabled: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, - user_agent: str | NotGiven = NOT_GIVEN, - viewport: snapshot_create_params.Viewport | NotGiven = NOT_GIVEN, - wait_for_selector: snapshot_create_params.WaitForSelector | NotGiven = NOT_GIVEN, - wait_for_timeout: float | NotGiven = NOT_GIVEN, + | Omit = omit, + screenshot_options: snapshot_create_params.ScreenshotOptions | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + url: str | Omit = omit, + user_agent: str | Omit = omit, + viewport: snapshot_create_params.Viewport | Omit = omit, + wait_for_selector: snapshot_create_params.WaitForSelector | Omit = omit, + wait_for_timeout: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SnapshotCreateResponse]: """Returns the page's HTML content and screenshot. diff --git a/src/cloudflare/resources/cache/cache.py b/src/cloudflare/resources/cache/cache.py index b268affe86f..832b66a1363 100644 --- a/src/cloudflare/resources/cache/cache.py +++ b/src/cloudflare/resources/cache/cache.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Iterable, Optional, cast +from typing import Type, Iterable, Optional, cast from typing_extensions import overload import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import required_args, maybe_transform, async_maybe_transform from .variants import ( VariantsResource, @@ -98,13 +98,13 @@ def purge( self, *, zone_id: str, - tags: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -200,13 +200,13 @@ def purge( self, *, zone_id: str, - hosts: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -302,13 +302,13 @@ def purge( self, *, zone_id: str, - prefixes: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -404,13 +404,13 @@ def purge( self, *, zone_id: str, - purge_everything: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -506,13 +506,13 @@ def purge( self, *, zone_id: str, - files: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -608,13 +608,13 @@ def purge( self, *, zone_id: str, - files: Iterable[cache_purge_params.CachePurgeSingleFileWithURLAndHeadersFile] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -710,19 +710,19 @@ def purge( self, *, zone_id: str, - tags: List[str] | NotGiven = NOT_GIVEN, - hosts: List[str] | NotGiven = NOT_GIVEN, - prefixes: List[str] | NotGiven = NOT_GIVEN, - purge_everything: bool | NotGiven = NOT_GIVEN, - files: List[str] + tags: SequenceNotStr[str] | Omit = omit, + hosts: SequenceNotStr[str] | Omit = omit, + prefixes: SequenceNotStr[str] | Omit = omit, + purge_everything: bool | Omit = omit, + files: SequenceNotStr[str] | Iterable[cache_purge_params.CachePurgeSingleFileWithURLAndHeadersFile] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -790,13 +790,13 @@ async def purge( self, *, zone_id: str, - tags: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -892,13 +892,13 @@ async def purge( self, *, zone_id: str, - hosts: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -994,13 +994,13 @@ async def purge( self, *, zone_id: str, - prefixes: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -1096,13 +1096,13 @@ async def purge( self, *, zone_id: str, - purge_everything: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -1198,13 +1198,13 @@ async def purge( self, *, zone_id: str, - files: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -1300,13 +1300,13 @@ async def purge( self, *, zone_id: str, - files: Iterable[cache_purge_params.CachePurgeSingleFileWithURLAndHeadersFile] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: """### Purge All Cached Content @@ -1402,19 +1402,19 @@ async def purge( self, *, zone_id: str, - tags: List[str] | NotGiven = NOT_GIVEN, - hosts: List[str] | NotGiven = NOT_GIVEN, - prefixes: List[str] | NotGiven = NOT_GIVEN, - purge_everything: bool | NotGiven = NOT_GIVEN, - files: List[str] + tags: SequenceNotStr[str] | Omit = omit, + hosts: SequenceNotStr[str] | Omit = omit, + prefixes: SequenceNotStr[str] | Omit = omit, + purge_everything: bool | Omit = omit, + files: SequenceNotStr[str] | Iterable[cache_purge_params.CachePurgeSingleFileWithURLAndHeadersFile] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") diff --git a/src/cloudflare/resources/cache/cache_reserve.py b/src/cloudflare/resources/cache/cache_reserve.py index dc77fc2d8a8..f4196a32033 100644 --- a/src/cloudflare/resources/cache/cache_reserve.py +++ b/src/cloudflare/resources/cache/cache_reserve.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,7 +58,7 @@ def clear( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CacheReserveClearResponse]: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first @@ -67,7 +67,7 @@ def clear( that you cannot undo or cancel this operation. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -102,7 +102,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CacheReserveEditResponse]: """ Increase cache lifetimes by automatically storing all cacheable files into @@ -113,7 +113,7 @@ def edit( for more information. Args: - zone_id: Identifier + zone_id: Identifier. value: Value of the Cache Reserve zone setting. @@ -149,7 +149,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CacheReserveGetResponse]: """ Increase cache lifetimes by automatically storing all cacheable files into @@ -160,7 +160,7 @@ def get( for more information. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -193,7 +193,7 @@ def status( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CacheReserveStatusResponse]: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first @@ -202,7 +202,7 @@ def status( that you cannot undo or cancel this operation. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -257,7 +257,7 @@ async def clear( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CacheReserveClearResponse]: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first @@ -266,7 +266,7 @@ async def clear( that you cannot undo or cancel this operation. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -301,7 +301,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CacheReserveEditResponse]: """ Increase cache lifetimes by automatically storing all cacheable files into @@ -312,7 +312,7 @@ async def edit( for more information. Args: - zone_id: Identifier + zone_id: Identifier. value: Value of the Cache Reserve zone setting. @@ -348,7 +348,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CacheReserveGetResponse]: """ Increase cache lifetimes by automatically storing all cacheable files into @@ -359,7 +359,7 @@ async def get( for more information. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -392,7 +392,7 @@ async def status( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CacheReserveStatusResponse]: """ You can use Cache Reserve Clear to clear your Cache Reserve, but you must first @@ -401,7 +401,7 @@ async def status( that you cannot undo or cancel this operation. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/cache/regional_tiered_cache.py b/src/cloudflare/resources/cache/regional_tiered_cache.py index f61812aea0e..f70da5cadcb 100644 --- a/src/cloudflare/resources/cache/regional_tiered_cache.py +++ b/src/cloudflare/resources/cache/regional_tiered_cache.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RegionalTieredCacheEditResponse]: """ Instructs Cloudflare to check a regional hub data center on the way to your @@ -64,7 +64,7 @@ def edit( topologies. Args: - zone_id: Identifier + zone_id: Identifier. value: Value of the Regional Tiered Cache zone setting. @@ -102,7 +102,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RegionalTieredCacheGetResponse]: """ Instructs Cloudflare to check a regional hub data center on the way to your @@ -110,7 +110,7 @@ def get( topologies. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -165,7 +165,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RegionalTieredCacheEditResponse]: """ Instructs Cloudflare to check a regional hub data center on the way to your @@ -173,7 +173,7 @@ async def edit( topologies. Args: - zone_id: Identifier + zone_id: Identifier. value: Value of the Regional Tiered Cache zone setting. @@ -213,7 +213,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RegionalTieredCacheGetResponse]: """ Instructs Cloudflare to check a regional hub data center on the way to your @@ -221,7 +221,7 @@ async def get( topologies. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/cache/smart_tiered_cache.py b/src/cloudflare/resources/cache/smart_tiered_cache.py index a12219627ba..f9eefc2f36f 100644 --- a/src/cloudflare/resources/cache/smart_tiered_cache.py +++ b/src/cloudflare/resources/cache/smart_tiered_cache.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SmartTieredCacheDeleteResponse]: """ Smart Tiered Cache dynamically selects the single closest upper tier for each of @@ -67,7 +67,7 @@ def delete( data center with the lowest latency to be the upper-tier for an origin. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -101,7 +101,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SmartTieredCacheEditResponse]: """ Smart Tiered Cache dynamically selects the single closest upper tier for each of @@ -112,9 +112,9 @@ def edit( data center with the lowest latency to be the upper-tier for an origin. Args: - zone_id: Identifier + zone_id: Identifier. - value: Enable or disable the Smart Tiered Cache + value: Enable or disable the Smart Tiered Cache. extra_headers: Send extra headers @@ -148,7 +148,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SmartTieredCacheGetResponse]: """ Smart Tiered Cache dynamically selects the single closest upper tier for each of @@ -159,7 +159,7 @@ def get( data center with the lowest latency to be the upper-tier for an origin. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -213,7 +213,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SmartTieredCacheDeleteResponse]: """ Smart Tiered Cache dynamically selects the single closest upper tier for each of @@ -224,7 +224,7 @@ async def delete( data center with the lowest latency to be the upper-tier for an origin. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -258,7 +258,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SmartTieredCacheEditResponse]: """ Smart Tiered Cache dynamically selects the single closest upper tier for each of @@ -269,9 +269,9 @@ async def edit( data center with the lowest latency to be the upper-tier for an origin. Args: - zone_id: Identifier + zone_id: Identifier. - value: Enable or disable the Smart Tiered Cache + value: Enable or disable the Smart Tiered Cache. extra_headers: Send extra headers @@ -307,7 +307,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SmartTieredCacheGetResponse]: """ Smart Tiered Cache dynamically selects the single closest upper tier for each of @@ -318,7 +318,7 @@ async def get( data center with the lowest latency to be the upper-tier for an origin. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/cache/variants.py b/src/cloudflare/resources/cache/variants.py index 2bc934f50f3..a263f6997d4 100644 --- a/src/cloudflare/resources/cache/variants.py +++ b/src/cloudflare/resources/cache/variants.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,7 +55,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VariantDeleteResponse]: """ Variant support enables caching variants of images with certain file extensions @@ -65,7 +65,7 @@ def delete( be indicated with BYPASS cache status in the response headers. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -99,7 +99,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VariantEditResponse]: """ Variant support enables caching variants of images with certain file extensions @@ -109,7 +109,7 @@ def edit( be indicated with BYPASS cache status in the response headers. Args: - zone_id: Identifier + zone_id: Identifier. value: Value of the zone setting. @@ -145,7 +145,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VariantGetResponse]: """ Variant support enables caching variants of images with certain file extensions @@ -155,7 +155,7 @@ def get( be indicated with BYPASS cache status in the response headers. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -209,7 +209,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VariantDeleteResponse]: """ Variant support enables caching variants of images with certain file extensions @@ -219,7 +219,7 @@ async def delete( be indicated with BYPASS cache status in the response headers. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -253,7 +253,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VariantEditResponse]: """ Variant support enables caching variants of images with certain file extensions @@ -263,7 +263,7 @@ async def edit( be indicated with BYPASS cache status in the response headers. Args: - zone_id: Identifier + zone_id: Identifier. value: Value of the zone setting. @@ -299,7 +299,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VariantGetResponse]: """ Variant support enables caching variants of images with certain file extensions @@ -309,7 +309,7 @@ async def get( be indicated with BYPASS cache status in the response headers. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/calls/sfu.py b/src/cloudflare/resources/calls/sfu.py index e8144808de8..822b9a37002 100644 --- a/src/cloudflare/resources/calls/sfu.py +++ b/src/cloudflare/resources/calls/sfu.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,13 +53,13 @@ def create( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SFUCreateResponse]: """Creates a new Cloudflare calls app. @@ -99,13 +99,13 @@ def update( app_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SFUUpdateResponse]: """ Edit details for a single app. @@ -151,7 +151,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SFUListResponse]: """ Lists all apps in the Cloudflare account @@ -188,7 +188,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SFUDeleteResponse]: """ Deletes an app from Cloudflare Calls @@ -232,7 +232,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SFUGetResponse]: """ Fetches details for a single Calls app. @@ -291,13 +291,13 @@ async def create( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SFUCreateResponse]: """Creates a new Cloudflare calls app. @@ -337,13 +337,13 @@ async def update( app_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SFUUpdateResponse]: """ Edit details for a single app. @@ -389,7 +389,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SFUListResponse, AsyncSinglePage[SFUListResponse]]: """ Lists all apps in the Cloudflare account @@ -426,7 +426,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SFUDeleteResponse]: """ Deletes an app from Cloudflare Calls @@ -470,7 +470,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SFUGetResponse]: """ Fetches details for a single Calls app. diff --git a/src/cloudflare/resources/calls/turn.py b/src/cloudflare/resources/calls/turn.py index 0b5eea4f00d..fd7479532c0 100644 --- a/src/cloudflare/resources/calls/turn.py +++ b/src/cloudflare/resources/calls/turn.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,14 +53,14 @@ def create( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TURNCreateResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[TURNCreateResponse]: """ Creates a new Cloudflare Calls TURN key. @@ -83,9 +83,13 @@ def create( f"/accounts/{account_id}/calls/turn_keys", body=maybe_transform({"name": name}, turn_create_params.TURNCreateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[TURNCreateResponse]]._unwrapper, ), - cast_to=TURNCreateResponse, + cast_to=cast(Type[Optional[TURNCreateResponse]], ResultWrapper[TURNCreateResponse]), ) def update( @@ -93,13 +97,13 @@ def update( key_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TURNUpdateResponse]: """ Edit details for a single TURN key. @@ -145,7 +149,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[TURNListResponse]: """ Lists all TURN keys in the Cloudflare account @@ -182,7 +186,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TURNDeleteResponse]: """ Deletes a TURN key from Cloudflare Calls @@ -226,7 +230,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TURNGetResponse]: """ Fetches details for a single TURN key. @@ -285,14 +289,14 @@ async def create( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TURNCreateResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[TURNCreateResponse]: """ Creates a new Cloudflare Calls TURN key. @@ -315,9 +319,13 @@ async def create( f"/accounts/{account_id}/calls/turn_keys", body=await async_maybe_transform({"name": name}, turn_create_params.TURNCreateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[TURNCreateResponse]]._unwrapper, ), - cast_to=TURNCreateResponse, + cast_to=cast(Type[Optional[TURNCreateResponse]], ResultWrapper[TURNCreateResponse]), ) async def update( @@ -325,13 +333,13 @@ async def update( key_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TURNUpdateResponse]: """ Edit details for a single TURN key. @@ -377,7 +385,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TURNListResponse, AsyncSinglePage[TURNListResponse]]: """ Lists all TURN keys in the Cloudflare account @@ -414,7 +422,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TURNDeleteResponse]: """ Deletes a TURN key from Cloudflare Calls @@ -458,7 +466,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TURNGetResponse]: """ Fetches details for a single TURN key. diff --git a/src/cloudflare/resources/certificate_authorities/hostname_associations.py b/src/cloudflare/resources/certificate_authorities/hostname_associations.py index 6d471e29850..6c525f63bca 100644 --- a/src/cloudflare/resources/certificate_authorities/hostname_associations.py +++ b/src/cloudflare/resources/certificate_authorities/hostname_associations.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,14 +50,14 @@ def update( self, *, zone_id: str, - hostnames: List[HostnameAssociation] | NotGiven = NOT_GIVEN, - mtls_certificate_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HostnameAssociationUpdateResponse]: """ Replace Hostname Associations @@ -104,13 +104,13 @@ def get( self, *, zone_id: str, - mtls_certificate_id: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HostnameAssociationGetResponse]: """ List Hostname Associations @@ -173,14 +173,14 @@ async def update( self, *, zone_id: str, - hostnames: List[HostnameAssociation] | NotGiven = NOT_GIVEN, - mtls_certificate_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HostnameAssociationUpdateResponse]: """ Replace Hostname Associations @@ -227,13 +227,13 @@ async def get( self, *, zone_id: str, - mtls_certificate_id: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HostnameAssociationGetResponse]: """ List Hostname Associations diff --git a/src/cloudflare/resources/client_certificates.py b/src/cloudflare/resources/client_certificates.py index 0b17241608e..20409ed85d0 100644 --- a/src/cloudflare/resources/client_certificates.py +++ b/src/cloudflare/resources/client_certificates.py @@ -7,7 +7,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -57,7 +57,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ClientCertificate]: """ Create a new API Shield mTLS Client Certificate @@ -102,18 +102,17 @@ def list( self, *, zone_id: str, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["all", "active", "pending_reactivation", "pending_revocation", "revoked"] - | NotGiven = NOT_GIVEN, + 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, + 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 @@ -174,7 +173,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ClientCertificate]: """ Set a API Shield mTLS Client Certificate to pending_revocation status for @@ -221,7 +220,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ClientCertificate]: """ If a API Shield mTLS Client Certificate is in a pending_revocation state, you @@ -268,7 +267,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ClientCertificate]: """ Get Details for a single mTLS API Shield Client Certificate @@ -336,7 +335,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ClientCertificate]: """ Create a new API Shield mTLS Client Certificate @@ -381,18 +380,17 @@ def list( self, *, zone_id: str, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["all", "active", "pending_reactivation", "pending_revocation", "revoked"] - | NotGiven = NOT_GIVEN, + 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, + 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 @@ -453,7 +451,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ClientCertificate]: """ Set a API Shield mTLS Client Certificate to pending_revocation status for @@ -500,7 +498,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ClientCertificate]: """ If a API Shield mTLS Client Certificate is in a pending_revocation state, you @@ -547,7 +545,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ClientCertificate]: """ Get Details for a single mTLS API Shield Client Certificate diff --git a/src/cloudflare/resources/cloud_connector/rules.py b/src/cloudflare/resources/cloud_connector/rules.py index 4cd0ef179c8..565996aa212 100644 --- a/src/cloudflare/resources/cloud_connector/rules.py +++ b/src/cloudflare/resources/cloud_connector/rules.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,13 +49,13 @@ def update( self, *, zone_id: str, - rules: Iterable[rule_update_params.Rule] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[RuleUpdateResponse]: """ Put Rules @@ -93,7 +93,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[RuleListResponse]: """ Rules @@ -145,13 +145,13 @@ def update( self, *, zone_id: str, - rules: Iterable[rule_update_params.Rule] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RuleUpdateResponse, AsyncSinglePage[RuleUpdateResponse]]: """ Put Rules @@ -189,7 +189,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RuleListResponse, AsyncSinglePage[RuleListResponse]]: """ Rules diff --git a/src/cloudflare/resources/cloudforce_one/__init__.py b/src/cloudflare/resources/cloudforce_one/__init__.py index 0a703327c39..6dede9235d6 100644 --- a/src/cloudflare/resources/cloudforce_one/__init__.py +++ b/src/cloudflare/resources/cloudforce_one/__init__.py @@ -24,6 +24,14 @@ ThreatEventsResourceWithStreamingResponse, AsyncThreatEventsResourceWithStreamingResponse, ) +from .binary_storage import ( + BinaryStorageResource, + AsyncBinaryStorageResource, + BinaryStorageResourceWithRawResponse, + AsyncBinaryStorageResourceWithRawResponse, + BinaryStorageResourceWithStreamingResponse, + AsyncBinaryStorageResourceWithStreamingResponse, +) from .cloudforce_one import ( CloudforceOneResource, AsyncCloudforceOneResource, @@ -40,6 +48,12 @@ "AsyncScansResourceWithRawResponse", "ScansResourceWithStreamingResponse", "AsyncScansResourceWithStreamingResponse", + "BinaryStorageResource", + "AsyncBinaryStorageResource", + "BinaryStorageResourceWithRawResponse", + "AsyncBinaryStorageResourceWithRawResponse", + "BinaryStorageResourceWithStreamingResponse", + "AsyncBinaryStorageResourceWithStreamingResponse", "RequestsResource", "AsyncRequestsResource", "RequestsResourceWithRawResponse", diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/crons.py b/src/cloudflare/resources/cloudforce_one/binary_storage.py similarity index 51% rename from src/cloudflare/resources/cloudforce_one/threat_events/crons.py rename to src/cloudflare/resources/cloudforce_one/binary_storage.py index c7c869c10d3..0fe9078f558 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/crons.py +++ b/src/cloudflare/resources/cloudforce_one/binary_storage.py @@ -2,61 +2,67 @@ from __future__ import annotations +from typing import Mapping, cast + import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ..._types import Body, Query, Headers, NoneType, NotGiven, FileTypes, not_given +from ..._utils import extract_files, maybe_transform, deepcopy_minimal, 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 ...._base_client import make_request_options -from ....types.cloudforce_one.threat_events.cron_edit_response import CronEditResponse -from ....types.cloudforce_one.threat_events.cron_list_response import CronListResponse +from ..._base_client import make_request_options +from ...types.cloudforce_one import binary_storage_create_params +from ...types.cloudforce_one.binary_storage_create_response import BinaryStorageCreateResponse -__all__ = ["CronsResource", "AsyncCronsResource"] +__all__ = ["BinaryStorageResource", "AsyncBinaryStorageResource"] -class CronsResource(SyncAPIResource): +class BinaryStorageResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> CronsResourceWithRawResponse: + def with_raw_response(self) -> BinaryStorageResourceWithRawResponse: """ 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 CronsResourceWithRawResponse(self) + return BinaryStorageResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> CronsResourceWithStreamingResponse: + def with_streaming_response(self) -> BinaryStorageResourceWithStreamingResponse: """ 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 CronsResourceWithStreamingResponse(self) + return BinaryStorageResourceWithStreamingResponse(self) - def list( + def create( self, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CronListResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BinaryStorageCreateResponse: """ - Reads the last cron update time + Posts a file to Binary Storage Args: account_id: Account ID. + file: The binary file content to upload. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -67,16 +73,25 @@ def list( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( - f"/accounts/{account_id}/cloudforce-one/events/cron", + body = deepcopy_minimal({"file": file}) + files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} + return self._post( + f"/accounts/{account_id}/cloudforce-one/binary", + body=maybe_transform(body, binary_storage_create_params.BinaryStorageCreateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CronListResponse, + cast_to=BinaryStorageCreateResponse, ) - def edit( + def get( self, + hash: str, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -84,14 +99,16 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CronEditResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> None: """ - Reads the last cron update time + Retrieves a file from Binary Storage Args: account_id: Account ID. + hash: hash of the binary + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -102,52 +119,58 @@ def edit( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._patch( - f"/accounts/{account_id}/cloudforce-one/events/cron", + if not hash: + raise ValueError(f"Expected a non-empty value for `hash` but received {hash!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._get( + f"/accounts/{account_id}/cloudforce-one/binary/{hash}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CronEditResponse, + cast_to=NoneType, ) -class AsyncCronsResource(AsyncAPIResource): +class AsyncBinaryStorageResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncCronsResourceWithRawResponse: + def with_raw_response(self) -> AsyncBinaryStorageResourceWithRawResponse: """ 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 AsyncCronsResourceWithRawResponse(self) + return AsyncBinaryStorageResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncCronsResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncBinaryStorageResourceWithStreamingResponse: """ 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 AsyncCronsResourceWithStreamingResponse(self) + return AsyncBinaryStorageResourceWithStreamingResponse(self) - async def list( + async def create( self, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CronListResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BinaryStorageCreateResponse: """ - Reads the last cron update time + Posts a file to Binary Storage Args: account_id: Account ID. + file: The binary file content to upload. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -158,16 +181,25 @@ async def list( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( - f"/accounts/{account_id}/cloudforce-one/events/cron", + body = deepcopy_minimal({"file": file}) + files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} + return await self._post( + f"/accounts/{account_id}/cloudforce-one/binary", + body=await async_maybe_transform(body, binary_storage_create_params.BinaryStorageCreateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CronListResponse, + cast_to=BinaryStorageCreateResponse, ) - async def edit( + async def get( self, + hash: str, *, account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -175,14 +207,16 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CronEditResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> None: """ - Reads the last cron update time + Retrieves a file from Binary Storage Args: account_id: Account ID. + hash: hash of the binary + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -193,58 +227,61 @@ async def edit( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._patch( - f"/accounts/{account_id}/cloudforce-one/events/cron", + if not hash: + raise ValueError(f"Expected a non-empty value for `hash` but received {hash!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._get( + f"/accounts/{account_id}/cloudforce-one/binary/{hash}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CronEditResponse, + cast_to=NoneType, ) -class CronsResourceWithRawResponse: - def __init__(self, crons: CronsResource) -> None: - self._crons = crons +class BinaryStorageResourceWithRawResponse: + def __init__(self, binary_storage: BinaryStorageResource) -> None: + self._binary_storage = binary_storage - self.list = to_raw_response_wrapper( - crons.list, + self.create = to_raw_response_wrapper( + binary_storage.create, ) - self.edit = to_raw_response_wrapper( - crons.edit, + self.get = to_raw_response_wrapper( + binary_storage.get, ) -class AsyncCronsResourceWithRawResponse: - def __init__(self, crons: AsyncCronsResource) -> None: - self._crons = crons +class AsyncBinaryStorageResourceWithRawResponse: + def __init__(self, binary_storage: AsyncBinaryStorageResource) -> None: + self._binary_storage = binary_storage - self.list = async_to_raw_response_wrapper( - crons.list, + self.create = async_to_raw_response_wrapper( + binary_storage.create, ) - self.edit = async_to_raw_response_wrapper( - crons.edit, + self.get = async_to_raw_response_wrapper( + binary_storage.get, ) -class CronsResourceWithStreamingResponse: - def __init__(self, crons: CronsResource) -> None: - self._crons = crons +class BinaryStorageResourceWithStreamingResponse: + def __init__(self, binary_storage: BinaryStorageResource) -> None: + self._binary_storage = binary_storage - self.list = to_streamed_response_wrapper( - crons.list, + self.create = to_streamed_response_wrapper( + binary_storage.create, ) - self.edit = to_streamed_response_wrapper( - crons.edit, + self.get = to_streamed_response_wrapper( + binary_storage.get, ) -class AsyncCronsResourceWithStreamingResponse: - def __init__(self, crons: AsyncCronsResource) -> None: - self._crons = crons +class AsyncBinaryStorageResourceWithStreamingResponse: + def __init__(self, binary_storage: AsyncBinaryStorageResource) -> None: + self._binary_storage = binary_storage - self.list = async_to_streamed_response_wrapper( - crons.list, + self.create = async_to_streamed_response_wrapper( + binary_storage.create, ) - self.edit = async_to_streamed_response_wrapper( - crons.edit, + self.get = async_to_streamed_response_wrapper( + binary_storage.get, ) diff --git a/src/cloudflare/resources/cloudforce_one/cloudforce_one.py b/src/cloudflare/resources/cloudforce_one/cloudforce_one.py index 889e3108322..9e8c0f29a09 100644 --- a/src/cloudflare/resources/cloudforce_one/cloudforce_one.py +++ b/src/cloudflare/resources/cloudforce_one/cloudforce_one.py @@ -12,6 +12,14 @@ ScansResourceWithStreamingResponse, AsyncScansResourceWithStreamingResponse, ) +from .binary_storage import ( + BinaryStorageResource, + AsyncBinaryStorageResource, + BinaryStorageResourceWithRawResponse, + AsyncBinaryStorageResourceWithRawResponse, + BinaryStorageResourceWithStreamingResponse, + AsyncBinaryStorageResourceWithStreamingResponse, +) from .requests.requests import ( RequestsResource, AsyncRequestsResource, @@ -37,6 +45,10 @@ class CloudforceOneResource(SyncAPIResource): def scans(self) -> ScansResource: return ScansResource(self._client) + @cached_property + def binary_storage(self) -> BinaryStorageResource: + return BinaryStorageResource(self._client) + @cached_property def requests(self) -> RequestsResource: return RequestsResource(self._client) @@ -70,6 +82,10 @@ class AsyncCloudforceOneResource(AsyncAPIResource): def scans(self) -> AsyncScansResource: return AsyncScansResource(self._client) + @cached_property + def binary_storage(self) -> AsyncBinaryStorageResource: + return AsyncBinaryStorageResource(self._client) + @cached_property def requests(self) -> AsyncRequestsResource: return AsyncRequestsResource(self._client) @@ -106,6 +122,10 @@ def __init__(self, cloudforce_one: CloudforceOneResource) -> None: def scans(self) -> ScansResourceWithRawResponse: return ScansResourceWithRawResponse(self._cloudforce_one.scans) + @cached_property + def binary_storage(self) -> BinaryStorageResourceWithRawResponse: + return BinaryStorageResourceWithRawResponse(self._cloudforce_one.binary_storage) + @cached_property def requests(self) -> RequestsResourceWithRawResponse: return RequestsResourceWithRawResponse(self._cloudforce_one.requests) @@ -123,6 +143,10 @@ def __init__(self, cloudforce_one: AsyncCloudforceOneResource) -> None: def scans(self) -> AsyncScansResourceWithRawResponse: return AsyncScansResourceWithRawResponse(self._cloudforce_one.scans) + @cached_property + def binary_storage(self) -> AsyncBinaryStorageResourceWithRawResponse: + return AsyncBinaryStorageResourceWithRawResponse(self._cloudforce_one.binary_storage) + @cached_property def requests(self) -> AsyncRequestsResourceWithRawResponse: return AsyncRequestsResourceWithRawResponse(self._cloudforce_one.requests) @@ -140,6 +164,10 @@ def __init__(self, cloudforce_one: CloudforceOneResource) -> None: def scans(self) -> ScansResourceWithStreamingResponse: return ScansResourceWithStreamingResponse(self._cloudforce_one.scans) + @cached_property + def binary_storage(self) -> BinaryStorageResourceWithStreamingResponse: + return BinaryStorageResourceWithStreamingResponse(self._cloudforce_one.binary_storage) + @cached_property def requests(self) -> RequestsResourceWithStreamingResponse: return RequestsResourceWithStreamingResponse(self._cloudforce_one.requests) @@ -157,6 +185,10 @@ def __init__(self, cloudforce_one: AsyncCloudforceOneResource) -> None: def scans(self) -> AsyncScansResourceWithStreamingResponse: return AsyncScansResourceWithStreamingResponse(self._cloudforce_one.scans) + @cached_property + def binary_storage(self) -> AsyncBinaryStorageResourceWithStreamingResponse: + return AsyncBinaryStorageResourceWithStreamingResponse(self._cloudforce_one.binary_storage) + @cached_property def requests(self) -> AsyncRequestsResourceWithStreamingResponse: return AsyncRequestsResourceWithStreamingResponse(self._cloudforce_one.requests) diff --git a/src/cloudflare/resources/cloudforce_one/requests/assets.py b/src/cloudflare/resources/cloudforce_one/requests/assets.py index cbf155a797c..95ff2c31f11 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/assets.py +++ b/src/cloudflare/resources/cloudforce_one/requests/assets.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -60,7 +60,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[AssetCreateResponse]: """ List Request Assets @@ -109,13 +109,13 @@ def update( *, account_id: str, request_id: str, - source: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AssetUpdateResponse]: """ Update a Request Asset @@ -167,7 +167,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AssetDeleteResponse: """ Delete a Request Asset @@ -212,7 +212,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[AssetGetResponse]: """ Get a Request Asset @@ -280,7 +280,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AssetCreateResponse, AsyncSinglePage[AssetCreateResponse]]: """ List Request Assets @@ -329,13 +329,13 @@ async def update( *, account_id: str, request_id: str, - source: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AssetUpdateResponse]: """ Update a Request Asset @@ -387,7 +387,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AssetDeleteResponse: """ Delete a Request Asset @@ -432,7 +432,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AssetGetResponse, AsyncSinglePage[AssetGetResponse]]: """ Get a Request Asset diff --git a/src/cloudflare/resources/cloudforce_one/requests/message.py b/src/cloudflare/resources/cloudforce_one/requests/message.py index fd15e6bc467..e866faf090e 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/message.py +++ b/src/cloudflare/resources/cloudforce_one/requests/message.py @@ -8,7 +8,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,13 +53,13 @@ def create( request_id: str, *, account_id: str, - content: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Message]: """ Create a New Request Message @@ -102,13 +102,13 @@ def update( *, account_id: str, request_id: str, - content: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Message]: """ Update a Request Message @@ -156,7 +156,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessageDeleteResponse: """ Delete a Request Message @@ -193,16 +193,16 @@ def get( account_id: str, page: int, per_page: int, - after: Union[str, datetime] | NotGiven = NOT_GIVEN, - before: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort_by: str | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + after: Union[str, datetime] | Omit = omit, + before: Union[str, datetime] | Omit = omit, + sort_by: str | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Message]: """ List Request Messages @@ -283,13 +283,13 @@ async def create( request_id: str, *, account_id: str, - content: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Message]: """ Create a New Request Message @@ -332,13 +332,13 @@ async def update( *, account_id: str, request_id: str, - content: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Message]: """ Update a Request Message @@ -386,7 +386,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessageDeleteResponse: """ Delete a Request Message @@ -423,16 +423,16 @@ def get( account_id: str, page: int, per_page: int, - after: Union[str, datetime] | NotGiven = NOT_GIVEN, - before: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort_by: str | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + after: Union[str, datetime] | Omit = omit, + before: Union[str, datetime] | Omit = omit, + sort_by: str | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Message, AsyncSinglePage[Message]]: """ List Request Messages diff --git a/src/cloudflare/resources/cloudforce_one/requests/priority.py b/src/cloudflare/resources/cloudforce_one/requests/priority.py index a815642bef9..080a4a12efd 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/priority.py +++ b/src/cloudflare/resources/cloudforce_one/requests/priority.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -53,7 +53,7 @@ def create( self, *, account_id: str, - labels: List[Label], + labels: SequenceNotStr[Label], priority: int, requirement: str, tlp: Literal["clear", "amber", "amber-strict", "green", "red"], @@ -62,7 +62,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Priority]: """ Create a New Priority Intelligence Requirement @@ -114,7 +114,7 @@ def update( priority_id: str, *, account_id: str, - labels: List[Label], + labels: SequenceNotStr[Label], priority: int, requirement: str, tlp: Literal["clear", "amber", "amber-strict", "green", "red"], @@ -123,7 +123,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Item]: """ Update a Priority Intelligence Requirement @@ -184,7 +184,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PriorityDeleteResponse: """ Delete a Priority Intelligence Requirement @@ -224,7 +224,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Item]: """ Get a Priority Intelligence Requirement @@ -267,7 +267,7 @@ def quota( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Quota]: """ Get Priority Intelligence Requirement Quota @@ -322,7 +322,7 @@ async def create( self, *, account_id: str, - labels: List[Label], + labels: SequenceNotStr[Label], priority: int, requirement: str, tlp: Literal["clear", "amber", "amber-strict", "green", "red"], @@ -331,7 +331,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Priority]: """ Create a New Priority Intelligence Requirement @@ -383,7 +383,7 @@ async def update( priority_id: str, *, account_id: str, - labels: List[Label], + labels: SequenceNotStr[Label], priority: int, requirement: str, tlp: Literal["clear", "amber", "amber-strict", "green", "red"], @@ -392,7 +392,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Item]: """ Update a Priority Intelligence Requirement @@ -453,7 +453,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PriorityDeleteResponse: """ Delete a Priority Intelligence Requirement @@ -493,7 +493,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Item]: """ Get a Priority Intelligence Requirement @@ -536,7 +536,7 @@ async def quota( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Quota]: """ Get Priority Intelligence Requirement Quota diff --git a/src/cloudflare/resources/cloudforce_one/requests/requests.py b/src/cloudflare/resources/cloudforce_one/requests/requests.py index e835b245d07..232f8c6f8b2 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/requests.py +++ b/src/cloudflare/resources/cloudforce_one/requests/requests.py @@ -32,7 +32,7 @@ PriorityResourceWithStreamingResponse, AsyncPriorityResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -92,17 +92,17 @@ def create( self, *, account_id: str, - content: str | NotGiven = NOT_GIVEN, - priority: str | NotGiven = NOT_GIVEN, - request_type: str | NotGiven = NOT_GIVEN, - summary: str | NotGiven = NOT_GIVEN, - tlp: Literal["clear", "amber", "amber-strict", "green", "red"] | NotGiven = NOT_GIVEN, + content: str | Omit = omit, + priority: str | Omit = omit, + request_type: str | Omit = omit, + summary: str | Omit = omit, + tlp: Literal["clear", "amber", "amber-strict", "green", "red"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Item]: """ Creating a request adds the request into the Cloudforce One queue for analysis. @@ -159,17 +159,17 @@ def update( request_id: str, *, account_id: str, - content: str | NotGiven = NOT_GIVEN, - priority: str | NotGiven = NOT_GIVEN, - request_type: str | NotGiven = NOT_GIVEN, - summary: str | NotGiven = NOT_GIVEN, - tlp: Literal["clear", "amber", "amber-strict", "green", "red"] | NotGiven = NOT_GIVEN, + content: str | Omit = omit, + priority: str | Omit = omit, + request_type: str | Omit = omit, + summary: str | Omit = omit, + tlp: Literal["clear", "amber", "amber-strict", "green", "red"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Item]: """Updating a request alters the request in the Cloudforce One queue. @@ -232,20 +232,20 @@ def list( account_id: str, page: int, per_page: int, - completed_after: Union[str, datetime] | NotGiven = NOT_GIVEN, - completed_before: Union[str, datetime] | NotGiven = NOT_GIVEN, - created_after: Union[str, datetime] | NotGiven = NOT_GIVEN, - created_before: Union[str, datetime] | NotGiven = NOT_GIVEN, - request_type: str | NotGiven = NOT_GIVEN, - sort_by: str | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - status: Literal["open", "accepted", "reported", "approved", "completed", "declined"] | NotGiven = NOT_GIVEN, + completed_after: Union[str, datetime] | Omit = omit, + completed_before: Union[str, datetime] | Omit = omit, + created_after: Union[str, datetime] | Omit = omit, + created_before: Union[str, datetime] | Omit = omit, + request_type: str | Omit = omit, + sort_by: str | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, + status: Literal["open", "accepted", "reported", "approved", "completed", "declined"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ListItem]: """ List Requests @@ -318,7 +318,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RequestDeleteResponse: """ Delete a Request @@ -357,7 +357,7 @@ def constants( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RequestConstants]: """ Get Request Priority, Status, and TLP constants @@ -397,7 +397,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Item]: """ Get a Request @@ -440,7 +440,7 @@ def quota( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Quota]: """ Get Request Quota @@ -479,7 +479,7 @@ def types( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[RequestTypesResponse]: """ Get Request Types @@ -543,17 +543,17 @@ async def create( self, *, account_id: str, - content: str | NotGiven = NOT_GIVEN, - priority: str | NotGiven = NOT_GIVEN, - request_type: str | NotGiven = NOT_GIVEN, - summary: str | NotGiven = NOT_GIVEN, - tlp: Literal["clear", "amber", "amber-strict", "green", "red"] | NotGiven = NOT_GIVEN, + content: str | Omit = omit, + priority: str | Omit = omit, + request_type: str | Omit = omit, + summary: str | Omit = omit, + tlp: Literal["clear", "amber", "amber-strict", "green", "red"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Item]: """ Creating a request adds the request into the Cloudforce One queue for analysis. @@ -610,17 +610,17 @@ async def update( request_id: str, *, account_id: str, - content: str | NotGiven = NOT_GIVEN, - priority: str | NotGiven = NOT_GIVEN, - request_type: str | NotGiven = NOT_GIVEN, - summary: str | NotGiven = NOT_GIVEN, - tlp: Literal["clear", "amber", "amber-strict", "green", "red"] | NotGiven = NOT_GIVEN, + content: str | Omit = omit, + priority: str | Omit = omit, + request_type: str | Omit = omit, + summary: str | Omit = omit, + tlp: Literal["clear", "amber", "amber-strict", "green", "red"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Item]: """Updating a request alters the request in the Cloudforce One queue. @@ -683,20 +683,20 @@ def list( account_id: str, page: int, per_page: int, - completed_after: Union[str, datetime] | NotGiven = NOT_GIVEN, - completed_before: Union[str, datetime] | NotGiven = NOT_GIVEN, - created_after: Union[str, datetime] | NotGiven = NOT_GIVEN, - created_before: Union[str, datetime] | NotGiven = NOT_GIVEN, - request_type: str | NotGiven = NOT_GIVEN, - sort_by: str | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - status: Literal["open", "accepted", "reported", "approved", "completed", "declined"] | NotGiven = NOT_GIVEN, + completed_after: Union[str, datetime] | Omit = omit, + completed_before: Union[str, datetime] | Omit = omit, + created_after: Union[str, datetime] | Omit = omit, + created_before: Union[str, datetime] | Omit = omit, + request_type: str | Omit = omit, + sort_by: str | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, + status: Literal["open", "accepted", "reported", "approved", "completed", "declined"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ListItem, AsyncSinglePage[ListItem]]: """ List Requests @@ -769,7 +769,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RequestDeleteResponse: """ Delete a Request @@ -808,7 +808,7 @@ async def constants( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RequestConstants]: """ Get Request Priority, Status, and TLP constants @@ -848,7 +848,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Item]: """ Get a Request @@ -891,7 +891,7 @@ async def quota( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Quota]: """ Get Request Quota @@ -930,7 +930,7 @@ def types( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RequestTypesResponse, AsyncSinglePage[RequestTypesResponse]]: """ Get Request Types diff --git a/src/cloudflare/resources/cloudforce_one/scans/config.py b/src/cloudflare/resources/cloudforce_one/scans/config.py index 206345c48cd..4f30d5341a1 100644 --- a/src/cloudflare/resources/cloudforce_one/scans/config.py +++ b/src/cloudflare/resources/cloudforce_one/scans/config.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,15 +51,15 @@ def create( self, *, account_id: str, - ips: List[str], - frequency: float | NotGiven = NOT_GIVEN, - ports: List[str] | NotGiven = NOT_GIVEN, + ips: SequenceNotStr[str], + frequency: float | Omit = omit, + ports: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigCreateResponse]: """ Create a new Scan Config @@ -115,7 +115,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ConfigListResponse]: """ List Scan Configs @@ -152,7 +152,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a Scan Config @@ -191,15 +191,15 @@ def edit( config_id: str, *, account_id: str, - frequency: float | NotGiven = NOT_GIVEN, - ips: List[str] | NotGiven = NOT_GIVEN, - ports: List[str] | NotGiven = NOT_GIVEN, + frequency: float | Omit = omit, + ips: SequenceNotStr[str] | Omit = omit, + ports: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigEditResponse]: """ Update an existing Scan Config @@ -275,15 +275,15 @@ async def create( self, *, account_id: str, - ips: List[str], - frequency: float | NotGiven = NOT_GIVEN, - ports: List[str] | NotGiven = NOT_GIVEN, + ips: SequenceNotStr[str], + frequency: float | Omit = omit, + ports: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigCreateResponse]: """ Create a new Scan Config @@ -339,7 +339,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ConfigListResponse, AsyncSinglePage[ConfigListResponse]]: """ List Scan Configs @@ -376,7 +376,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a Scan Config @@ -415,15 +415,15 @@ async def edit( config_id: str, *, account_id: str, - frequency: float | NotGiven = NOT_GIVEN, - ips: List[str] | NotGiven = NOT_GIVEN, - ports: List[str] | NotGiven = NOT_GIVEN, + frequency: float | Omit = omit, + ips: SequenceNotStr[str] | Omit = omit, + ports: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigEditResponse]: """ Update an existing Scan Config diff --git a/src/cloudflare/resources/cloudforce_one/scans/results.py b/src/cloudflare/resources/cloudforce_one/scans/results.py index 6cda0627983..30bc7294fd2 100644 --- a/src/cloudflare/resources/cloudforce_one/scans/results.py +++ b/src/cloudflare/resources/cloudforce_one/scans/results.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ResultGetResponse: """ Get the Latest Scan Result @@ -117,7 +117,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ResultGetResponse: """ Get the Latest Scan Result diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/__init__.py b/src/cloudflare/resources/cloudforce_one/threat_events/__init__.py index b25651cac31..6c1b93c2881 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/__init__.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/__init__.py @@ -16,14 +16,6 @@ TagsResourceWithStreamingResponse, AsyncTagsResourceWithStreamingResponse, ) -from .crons import ( - CronsResource, - AsyncCronsResource, - CronsResourceWithRawResponse, - AsyncCronsResourceWithRawResponse, - CronsResourceWithStreamingResponse, - AsyncCronsResourceWithStreamingResponse, -) from .relate import ( RelateResource, AsyncRelateResource, @@ -40,14 +32,6 @@ DatasetsResourceWithStreamingResponse, AsyncDatasetsResourceWithStreamingResponse, ) -from .insights import ( - InsightsResource, - AsyncInsightsResource, - InsightsResourceWithRawResponse, - AsyncInsightsResourceWithRawResponse, - InsightsResourceWithStreamingResponse, - AsyncInsightsResourceWithStreamingResponse, -) from .attackers import ( AttackersResource, AsyncAttackersResource, @@ -124,12 +108,6 @@ "AsyncCountriesResourceWithRawResponse", "CountriesResourceWithStreamingResponse", "AsyncCountriesResourceWithStreamingResponse", - "CronsResource", - "AsyncCronsResource", - "CronsResourceWithRawResponse", - "AsyncCronsResourceWithRawResponse", - "CronsResourceWithStreamingResponse", - "AsyncCronsResourceWithStreamingResponse", "DatasetsResource", "AsyncDatasetsResource", "DatasetsResourceWithRawResponse", @@ -172,12 +150,6 @@ "AsyncTargetIndustriesResourceWithRawResponse", "TargetIndustriesResourceWithStreamingResponse", "AsyncTargetIndustriesResourceWithStreamingResponse", - "InsightsResource", - "AsyncInsightsResource", - "InsightsResourceWithRawResponse", - "AsyncInsightsResourceWithRawResponse", - "InsightsResourceWithStreamingResponse", - "AsyncInsightsResourceWithStreamingResponse", "ThreatEventsResource", "AsyncThreatEventsResource", "ThreatEventsResourceWithRawResponse", diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py b/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py index e7ea6619101..0bb5603dfc0 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -48,7 +48,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AttackerListResponse: """ Lists attackers @@ -104,7 +104,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AttackerListResponse: """ Lists attackers diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/categories.py b/src/cloudflare/resources/cloudforce_one/threat_events/categories.py index 2fdb0ac0af6..7cf264a3641 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/categories.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/categories.py @@ -2,11 +2,9 @@ from __future__ import annotations -from typing import List - import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,14 +51,14 @@ def create( account_id: str, kill_chain: float, name: str, - mitre_attack: List[str] | NotGiven = NOT_GIVEN, - shortname: str | NotGiven = NOT_GIVEN, + mitre_attack: SequenceNotStr[str] | Omit = omit, + shortname: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryCreateResponse: """ Creates a new category @@ -104,7 +102,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryListResponse: """ Lists categories @@ -140,7 +138,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryDeleteResponse: """ Deletes a category @@ -175,16 +173,16 @@ def edit( category_id: str, *, account_id: str, - kill_chain: float | NotGiven = NOT_GIVEN, - mitre_attack: List[str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - shortname: str | NotGiven = NOT_GIVEN, + kill_chain: float | Omit = omit, + mitre_attack: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, + shortname: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryEditResponse: """ Updates a category @@ -233,7 +231,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryGetResponse: """ Reads a category @@ -290,14 +288,14 @@ async def create( account_id: str, kill_chain: float, name: str, - mitre_attack: List[str] | NotGiven = NOT_GIVEN, - shortname: str | NotGiven = NOT_GIVEN, + mitre_attack: SequenceNotStr[str] | Omit = omit, + shortname: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryCreateResponse: """ Creates a new category @@ -341,7 +339,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryListResponse: """ Lists categories @@ -377,7 +375,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryDeleteResponse: """ Deletes a category @@ -412,16 +410,16 @@ async def edit( category_id: str, *, account_id: str, - kill_chain: float | NotGiven = NOT_GIVEN, - mitre_attack: List[str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - shortname: str | NotGiven = NOT_GIVEN, + kill_chain: float | Omit = omit, + mitre_attack: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, + shortname: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryEditResponse: """ Updates a category @@ -470,7 +468,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CategoryGetResponse: """ Reads a category diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/countries.py b/src/cloudflare/resources/cloudforce_one/threat_events/countries.py index 2aff1d3f293..c413c5650b4 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/countries.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/countries.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -48,7 +48,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CountryListResponse: """ Retrieves countries information for all countries @@ -104,7 +104,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CountryListResponse: """ Retrieves countries information for all countries diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/datasets/__init__.py b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/__init__.py index 678a74c3cf1..af825c8e995 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/datasets/__init__.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .health import ( - HealthResource, - AsyncHealthResource, - HealthResourceWithRawResponse, - AsyncHealthResourceWithRawResponse, - HealthResourceWithStreamingResponse, - AsyncHealthResourceWithStreamingResponse, -) from .datasets import ( DatasetsResource, AsyncDatasetsResource, @@ -18,12 +10,6 @@ ) __all__ = [ - "HealthResource", - "AsyncHealthResource", - "HealthResourceWithRawResponse", - "AsyncHealthResourceWithRawResponse", - "HealthResourceWithStreamingResponse", - "AsyncHealthResourceWithStreamingResponse", "DatasetsResource", "AsyncDatasetsResource", "DatasetsResourceWithRawResponse", diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py index b0f839c7070..6a430786bc9 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py @@ -4,15 +4,7 @@ import httpx -from .health import ( - HealthResource, - AsyncHealthResource, - HealthResourceWithRawResponse, - AsyncHealthResourceWithRawResponse, - HealthResourceWithStreamingResponse, - AsyncHealthResourceWithStreamingResponse, -) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -34,10 +26,6 @@ class DatasetsResource(SyncAPIResource): - @cached_property - def health(self) -> HealthResource: - return HealthResource(self._client) - @cached_property def with_raw_response(self) -> DatasetsResourceWithRawResponse: """ @@ -68,7 +56,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetCreateResponse: """ Creates a dataset @@ -115,7 +103,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetListResponse: """ Lists all datasets in an account @@ -153,7 +141,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetEditResponse: """ Updates an existing dataset @@ -205,7 +193,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetGetResponse: """ Reads a dataset @@ -246,7 +234,7 @@ def raw( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetRawResponse: """ Reads data for a raw event @@ -282,10 +270,6 @@ def raw( class AsyncDatasetsResource(AsyncAPIResource): - @cached_property - def health(self) -> AsyncHealthResource: - return AsyncHealthResource(self._client) - @cached_property def with_raw_response(self) -> AsyncDatasetsResourceWithRawResponse: """ @@ -316,7 +300,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetCreateResponse: """ Creates a dataset @@ -363,7 +347,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetListResponse: """ Lists all datasets in an account @@ -401,7 +385,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetEditResponse: """ Updates an existing dataset @@ -453,7 +437,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetGetResponse: """ Reads a dataset @@ -494,7 +478,7 @@ async def raw( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetRawResponse: """ Reads data for a raw event @@ -549,10 +533,6 @@ def __init__(self, datasets: DatasetsResource) -> None: datasets.raw, ) - @cached_property - def health(self) -> HealthResourceWithRawResponse: - return HealthResourceWithRawResponse(self._datasets.health) - class AsyncDatasetsResourceWithRawResponse: def __init__(self, datasets: AsyncDatasetsResource) -> None: @@ -574,10 +554,6 @@ def __init__(self, datasets: AsyncDatasetsResource) -> None: datasets.raw, ) - @cached_property - def health(self) -> AsyncHealthResourceWithRawResponse: - return AsyncHealthResourceWithRawResponse(self._datasets.health) - class DatasetsResourceWithStreamingResponse: def __init__(self, datasets: DatasetsResource) -> None: @@ -599,10 +575,6 @@ def __init__(self, datasets: DatasetsResource) -> None: datasets.raw, ) - @cached_property - def health(self) -> HealthResourceWithStreamingResponse: - return HealthResourceWithStreamingResponse(self._datasets.health) - class AsyncDatasetsResourceWithStreamingResponse: def __init__(self, datasets: AsyncDatasetsResource) -> None: @@ -623,7 +595,3 @@ def __init__(self, datasets: AsyncDatasetsResource) -> None: self.raw = async_to_streamed_response_wrapper( datasets.raw, ) - - @cached_property - def health(self) -> AsyncHealthResourceWithStreamingResponse: - return AsyncHealthResourceWithStreamingResponse(self._datasets.health) 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 8727db58a68..67ce4f627f8 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/event_tags.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/event_tags.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import Type, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -50,13 +50,13 @@ def create( event_id: str, *, account_id: str, - tags: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventTagCreateResponse: """ Adds a tag to an event @@ -101,7 +101,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventTagDeleteResponse: """ Removes a tag from an event @@ -161,13 +161,13 @@ async def create( event_id: str, *, account_id: str, - tags: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventTagCreateResponse: """ Adds a tag to an event @@ -212,7 +212,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventTagDeleteResponse: """ Removes a tag from an event 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 5e0345f7e61..70e20938124 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/indicator_types.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/indicator_types.py @@ -2,9 +2,11 @@ from __future__ import annotations +import typing_extensions + import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -39,6 +41,7 @@ def with_streaming_response(self) -> IndicatorTypesResourceWithStreamingResponse """ return IndicatorTypesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -48,10 +51,12 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IndicatorTypeListResponse: - """ - Lists all indicator types + """This Method is deprecated. + + Please use /events/dataset/:dataset_id/indicatorTypes + instead. Args: account_id: Account ID. @@ -95,6 +100,7 @@ def with_streaming_response(self) -> AsyncIndicatorTypesResourceWithStreamingRes """ return AsyncIndicatorTypesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def list( self, *, @@ -104,10 +110,12 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IndicatorTypeListResponse: - """ - Lists all indicator types + """This Method is deprecated. + + Please use /events/dataset/:dataset_id/indicatorTypes + instead. Args: account_id: Account ID. @@ -135,8 +143,10 @@ class IndicatorTypesResourceWithRawResponse: def __init__(self, indicator_types: IndicatorTypesResource) -> None: self._indicator_types = indicator_types - self.list = to_raw_response_wrapper( - indicator_types.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + indicator_types.list, # pyright: ignore[reportDeprecated], + ) ) @@ -144,8 +154,10 @@ class AsyncIndicatorTypesResourceWithRawResponse: def __init__(self, indicator_types: AsyncIndicatorTypesResource) -> None: self._indicator_types = indicator_types - self.list = async_to_raw_response_wrapper( - indicator_types.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + indicator_types.list, # pyright: ignore[reportDeprecated], + ) ) @@ -153,8 +165,10 @@ class IndicatorTypesResourceWithStreamingResponse: def __init__(self, indicator_types: IndicatorTypesResource) -> None: self._indicator_types = indicator_types - self.list = to_streamed_response_wrapper( - indicator_types.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + indicator_types.list, # pyright: ignore[reportDeprecated], + ) ) @@ -162,6 +176,8 @@ class AsyncIndicatorTypesResourceWithStreamingResponse: def __init__(self, indicator_types: AsyncIndicatorTypesResource) -> None: self._indicator_types = indicator_types - self.list = async_to_streamed_response_wrapper( - indicator_types.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + indicator_types.list, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/insights.py b/src/cloudflare/resources/cloudforce_one/threat_events/insights.py deleted file mode 100644 index 97373be775d..00000000000 --- a/src/cloudflare/resources/cloudforce_one/threat_events/insights.py +++ /dev/null @@ -1,531 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, cast - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -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.cloudforce_one.threat_events import insight_edit_params, insight_create_params -from ....types.cloudforce_one.threat_events.insight_get_response import InsightGetResponse -from ....types.cloudforce_one.threat_events.insight_edit_response import InsightEditResponse -from ....types.cloudforce_one.threat_events.insight_create_response import InsightCreateResponse -from ....types.cloudforce_one.threat_events.insight_delete_response import InsightDeleteResponse - -__all__ = ["InsightsResource", "AsyncInsightsResource"] - - -class InsightsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> InsightsResourceWithRawResponse: - """ - 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 InsightsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> InsightsResourceWithStreamingResponse: - """ - 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 InsightsResourceWithStreamingResponse(self) - - def create( - self, - event_id: str, - *, - account_id: str, - content: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InsightCreateResponse: - """ - Adds an insight to an event - - Args: - account_id: Account ID. - - event_id: Event UUID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 event_id: - raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") - return self._post( - f"/accounts/{account_id}/cloudforce-one/events/{event_id}/insight/create", - body=maybe_transform({"content": content}, insight_create_params.InsightCreateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[InsightCreateResponse]._unwrapper, - ), - cast_to=cast(Type[InsightCreateResponse], ResultWrapper[InsightCreateResponse]), - ) - - def delete( - self, - insight_id: str, - *, - 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InsightDeleteResponse: - """ - Deletes an event insight - - Args: - account_id: Account ID. - - event_id: Event UUID. - - insight_id: Insight UUID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 event_id: - raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") - if not insight_id: - raise ValueError(f"Expected a non-empty value for `insight_id` but received {insight_id!r}") - return self._delete( - f"/accounts/{account_id}/cloudforce-one/events/{event_id}/insight/{insight_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[InsightDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[InsightDeleteResponse], ResultWrapper[InsightDeleteResponse]), - ) - - def edit( - self, - insight_id: str, - *, - account_id: str, - event_id: str, - content: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InsightEditResponse: - """ - Updates an event insight - - Args: - account_id: Account ID. - - event_id: Event UUID. - - insight_id: Insight UUID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 event_id: - raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") - if not insight_id: - raise ValueError(f"Expected a non-empty value for `insight_id` but received {insight_id!r}") - return self._patch( - f"/accounts/{account_id}/cloudforce-one/events/{event_id}/insight/{insight_id}", - body=maybe_transform({"content": content}, insight_edit_params.InsightEditParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[InsightEditResponse]._unwrapper, - ), - cast_to=cast(Type[InsightEditResponse], ResultWrapper[InsightEditResponse]), - ) - - def get( - self, - insight_id: str, - *, - 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InsightGetResponse: - """ - Reads an event insight - - Args: - account_id: Account ID. - - event_id: Event UUID. - - insight_id: Insight UUID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 event_id: - raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") - if not insight_id: - raise ValueError(f"Expected a non-empty value for `insight_id` but received {insight_id!r}") - return self._get( - f"/accounts/{account_id}/cloudforce-one/events/{event_id}/insight/{insight_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[InsightGetResponse]._unwrapper, - ), - cast_to=cast(Type[InsightGetResponse], ResultWrapper[InsightGetResponse]), - ) - - -class AsyncInsightsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncInsightsResourceWithRawResponse: - """ - 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 AsyncInsightsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncInsightsResourceWithStreamingResponse: - """ - 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 AsyncInsightsResourceWithStreamingResponse(self) - - async def create( - self, - event_id: str, - *, - account_id: str, - content: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InsightCreateResponse: - """ - Adds an insight to an event - - Args: - account_id: Account ID. - - event_id: Event UUID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 event_id: - raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") - return await self._post( - f"/accounts/{account_id}/cloudforce-one/events/{event_id}/insight/create", - body=await async_maybe_transform({"content": content}, insight_create_params.InsightCreateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[InsightCreateResponse]._unwrapper, - ), - cast_to=cast(Type[InsightCreateResponse], ResultWrapper[InsightCreateResponse]), - ) - - async def delete( - self, - insight_id: str, - *, - 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InsightDeleteResponse: - """ - Deletes an event insight - - Args: - account_id: Account ID. - - event_id: Event UUID. - - insight_id: Insight UUID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 event_id: - raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") - if not insight_id: - raise ValueError(f"Expected a non-empty value for `insight_id` but received {insight_id!r}") - return await self._delete( - f"/accounts/{account_id}/cloudforce-one/events/{event_id}/insight/{insight_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[InsightDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[InsightDeleteResponse], ResultWrapper[InsightDeleteResponse]), - ) - - async def edit( - self, - insight_id: str, - *, - account_id: str, - event_id: str, - content: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InsightEditResponse: - """ - Updates an event insight - - Args: - account_id: Account ID. - - event_id: Event UUID. - - insight_id: Insight UUID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 event_id: - raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") - if not insight_id: - raise ValueError(f"Expected a non-empty value for `insight_id` but received {insight_id!r}") - return await self._patch( - f"/accounts/{account_id}/cloudforce-one/events/{event_id}/insight/{insight_id}", - body=await async_maybe_transform({"content": content}, insight_edit_params.InsightEditParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[InsightEditResponse]._unwrapper, - ), - cast_to=cast(Type[InsightEditResponse], ResultWrapper[InsightEditResponse]), - ) - - async def get( - self, - insight_id: str, - *, - 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. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InsightGetResponse: - """ - Reads an event insight - - Args: - account_id: Account ID. - - event_id: Event UUID. - - insight_id: Insight UUID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 event_id: - raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") - if not insight_id: - raise ValueError(f"Expected a non-empty value for `insight_id` but received {insight_id!r}") - return await self._get( - f"/accounts/{account_id}/cloudforce-one/events/{event_id}/insight/{insight_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[InsightGetResponse]._unwrapper, - ), - cast_to=cast(Type[InsightGetResponse], ResultWrapper[InsightGetResponse]), - ) - - -class InsightsResourceWithRawResponse: - def __init__(self, insights: InsightsResource) -> None: - self._insights = insights - - self.create = to_raw_response_wrapper( - insights.create, - ) - self.delete = to_raw_response_wrapper( - insights.delete, - ) - self.edit = to_raw_response_wrapper( - insights.edit, - ) - self.get = to_raw_response_wrapper( - insights.get, - ) - - -class AsyncInsightsResourceWithRawResponse: - def __init__(self, insights: AsyncInsightsResource) -> None: - self._insights = insights - - self.create = async_to_raw_response_wrapper( - insights.create, - ) - self.delete = async_to_raw_response_wrapper( - insights.delete, - ) - self.edit = async_to_raw_response_wrapper( - insights.edit, - ) - self.get = async_to_raw_response_wrapper( - insights.get, - ) - - -class InsightsResourceWithStreamingResponse: - def __init__(self, insights: InsightsResource) -> None: - self._insights = insights - - self.create = to_streamed_response_wrapper( - insights.create, - ) - self.delete = to_streamed_response_wrapper( - insights.delete, - ) - self.edit = to_streamed_response_wrapper( - insights.edit, - ) - self.get = to_streamed_response_wrapper( - insights.get, - ) - - -class AsyncInsightsResourceWithStreamingResponse: - def __init__(self, insights: AsyncInsightsResource) -> None: - self._insights = insights - - self.create = async_to_streamed_response_wrapper( - insights.create, - ) - self.delete = async_to_streamed_response_wrapper( - insights.delete, - ) - self.edit = async_to_streamed_response_wrapper( - insights.edit, - ) - self.get = async_to_streamed_response_wrapper( - insights.get, - ) diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/raw.py b/src/cloudflare/resources/cloudforce_one/threat_events/raw.py index 69e2955d748..d12ca4f7eeb 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/raw.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/raw.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,15 +48,15 @@ def edit( *, account_id: str, event_id: str, - data: object | NotGiven = NOT_GIVEN, - source: str | NotGiven = NOT_GIVEN, - tlp: str | NotGiven = NOT_GIVEN, + data: object | Omit = omit, + source: str | Omit = omit, + tlp: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RawEditResponse: """ Updates a raw event @@ -109,7 +109,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RawGetResponse: """ Reads data for a raw event @@ -170,15 +170,15 @@ async def edit( *, account_id: str, event_id: str, - data: object | NotGiven = NOT_GIVEN, - source: str | NotGiven = NOT_GIVEN, - tlp: str | NotGiven = NOT_GIVEN, + data: object | Omit = omit, + source: str | Omit = omit, + tlp: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RawEditResponse: """ Updates a raw event @@ -231,7 +231,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RawGetResponse: """ Reads data for a raw event diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/relate.py b/src/cloudflare/resources/cloudforce_one/threat_events/relate.py index 3983fcf3385..bbadf4ae8f0 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/relate.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/relate.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -52,7 +52,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RelateDeleteResponse: """ Removes an event reference @@ -117,7 +117,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RelateDeleteResponse: """ Removes an event reference diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/tags.py b/src/cloudflare/resources/cloudforce_one/threat_events/tags.py index 84d511d62b8..bd3bdfee8dc 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/tags.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/tags.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -45,16 +45,31 @@ def create( self, *, account_id: str, - name: str, + value: str, + active_duration: str | Omit = omit, + actor_category: str | Omit = omit, + alias_group_names: SequenceNotStr[str] | Omit = omit, + alias_group_names_internal: SequenceNotStr[str] | Omit = omit, + analytic_priority: float | Omit = omit, + attribution_confidence: str | Omit = omit, + attribution_organization: str | Omit = omit, + category_uuid: str | Omit = omit, + external_reference_links: SequenceNotStr[str] | Omit = omit, + internal_description: str | Omit = omit, + motive: str | Omit = omit, + opsec_level: str | Omit = omit, + origin_country_iso: str | Omit = omit, + priority: float | Omit = omit, + sophistication_level: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TagCreateResponse: """ - Creates a new tag + Creates a new tag to be used accross threat events. Args: account_id: Account ID. @@ -71,7 +86,27 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( f"/accounts/{account_id}/cloudforce-one/events/tags/create", - body=maybe_transform({"name": name}, tag_create_params.TagCreateParams), + body=maybe_transform( + { + "value": value, + "active_duration": active_duration, + "actor_category": actor_category, + "alias_group_names": alias_group_names, + "alias_group_names_internal": alias_group_names_internal, + "analytic_priority": analytic_priority, + "attribution_confidence": attribution_confidence, + "attribution_organization": attribution_organization, + "category_uuid": category_uuid, + "external_reference_links": external_reference_links, + "internal_description": internal_description, + "motive": motive, + "opsec_level": opsec_level, + "origin_country_iso": origin_country_iso, + "priority": priority, + "sophistication_level": sophistication_level, + }, + tag_create_params.TagCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -103,16 +138,31 @@ async def create( self, *, account_id: str, - name: str, + value: str, + active_duration: str | Omit = omit, + actor_category: str | Omit = omit, + alias_group_names: SequenceNotStr[str] | Omit = omit, + alias_group_names_internal: SequenceNotStr[str] | Omit = omit, + analytic_priority: float | Omit = omit, + attribution_confidence: str | Omit = omit, + attribution_organization: str | Omit = omit, + category_uuid: str | Omit = omit, + external_reference_links: SequenceNotStr[str] | Omit = omit, + internal_description: str | Omit = omit, + motive: str | Omit = omit, + opsec_level: str | Omit = omit, + origin_country_iso: str | Omit = omit, + priority: float | Omit = omit, + sophistication_level: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TagCreateResponse: """ - Creates a new tag + Creates a new tag to be used accross threat events. Args: account_id: Account ID. @@ -129,7 +179,27 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( f"/accounts/{account_id}/cloudforce-one/events/tags/create", - body=await async_maybe_transform({"name": name}, tag_create_params.TagCreateParams), + body=await async_maybe_transform( + { + "value": value, + "active_duration": active_duration, + "actor_category": actor_category, + "alias_group_names": alias_group_names, + "alias_group_names_internal": alias_group_names_internal, + "analytic_priority": analytic_priority, + "attribution_confidence": attribution_confidence, + "attribution_organization": attribution_organization, + "category_uuid": category_uuid, + "external_reference_links": external_reference_links, + "internal_description": internal_description, + "motive": motive, + "opsec_level": opsec_level, + "origin_country_iso": origin_country_iso, + "priority": priority, + "sophistication_level": sophistication_level, + }, + tag_create_params.TagCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), 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 df7ddb996b2..54f8b912e4d 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/target_industries.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/target_industries.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -48,7 +48,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TargetIndustryListResponse: """ Lists all target industries @@ -104,7 +104,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TargetIndustryListResponse: """ Lists all target industries 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 a313c5426f1..108d45ea09f 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import List, Union, Iterable +import typing_extensions +from typing import Union, Iterable, Optional from datetime import datetime from typing_extensions import Literal @@ -24,14 +25,6 @@ TagsResourceWithStreamingResponse, AsyncTagsResourceWithStreamingResponse, ) -from .crons import ( - CronsResource, - AsyncCronsResource, - CronsResourceWithRawResponse, - AsyncCronsResourceWithRawResponse, - CronsResourceWithStreamingResponse, - AsyncCronsResourceWithStreamingResponse, -) from .relate import ( RelateResource, AsyncRelateResource, @@ -40,15 +33,7 @@ RelateResourceWithStreamingResponse, AsyncRelateResourceWithStreamingResponse, ) -from .insights import ( - InsightsResource, - AsyncInsightsResource, - InsightsResourceWithRawResponse, - AsyncInsightsResourceWithRawResponse, - InsightsResourceWithStreamingResponse, - AsyncInsightsResourceWithStreamingResponse, -) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from .attackers import ( AttackersResource, @@ -144,10 +129,6 @@ def categories(self) -> CategoriesResource: def countries(self) -> CountriesResource: return CountriesResource(self._client) - @cached_property - def crons(self) -> CronsResource: - return CronsResource(self._client) - @cached_property def datasets(self) -> DatasetsResource: return DatasetsResource(self._client) @@ -176,10 +157,6 @@ def event_tags(self) -> EventTagsResource: def target_industries(self) -> TargetIndustriesResource: return TargetIndustriesResource(self._client) - @cached_property - def insights(self) -> InsightsResource: - return InsightsResource(self._client) - @cached_property def with_raw_response(self) -> ThreatEventsResourceWithRawResponse: """ @@ -203,32 +180,33 @@ def create( self, *, path_account_id: str, - attacker: str, - attacker_country: str, category: str, date: Union[str, datetime], event: str, indicator_type: str, raw: threat_event_create_params.Raw, tlp: str, - body_account_id: float | NotGiven = NOT_GIVEN, - dataset_id: str | NotGiven = NOT_GIVEN, - indicator: str | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - target_country: str | NotGiven = NOT_GIVEN, - target_industry: str | NotGiven = NOT_GIVEN, + body_account_id: float | Omit = omit, + attacker: Optional[str] | Omit = omit, + attacker_country: str | Omit = omit, + dataset_id: str | Omit = omit, + indicator: str | Omit = omit, + insight: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + target_country: str | Omit = omit, + target_industry: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventCreateResponse: """ - Events must be created in a client-specific dataset, which means the `datasetId` - parameter must be defined. To create a dataset, see the + To create a dataset, see the [`Create Dataset`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/create/) - endpoint. + endpoint. When `datasetId` parameter is unspecified, it will be created in a + default dataset named `Cloudforce One Threat Events`. Args: path_account_id: Account ID. @@ -247,8 +225,6 @@ def create( f"/accounts/{path_account_id}/cloudforce-one/events/create", body=maybe_transform( { - "attacker": attacker, - "attacker_country": attacker_country, "category": category, "date": date, "event": event, @@ -256,8 +232,11 @@ def create( "raw": raw, "tlp": tlp, "body_account_id": body_account_id, + "attacker": attacker, + "attacker_country": attacker_country, "dataset_id": dataset_id, "indicator": indicator, + "insight": insight, "tags": tags, "target_country": target_country, "target_industry": target_industry, @@ -274,23 +253,24 @@ def list( self, *, account_id: str, - dataset_id: List[str] | NotGiven = NOT_GIVEN, - force_refresh: bool | NotGiven = NOT_GIVEN, - order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - page_size: float | NotGiven = NOT_GIVEN, - search: Iterable[threat_event_list_params.Search] | NotGiven = NOT_GIVEN, + dataset_id: SequenceNotStr[str] | Omit = omit, + force_refresh: bool | Omit = omit, + order: Literal["asc", "desc"] | Omit = omit, + order_by: str | Omit = omit, + page: float | Omit = omit, + page_size: float | Omit = omit, + search: Iterable[threat_event_list_params.Search] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventListResponse: """ - The `datasetId` must be defined (to list existing datasets (and their IDs), use - the + When `datasetId` is unspecified, events will be listed from the + `Cloudforce One Threat Events` dataset. To list existing datasets (and their + IDs), 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. @@ -340,7 +320,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventDeleteResponse: """The `datasetId` parameter must be defined. @@ -385,7 +365,7 @@ def bulk_create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventBulkCreateResponse: """The `datasetId` parameter must be defined. @@ -419,7 +399,7 @@ def bulk_create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ThreatEventBulkCreateResponse, + cast_to=float, ) def edit( @@ -427,22 +407,24 @@ def edit( event_id: str, *, account_id: str, - attacker: str | NotGiven = NOT_GIVEN, - attacker_country: str | NotGiven = NOT_GIVEN, - category: str | NotGiven = NOT_GIVEN, - date: Union[str, datetime] | NotGiven = NOT_GIVEN, - event: str | NotGiven = NOT_GIVEN, - indicator: str | NotGiven = NOT_GIVEN, - indicator_type: str | NotGiven = NOT_GIVEN, - target_country: str | NotGiven = NOT_GIVEN, - target_industry: str | NotGiven = NOT_GIVEN, - tlp: str | NotGiven = NOT_GIVEN, + attacker: Optional[str] | Omit = omit, + attacker_country: str | Omit = omit, + category: str | Omit = omit, + date: Union[str, datetime] | Omit = omit, + event: str | Omit = omit, + indicator: str | Omit = omit, + indicator_type: str | Omit = omit, + insight: str | Omit = omit, + raw: threat_event_edit_params.Raw | Omit = omit, + target_country: str | Omit = omit, + target_industry: str | Omit = omit, + tlp: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventEditResponse: """ Updates an event @@ -475,6 +457,8 @@ def edit( "event": event, "indicator": indicator, "indicator_type": indicator_type, + "insight": insight, + "raw": raw, "target_country": target_country, "target_industry": target_industry, "tlp": tlp, @@ -487,6 +471,7 @@ def edit( cast_to=ThreatEventEditResponse, ) + @typing_extensions.deprecated("deprecated") def get( self, event_id: str, @@ -497,10 +482,12 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventGetResponse: - """ - Reads an event + """This Method is deprecated. + + Please use + /events/dataset/:dataset_id/events/:event_id instead. Args: account_id: Account ID. @@ -541,10 +528,6 @@ def categories(self) -> AsyncCategoriesResource: def countries(self) -> AsyncCountriesResource: return AsyncCountriesResource(self._client) - @cached_property - def crons(self) -> AsyncCronsResource: - return AsyncCronsResource(self._client) - @cached_property def datasets(self) -> AsyncDatasetsResource: return AsyncDatasetsResource(self._client) @@ -573,10 +556,6 @@ def event_tags(self) -> AsyncEventTagsResource: def target_industries(self) -> AsyncTargetIndustriesResource: return AsyncTargetIndustriesResource(self._client) - @cached_property - def insights(self) -> AsyncInsightsResource: - return AsyncInsightsResource(self._client) - @cached_property def with_raw_response(self) -> AsyncThreatEventsResourceWithRawResponse: """ @@ -600,32 +579,33 @@ async def create( self, *, path_account_id: str, - attacker: str, - attacker_country: str, category: str, date: Union[str, datetime], event: str, indicator_type: str, raw: threat_event_create_params.Raw, tlp: str, - body_account_id: float | NotGiven = NOT_GIVEN, - dataset_id: str | NotGiven = NOT_GIVEN, - indicator: str | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - target_country: str | NotGiven = NOT_GIVEN, - target_industry: str | NotGiven = NOT_GIVEN, + body_account_id: float | Omit = omit, + attacker: Optional[str] | Omit = omit, + attacker_country: str | Omit = omit, + dataset_id: str | Omit = omit, + indicator: str | Omit = omit, + insight: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + target_country: str | Omit = omit, + target_industry: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventCreateResponse: """ - Events must be created in a client-specific dataset, which means the `datasetId` - parameter must be defined. To create a dataset, see the + To create a dataset, see the [`Create Dataset`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/create/) - endpoint. + endpoint. When `datasetId` parameter is unspecified, it will be created in a + default dataset named `Cloudforce One Threat Events`. Args: path_account_id: Account ID. @@ -644,8 +624,6 @@ async def create( f"/accounts/{path_account_id}/cloudforce-one/events/create", body=await async_maybe_transform( { - "attacker": attacker, - "attacker_country": attacker_country, "category": category, "date": date, "event": event, @@ -653,8 +631,11 @@ async def create( "raw": raw, "tlp": tlp, "body_account_id": body_account_id, + "attacker": attacker, + "attacker_country": attacker_country, "dataset_id": dataset_id, "indicator": indicator, + "insight": insight, "tags": tags, "target_country": target_country, "target_industry": target_industry, @@ -671,23 +652,24 @@ async def list( self, *, account_id: str, - dataset_id: List[str] | NotGiven = NOT_GIVEN, - force_refresh: bool | NotGiven = NOT_GIVEN, - order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - page_size: float | NotGiven = NOT_GIVEN, - search: Iterable[threat_event_list_params.Search] | NotGiven = NOT_GIVEN, + dataset_id: SequenceNotStr[str] | Omit = omit, + force_refresh: bool | Omit = omit, + order: Literal["asc", "desc"] | Omit = omit, + order_by: str | Omit = omit, + page: float | Omit = omit, + page_size: float | Omit = omit, + search: Iterable[threat_event_list_params.Search] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventListResponse: """ - The `datasetId` must be defined (to list existing datasets (and their IDs), use - the + When `datasetId` is unspecified, events will be listed from the + `Cloudforce One Threat Events` dataset. To list existing datasets (and their + IDs), 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. @@ -737,7 +719,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventDeleteResponse: """The `datasetId` parameter must be defined. @@ -782,7 +764,7 @@ async def bulk_create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventBulkCreateResponse: """The `datasetId` parameter must be defined. @@ -816,7 +798,7 @@ async def bulk_create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ThreatEventBulkCreateResponse, + cast_to=float, ) async def edit( @@ -824,22 +806,24 @@ async def edit( event_id: str, *, account_id: str, - attacker: str | NotGiven = NOT_GIVEN, - attacker_country: str | NotGiven = NOT_GIVEN, - category: str | NotGiven = NOT_GIVEN, - date: Union[str, datetime] | NotGiven = NOT_GIVEN, - event: str | NotGiven = NOT_GIVEN, - indicator: str | NotGiven = NOT_GIVEN, - indicator_type: str | NotGiven = NOT_GIVEN, - target_country: str | NotGiven = NOT_GIVEN, - target_industry: str | NotGiven = NOT_GIVEN, - tlp: str | NotGiven = NOT_GIVEN, + attacker: Optional[str] | Omit = omit, + attacker_country: str | Omit = omit, + category: str | Omit = omit, + date: Union[str, datetime] | Omit = omit, + event: str | Omit = omit, + indicator: str | Omit = omit, + indicator_type: str | Omit = omit, + insight: str | Omit = omit, + raw: threat_event_edit_params.Raw | Omit = omit, + target_country: str | Omit = omit, + target_industry: str | Omit = omit, + tlp: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventEditResponse: """ Updates an event @@ -872,6 +856,8 @@ async def edit( "event": event, "indicator": indicator, "indicator_type": indicator_type, + "insight": insight, + "raw": raw, "target_country": target_country, "target_industry": target_industry, "tlp": tlp, @@ -884,6 +870,7 @@ async def edit( cast_to=ThreatEventEditResponse, ) + @typing_extensions.deprecated("deprecated") async def get( self, event_id: str, @@ -894,10 +881,12 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventGetResponse: - """ - Reads an event + """This Method is deprecated. + + Please use + /events/dataset/:dataset_id/events/:event_id instead. Args: account_id: Account ID. @@ -944,8 +933,10 @@ def __init__(self, threat_events: ThreatEventsResource) -> None: self.edit = to_raw_response_wrapper( threat_events.edit, ) - self.get = to_raw_response_wrapper( - threat_events.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + threat_events.get, # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -960,10 +951,6 @@ def categories(self) -> CategoriesResourceWithRawResponse: def countries(self) -> CountriesResourceWithRawResponse: return CountriesResourceWithRawResponse(self._threat_events.countries) - @cached_property - def crons(self) -> CronsResourceWithRawResponse: - return CronsResourceWithRawResponse(self._threat_events.crons) - @cached_property def datasets(self) -> DatasetsResourceWithRawResponse: return DatasetsResourceWithRawResponse(self._threat_events.datasets) @@ -992,10 +979,6 @@ def event_tags(self) -> EventTagsResourceWithRawResponse: def target_industries(self) -> TargetIndustriesResourceWithRawResponse: return TargetIndustriesResourceWithRawResponse(self._threat_events.target_industries) - @cached_property - def insights(self) -> InsightsResourceWithRawResponse: - return InsightsResourceWithRawResponse(self._threat_events.insights) - class AsyncThreatEventsResourceWithRawResponse: def __init__(self, threat_events: AsyncThreatEventsResource) -> None: @@ -1016,8 +999,10 @@ def __init__(self, threat_events: AsyncThreatEventsResource) -> None: self.edit = async_to_raw_response_wrapper( threat_events.edit, ) - self.get = async_to_raw_response_wrapper( - threat_events.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + threat_events.get, # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -1032,10 +1017,6 @@ def categories(self) -> AsyncCategoriesResourceWithRawResponse: def countries(self) -> AsyncCountriesResourceWithRawResponse: return AsyncCountriesResourceWithRawResponse(self._threat_events.countries) - @cached_property - def crons(self) -> AsyncCronsResourceWithRawResponse: - return AsyncCronsResourceWithRawResponse(self._threat_events.crons) - @cached_property def datasets(self) -> AsyncDatasetsResourceWithRawResponse: return AsyncDatasetsResourceWithRawResponse(self._threat_events.datasets) @@ -1064,10 +1045,6 @@ def event_tags(self) -> AsyncEventTagsResourceWithRawResponse: def target_industries(self) -> AsyncTargetIndustriesResourceWithRawResponse: return AsyncTargetIndustriesResourceWithRawResponse(self._threat_events.target_industries) - @cached_property - def insights(self) -> AsyncInsightsResourceWithRawResponse: - return AsyncInsightsResourceWithRawResponse(self._threat_events.insights) - class ThreatEventsResourceWithStreamingResponse: def __init__(self, threat_events: ThreatEventsResource) -> None: @@ -1088,8 +1065,10 @@ def __init__(self, threat_events: ThreatEventsResource) -> None: self.edit = to_streamed_response_wrapper( threat_events.edit, ) - self.get = to_streamed_response_wrapper( - threat_events.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + threat_events.get, # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -1104,10 +1083,6 @@ def categories(self) -> CategoriesResourceWithStreamingResponse: def countries(self) -> CountriesResourceWithStreamingResponse: return CountriesResourceWithStreamingResponse(self._threat_events.countries) - @cached_property - def crons(self) -> CronsResourceWithStreamingResponse: - return CronsResourceWithStreamingResponse(self._threat_events.crons) - @cached_property def datasets(self) -> DatasetsResourceWithStreamingResponse: return DatasetsResourceWithStreamingResponse(self._threat_events.datasets) @@ -1136,10 +1111,6 @@ def event_tags(self) -> EventTagsResourceWithStreamingResponse: def target_industries(self) -> TargetIndustriesResourceWithStreamingResponse: return TargetIndustriesResourceWithStreamingResponse(self._threat_events.target_industries) - @cached_property - def insights(self) -> InsightsResourceWithStreamingResponse: - return InsightsResourceWithStreamingResponse(self._threat_events.insights) - class AsyncThreatEventsResourceWithStreamingResponse: def __init__(self, threat_events: AsyncThreatEventsResource) -> None: @@ -1160,8 +1131,10 @@ def __init__(self, threat_events: AsyncThreatEventsResource) -> None: self.edit = async_to_streamed_response_wrapper( threat_events.edit, ) - self.get = async_to_streamed_response_wrapper( - threat_events.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + threat_events.get, # pyright: ignore[reportDeprecated], + ) ) @cached_property @@ -1176,10 +1149,6 @@ def categories(self) -> AsyncCategoriesResourceWithStreamingResponse: def countries(self) -> AsyncCountriesResourceWithStreamingResponse: return AsyncCountriesResourceWithStreamingResponse(self._threat_events.countries) - @cached_property - def crons(self) -> AsyncCronsResourceWithStreamingResponse: - return AsyncCronsResourceWithStreamingResponse(self._threat_events.crons) - @cached_property def datasets(self) -> AsyncDatasetsResourceWithStreamingResponse: return AsyncDatasetsResourceWithStreamingResponse(self._threat_events.datasets) @@ -1207,7 +1176,3 @@ def event_tags(self) -> AsyncEventTagsResourceWithStreamingResponse: @cached_property def target_industries(self) -> AsyncTargetIndustriesResourceWithStreamingResponse: return AsyncTargetIndustriesResourceWithStreamingResponse(self._threat_events.target_industries) - - @cached_property - def insights(self) -> AsyncInsightsResourceWithStreamingResponse: - return AsyncInsightsResourceWithStreamingResponse(self._threat_events.insights) diff --git a/src/cloudflare/resources/content_scanning/content_scanning.py b/src/cloudflare/resources/content_scanning/content_scanning.py index ccba4cc9bea..ddc8deba657 100644 --- a/src/cloudflare/resources/content_scanning/content_scanning.py +++ b/src/cloudflare/resources/content_scanning/content_scanning.py @@ -3,10 +3,12 @@ from __future__ import annotations from typing import Type, cast +from typing_extensions import Literal import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given +from ..._utils import maybe_transform, async_maybe_transform from .payloads import ( PayloadsResource, AsyncPayloadsResource, @@ -33,6 +35,10 @@ ) from ..._wrappers import ResultWrapper from ..._base_client import make_request_options +from ...types.content_scanning import content_scanning_create_params, content_scanning_update_params +from ...types.content_scanning.content_scanning_get_response import ContentScanningGetResponse +from ...types.content_scanning.content_scanning_create_response import ContentScanningCreateResponse +from ...types.content_scanning.content_scanning_update_response import ContentScanningUpdateResponse __all__ = ["ContentScanningResource", "AsyncContentScanningResource"] @@ -65,6 +71,92 @@ def with_streaming_response(self) -> ContentScanningResourceWithStreamingRespons """ return ContentScanningResourceWithStreamingResponse(self) + def create( + self, + *, + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ContentScanningCreateResponse: + """ + Update the Content Scanning status. + + Args: + zone_id: Defines an identifier. + + value: The status value for Content Scanning. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/content-upload-scan/settings", + body=maybe_transform({"value": value}, content_scanning_create_params.ContentScanningCreateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ContentScanningCreateResponse]._unwrapper, + ), + cast_to=cast(Type[ContentScanningCreateResponse], ResultWrapper[ContentScanningCreateResponse]), + ) + + def update( + self, + *, + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ContentScanningUpdateResponse: + """ + Update the Content Scanning status. + + Args: + zone_id: Defines an identifier. + + value: The status value for Content Scanning. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/content-upload-scan/settings", + body=maybe_transform({"value": value}, content_scanning_update_params.ContentScanningUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ContentScanningUpdateResponse]._unwrapper, + ), + cast_to=cast(Type[ContentScanningUpdateResponse], ResultWrapper[ContentScanningUpdateResponse]), + ) + def disable( self, *, @@ -74,7 +166,7 @@ def disable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Disable Content Scanning. @@ -113,7 +205,7 @@ def enable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Enable Content Scanning. @@ -143,6 +235,45 @@ def enable( cast_to=cast(Type[object], ResultWrapper[object]), ) + 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, + ) -> ContentScanningGetResponse: + """ + Retrieve the current status of Content Scanning. + + 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( + f"/zones/{zone_id}/content-upload-scan/settings", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ContentScanningGetResponse]._unwrapper, + ), + cast_to=cast(Type[ContentScanningGetResponse], ResultWrapper[ContentScanningGetResponse]), + ) + class AsyncContentScanningResource(AsyncAPIResource): @cached_property @@ -172,6 +303,96 @@ def with_streaming_response(self) -> AsyncContentScanningResourceWithStreamingRe """ return AsyncContentScanningResourceWithStreamingResponse(self) + async def create( + self, + *, + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ContentScanningCreateResponse: + """ + Update the Content Scanning status. + + Args: + zone_id: Defines an identifier. + + value: The status value for Content Scanning. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/content-upload-scan/settings", + body=await async_maybe_transform( + {"value": value}, content_scanning_create_params.ContentScanningCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ContentScanningCreateResponse]._unwrapper, + ), + cast_to=cast(Type[ContentScanningCreateResponse], ResultWrapper[ContentScanningCreateResponse]), + ) + + async def update( + self, + *, + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ContentScanningUpdateResponse: + """ + Update the Content Scanning status. + + Args: + zone_id: Defines an identifier. + + value: The status value for Content Scanning. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/content-upload-scan/settings", + body=await async_maybe_transform( + {"value": value}, content_scanning_update_params.ContentScanningUpdateParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ContentScanningUpdateResponse]._unwrapper, + ), + cast_to=cast(Type[ContentScanningUpdateResponse], ResultWrapper[ContentScanningUpdateResponse]), + ) + async def disable( self, *, @@ -181,7 +402,7 @@ async def disable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Disable Content Scanning. @@ -220,7 +441,7 @@ async def enable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Enable Content Scanning. @@ -250,17 +471,65 @@ async def enable( cast_to=cast(Type[object], ResultWrapper[object]), ) + 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, + ) -> ContentScanningGetResponse: + """ + Retrieve the current status of Content Scanning. + + 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._get( + f"/zones/{zone_id}/content-upload-scan/settings", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ContentScanningGetResponse]._unwrapper, + ), + cast_to=cast(Type[ContentScanningGetResponse], ResultWrapper[ContentScanningGetResponse]), + ) + class ContentScanningResourceWithRawResponse: def __init__(self, content_scanning: ContentScanningResource) -> None: self._content_scanning = content_scanning + self.create = to_raw_response_wrapper( + content_scanning.create, + ) + self.update = to_raw_response_wrapper( + content_scanning.update, + ) self.disable = to_raw_response_wrapper( content_scanning.disable, ) self.enable = to_raw_response_wrapper( content_scanning.enable, ) + self.get = to_raw_response_wrapper( + content_scanning.get, + ) @cached_property def payloads(self) -> PayloadsResourceWithRawResponse: @@ -275,12 +544,21 @@ class AsyncContentScanningResourceWithRawResponse: def __init__(self, content_scanning: AsyncContentScanningResource) -> None: self._content_scanning = content_scanning + self.create = async_to_raw_response_wrapper( + content_scanning.create, + ) + self.update = async_to_raw_response_wrapper( + content_scanning.update, + ) self.disable = async_to_raw_response_wrapper( content_scanning.disable, ) self.enable = async_to_raw_response_wrapper( content_scanning.enable, ) + self.get = async_to_raw_response_wrapper( + content_scanning.get, + ) @cached_property def payloads(self) -> AsyncPayloadsResourceWithRawResponse: @@ -295,12 +573,21 @@ class ContentScanningResourceWithStreamingResponse: def __init__(self, content_scanning: ContentScanningResource) -> None: self._content_scanning = content_scanning + self.create = to_streamed_response_wrapper( + content_scanning.create, + ) + self.update = to_streamed_response_wrapper( + content_scanning.update, + ) self.disable = to_streamed_response_wrapper( content_scanning.disable, ) self.enable = to_streamed_response_wrapper( content_scanning.enable, ) + self.get = to_streamed_response_wrapper( + content_scanning.get, + ) @cached_property def payloads(self) -> PayloadsResourceWithStreamingResponse: @@ -315,12 +602,21 @@ class AsyncContentScanningResourceWithStreamingResponse: def __init__(self, content_scanning: AsyncContentScanningResource) -> None: self._content_scanning = content_scanning + self.create = async_to_streamed_response_wrapper( + content_scanning.create, + ) + self.update = async_to_streamed_response_wrapper( + content_scanning.update, + ) self.disable = async_to_streamed_response_wrapper( content_scanning.disable, ) self.enable = async_to_streamed_response_wrapper( content_scanning.enable, ) + self.get = async_to_streamed_response_wrapper( + content_scanning.get, + ) @cached_property def payloads(self) -> AsyncPayloadsResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/content_scanning/payloads.py b/src/cloudflare/resources/content_scanning/payloads.py index c129cd80ef0..a093c140132 100644 --- a/src/cloudflare/resources/content_scanning/payloads.py +++ b/src/cloudflare/resources/content_scanning/payloads.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -56,7 +56,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PayloadCreateResponse]: """ Add custom scan expressions for Content Scanning. @@ -94,7 +94,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PayloadListResponse]: """ Get a list of existing custom scan expressions for Content Scanning. @@ -131,7 +131,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PayloadDeleteResponse]: """ Delete a Content Scan Custom Expression. @@ -194,7 +194,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PayloadCreateResponse, AsyncSinglePage[PayloadCreateResponse]]: """ Add custom scan expressions for Content Scanning. @@ -232,7 +232,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PayloadListResponse, AsyncSinglePage[PayloadListResponse]]: """ Get a list of existing custom scan expressions for Content Scanning. @@ -269,7 +269,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PayloadDeleteResponse, AsyncSinglePage[PayloadDeleteResponse]]: """ Delete a Content Scan Custom Expression. diff --git a/src/cloudflare/resources/content_scanning/settings.py b/src/cloudflare/resources/content_scanning/settings.py index cd674012faa..c9e6ebf8adc 100644 --- a/src/cloudflare/resources/content_scanning/settings.py +++ b/src/cloudflare/resources/content_scanning/settings.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingGetResponse: """ Retrieve the current status of Content Scanning. @@ -111,7 +111,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingGetResponse: """ Retrieve the current status of Content Scanning. diff --git a/src/cloudflare/resources/custom_certificates/custom_certificates.py b/src/cloudflare/resources/custom_certificates/custom_certificates.py index db52dc80ccf..0ab5fac95ac 100644 --- a/src/cloudflare/resources/custom_certificates/custom_certificates.py +++ b/src/cloudflare/resources/custom_certificates/custom_certificates.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .prioritize import ( @@ -72,16 +72,16 @@ def create( zone_id: str, certificate: str, private_key: str, - bundle_method: BundleMethod | NotGiven = NOT_GIVEN, - geo_restrictions: GeoRestrictionsParam | NotGiven = NOT_GIVEN, - policy: str | NotGiven = NOT_GIVEN, - type: Literal["legacy_custom", "sni_custom"] | NotGiven = NOT_GIVEN, + bundle_method: BundleMethod | Omit = omit, + geo_restrictions: GeoRestrictionsParam | Omit = omit, + policy: str | Omit = omit, + type: Literal["legacy_custom", "sni_custom"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificate]: """ Upload a new SSL certificate for a zone. @@ -156,16 +156,16 @@ def list( self, *, zone_id: str, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["active", "expired", "deleted", "pending", "initializing"] | NotGiven = NOT_GIVEN, + match: Literal["any", "all"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["active", "expired", "deleted", "pending", "initializing"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[CustomCertificate]: """List, search, and filter all of your custom SSL certificates. @@ -225,7 +225,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificateDeleteResponse]: """ Remove a SSL certificate from a zone. @@ -268,17 +268,17 @@ def edit( custom_certificate_id: str, *, zone_id: str, - bundle_method: BundleMethod | NotGiven = NOT_GIVEN, - certificate: str | NotGiven = NOT_GIVEN, - geo_restrictions: GeoRestrictionsParam | NotGiven = NOT_GIVEN, - policy: str | NotGiven = NOT_GIVEN, - private_key: str | NotGiven = NOT_GIVEN, + bundle_method: BundleMethod | Omit = omit, + certificate: str | Omit = omit, + geo_restrictions: GeoRestrictionsParam | Omit = omit, + policy: str | Omit = omit, + private_key: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificate]: """Upload a new private key and/or PEM/CRT for the SSL certificate. @@ -364,7 +364,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificate]: """ SSL Configuration Details @@ -431,16 +431,16 @@ async def create( zone_id: str, certificate: str, private_key: str, - bundle_method: BundleMethod | NotGiven = NOT_GIVEN, - geo_restrictions: GeoRestrictionsParam | NotGiven = NOT_GIVEN, - policy: str | NotGiven = NOT_GIVEN, - type: Literal["legacy_custom", "sni_custom"] | NotGiven = NOT_GIVEN, + bundle_method: BundleMethod | Omit = omit, + geo_restrictions: GeoRestrictionsParam | Omit = omit, + policy: str | Omit = omit, + type: Literal["legacy_custom", "sni_custom"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificate]: """ Upload a new SSL certificate for a zone. @@ -515,16 +515,16 @@ def list( self, *, zone_id: str, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["active", "expired", "deleted", "pending", "initializing"] | NotGiven = NOT_GIVEN, + match: Literal["any", "all"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["active", "expired", "deleted", "pending", "initializing"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CustomCertificate, AsyncV4PagePaginationArray[CustomCertificate]]: """List, search, and filter all of your custom SSL certificates. @@ -584,7 +584,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificateDeleteResponse]: """ Remove a SSL certificate from a zone. @@ -627,17 +627,17 @@ async def edit( custom_certificate_id: str, *, zone_id: str, - bundle_method: BundleMethod | NotGiven = NOT_GIVEN, - certificate: str | NotGiven = NOT_GIVEN, - geo_restrictions: GeoRestrictionsParam | NotGiven = NOT_GIVEN, - policy: str | NotGiven = NOT_GIVEN, - private_key: str | NotGiven = NOT_GIVEN, + bundle_method: BundleMethod | Omit = omit, + certificate: str | Omit = omit, + geo_restrictions: GeoRestrictionsParam | Omit = omit, + policy: str | Omit = omit, + private_key: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificate]: """Upload a new private key and/or PEM/CRT for the SSL certificate. @@ -723,7 +723,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificate]: """ SSL Configuration Details diff --git a/src/cloudflare/resources/custom_certificates/prioritize.py b/src/cloudflare/resources/custom_certificates/prioritize.py index 3b4e370a6b9..dcc12005ba6 100644 --- a/src/cloudflare/resources/custom_certificates/prioritize.py +++ b/src/cloudflare/resources/custom_certificates/prioritize.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,7 +54,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CustomCertificate]: """ If a zone has multiple SSL certificates, you can set the order in which they @@ -118,7 +118,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CustomCertificate, AsyncSinglePage[CustomCertificate]]: """ If a zone has multiple SSL certificates, you can set the order in which they diff --git a/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py b/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py index 79f9ec3068b..d3df9504b42 100644 --- a/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py +++ b/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -59,7 +59,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateUpdateResponse]: """ Replace a single custom certificate within a certificate pack that contains two @@ -129,7 +129,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CertificateDeleteResponse: """ Delete a single custom certificate from a certificate pack that contains two @@ -207,7 +207,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateUpdateResponse]: """ Replace a single custom certificate within a certificate pack that contains two @@ -277,7 +277,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CertificateDeleteResponse: """ Delete a single custom certificate from a certificate pack that contains two diff --git a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py index 971c07f3657..9e83f3acc10 100644 --- a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py +++ b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -84,13 +84,13 @@ def create( zone_id: str, hostname: str, ssl: custom_hostname_create_params.SSL, - custom_metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + custom_metadata: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomHostnameCreateResponse]: """ Add a new custom hostname and request that an SSL certificate be issued for it. @@ -148,19 +148,19 @@ def list( self, *, zone_id: str, - id: str | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - hostname: str | NotGiven = NOT_GIVEN, - order: Literal["ssl", "ssl_status"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - ssl: Literal[0, 1] | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + hostname: str | Omit = omit, + order: Literal["ssl", "ssl_status"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + ssl: Literal[0, 1] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[CustomHostnameListResponse]: """ List, search, sort, and filter all of your custom hostnames. @@ -229,7 +229,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomHostnameDeleteResponse: """ Delete Custom Hostname (and any issued SSL certificates) @@ -264,16 +264,16 @@ def edit( custom_hostname_id: str, *, zone_id: str, - custom_metadata: Dict[str, str] | NotGiven = NOT_GIVEN, - custom_origin_server: str | NotGiven = NOT_GIVEN, - custom_origin_sni: str | NotGiven = NOT_GIVEN, - ssl: custom_hostname_edit_params.SSL | NotGiven = NOT_GIVEN, + custom_metadata: Dict[str, str] | Omit = omit, + custom_origin_server: str | Omit = omit, + custom_origin_sni: str | Omit = omit, + ssl: custom_hostname_edit_params.SSL | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomHostnameEditResponse]: """Modify SSL configuration for a custom hostname. @@ -347,7 +347,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomHostnameGetResponse]: """ Custom Hostname Details @@ -416,13 +416,13 @@ async def create( zone_id: str, hostname: str, ssl: custom_hostname_create_params.SSL, - custom_metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + custom_metadata: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomHostnameCreateResponse]: """ Add a new custom hostname and request that an SSL certificate be issued for it. @@ -480,19 +480,19 @@ def list( self, *, zone_id: str, - id: str | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - hostname: str | NotGiven = NOT_GIVEN, - order: Literal["ssl", "ssl_status"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - ssl: Literal[0, 1] | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + hostname: str | Omit = omit, + order: Literal["ssl", "ssl_status"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + ssl: Literal[0, 1] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CustomHostnameListResponse, AsyncV4PagePaginationArray[CustomHostnameListResponse]]: """ List, search, sort, and filter all of your custom hostnames. @@ -561,7 +561,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomHostnameDeleteResponse: """ Delete Custom Hostname (and any issued SSL certificates) @@ -596,16 +596,16 @@ async def edit( custom_hostname_id: str, *, zone_id: str, - custom_metadata: Dict[str, str] | NotGiven = NOT_GIVEN, - custom_origin_server: str | NotGiven = NOT_GIVEN, - custom_origin_sni: str | NotGiven = NOT_GIVEN, - ssl: custom_hostname_edit_params.SSL | NotGiven = NOT_GIVEN, + custom_metadata: Dict[str, str] | Omit = omit, + custom_origin_server: str | Omit = omit, + custom_origin_sni: str | Omit = omit, + ssl: custom_hostname_edit_params.SSL | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomHostnameEditResponse]: """Modify SSL configuration for a custom hostname. @@ -679,7 +679,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomHostnameGetResponse]: """ Custom Hostname Details diff --git a/src/cloudflare/resources/custom_hostnames/fallback_origin.py b/src/cloudflare/resources/custom_hostnames/fallback_origin.py index 10020c489eb..3fec4f02098 100644 --- a/src/cloudflare/resources/custom_hostnames/fallback_origin.py +++ b/src/cloudflare/resources/custom_hostnames/fallback_origin.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginUpdateResponse]: """ Update Fallback Origin for Custom Hostnames @@ -98,7 +98,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginDeleteResponse]: """ Delete Fallback Origin for Custom Hostnames @@ -137,7 +137,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginGetResponse]: """ Get Fallback Origin for Custom Hostnames @@ -198,7 +198,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginUpdateResponse]: """ Update Fallback Origin for Custom Hostnames @@ -242,7 +242,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginDeleteResponse]: """ Delete Fallback Origin for Custom Hostnames @@ -281,7 +281,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginGetResponse]: """ Get Fallback Origin for Custom Hostnames diff --git a/src/cloudflare/resources/custom_nameservers.py b/src/cloudflare/resources/custom_nameservers.py index 510e5b2d12c..6545ebd198c 100644 --- a/src/cloudflare/resources/custom_nameservers.py +++ b/src/cloudflare/resources/custom_nameservers.py @@ -6,7 +6,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,13 +51,13 @@ def create( *, account_id: str, ns_name: str, - ns_set: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomNameserver]: """ Add Account Custom Nameserver @@ -108,7 +108,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CustomNameserverDeleteResponse]: """ Delete Account Custom Nameserver @@ -149,7 +149,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CustomNameserver]: """ List an account's custom nameservers. @@ -202,13 +202,13 @@ async def create( *, account_id: str, ns_name: str, - ns_set: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomNameserver]: """ Add Account Custom Nameserver @@ -259,7 +259,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CustomNameserverDeleteResponse, AsyncSinglePage[CustomNameserverDeleteResponse]]: """ Delete Account Custom Nameserver @@ -300,7 +300,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CustomNameserver, AsyncSinglePage[CustomNameserver]]: """ List an account's custom nameservers. diff --git a/src/cloudflare/resources/custom_pages.py b/src/cloudflare/resources/custom_pages.py index 4016622ad10..f5fdc968dbf 100644 --- a/src/cloudflare/resources/custom_pages.py +++ b/src/cloudflare/resources/custom_pages.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Any, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -22,6 +22,7 @@ from .._base_client import AsyncPaginator, make_request_options from ..types.custom_pages import custom_page_update_params from ..types.custom_pages.custom_page_get_response import CustomPageGetResponse +from ..types.custom_pages.custom_page_list_response import CustomPageListResponse from ..types.custom_pages.custom_page_update_response import CustomPageUpdateResponse __all__ = ["CustomPagesResource", "AsyncCustomPagesResource"] @@ -49,24 +50,32 @@ def with_streaming_response(self) -> CustomPagesResourceWithStreamingResponse: def update( self, - identifier: str, + identifier: Literal[ + "waf_block", + "ip_block", + "country_challenge", + "500_errors", + "1000_errors", + "managed_challenge", + "ratelimit_block", + ], *, state: Literal["default", "customized"], url: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPageUpdateResponse]: """ Updates the configuration of an existing custom page. Args: - identifier: Identifier + identifier: Error Page Types state: The custom page state. @@ -98,42 +107,37 @@ def update( account_or_zone = "zones" account_or_zone_id = zone_id - return cast( - Optional[CustomPageUpdateResponse], - self._put( - f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}", - body=maybe_transform( - { - "state": state, - "url": url, - }, - custom_page_update_params.CustomPageUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomPageUpdateResponse]]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[CustomPageUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._put( + f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}", + body=maybe_transform( + { + "state": state, + "url": url, + }, + custom_page_update_params.CustomPageUpdateParams, ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomPageUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomPageUpdateResponse]], ResultWrapper[CustomPageUpdateResponse]), ) def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[object]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncSinglePage[CustomPageListResponse]: """ Fetches all the custom pages. @@ -164,31 +168,39 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/custom_pages", - page=SyncSinglePage[object], + page=SyncSinglePage[CustomPageListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=CustomPageListResponse, ) def get( self, - identifier: str, + identifier: Literal[ + "waf_block", + "ip_block", + "country_challenge", + "500_errors", + "1000_errors", + "managed_challenge", + "ratelimit_block", + ], *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPageGetResponse]: """ Fetches the details of a custom page. Args: - identifier: Identifier + identifier: Error Page Types account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -216,21 +228,16 @@ def get( account_or_zone = "zones" account_or_zone_id = zone_id - return cast( - Optional[CustomPageGetResponse], - self._get( - f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomPageGetResponse]]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[CustomPageGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get( + f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomPageGetResponse]]._unwrapper, ), + cast_to=cast(Type[Optional[CustomPageGetResponse]], ResultWrapper[CustomPageGetResponse]), ) @@ -256,24 +263,32 @@ def with_streaming_response(self) -> AsyncCustomPagesResourceWithStreamingRespon async def update( self, - identifier: str, + identifier: Literal[ + "waf_block", + "ip_block", + "country_challenge", + "500_errors", + "1000_errors", + "managed_challenge", + "ratelimit_block", + ], *, state: Literal["default", "customized"], url: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPageUpdateResponse]: """ Updates the configuration of an existing custom page. Args: - identifier: Identifier + identifier: Error Page Types state: The custom page state. @@ -305,42 +320,37 @@ async def update( account_or_zone = "zones" account_or_zone_id = zone_id - return cast( - Optional[CustomPageUpdateResponse], - await self._put( - f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}", - body=await async_maybe_transform( - { - "state": state, - "url": url, - }, - custom_page_update_params.CustomPageUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomPageUpdateResponse]]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[CustomPageUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._put( + f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}", + body=await async_maybe_transform( + { + "state": state, + "url": url, + }, + custom_page_update_params.CustomPageUpdateParams, ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomPageUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomPageUpdateResponse]], ResultWrapper[CustomPageUpdateResponse]), ) def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[object, AsyncSinglePage[object]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[CustomPageListResponse, AsyncSinglePage[CustomPageListResponse]]: """ Fetches all the custom pages. @@ -371,31 +381,39 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/custom_pages", - page=AsyncSinglePage[object], + page=AsyncSinglePage[CustomPageListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=object, + model=CustomPageListResponse, ) async def get( self, - identifier: str, + identifier: Literal[ + "waf_block", + "ip_block", + "country_challenge", + "500_errors", + "1000_errors", + "managed_challenge", + "ratelimit_block", + ], *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPageGetResponse]: """ Fetches the details of a custom page. Args: - identifier: Identifier + identifier: Error Page Types account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -423,21 +441,16 @@ async def get( account_or_zone = "zones" account_or_zone_id = zone_id - return cast( - Optional[CustomPageGetResponse], - await self._get( - f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomPageGetResponse]]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[CustomPageGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._get( + f"/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomPageGetResponse]]._unwrapper, ), + cast_to=cast(Type[Optional[CustomPageGetResponse]], ResultWrapper[CustomPageGetResponse]), ) diff --git a/src/cloudflare/resources/d1/database.py b/src/cloudflare/resources/d1/database.py index 9d0fc841381..24ae63409ad 100644 --- a/src/cloudflare/resources/d1/database.py +++ b/src/cloudflare/resources/d1/database.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal, overload import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ...types.d1 import ( @@ -65,13 +65,13 @@ def create( *, account_id: str, name: str, - primary_location_hint: Literal["wnam", "enam", "weur", "eeur", "apac", "oc"] | NotGiven = NOT_GIVEN, + primary_location_hint: Literal["wnam", "enam", "weur", "eeur", "apac", "oc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> D1: """ Returns the created D1 database. @@ -124,7 +124,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> D1: """ Updates the specified D1 database. @@ -165,15 +165,15 @@ def list( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + name: 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[DatabaseListResponse]: """ Returns a list of D1 databases. @@ -227,7 +227,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes the specified D1 database. @@ -266,13 +266,13 @@ def edit( database_id: str, *, account_id: str, - read_replication: database_edit_params.ReadReplication | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> D1: """ Updates partially the specified D1 database. @@ -315,14 +315,14 @@ def export( *, account_id: str, output_format: Literal["polling"], - current_bookmark: str | NotGiven = NOT_GIVEN, - dump_options: database_export_params.DumpOptions | NotGiven = NOT_GIVEN, + current_bookmark: str | Omit = omit, + dump_options: database_export_params.DumpOptions | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseExportResponse: """Returns a URL where the SQL contents of your D1 can be downloaded. @@ -383,7 +383,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> D1: """ Returns the specified D1 database. @@ -430,7 +430,7 @@ def import_( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseImportResponse: """ Generates a temporary URL for uploading an SQL file to, then instructing the D1 @@ -472,7 +472,7 @@ def import_( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseImportResponse: """ Generates a temporary URL for uploading an SQL file to, then instructing the D1 @@ -514,7 +514,7 @@ def import_( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseImportResponse: """ Generates a temporary URL for uploading an SQL file to, then instructing the D1 @@ -551,15 +551,15 @@ def import_( *, account_id: str, action: Literal["init"] | Literal["ingest"] | Literal["poll"], - etag: str | NotGiven = NOT_GIVEN, - filename: str | NotGiven = NOT_GIVEN, - current_bookmark: str | NotGiven = NOT_GIVEN, + etag: str | Omit = omit, + filename: str | Omit = omit, + current_bookmark: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseImportResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -592,13 +592,13 @@ def query( *, account_id: str, sql: str, - params: List[str] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[QueryResult]: """ Returns the query result as an object. @@ -646,13 +646,13 @@ def raw( *, account_id: str, sql: str, - params: List[str] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DatabaseRawResponse]: """Returns the query result rows as arrays rather than objects. @@ -722,13 +722,13 @@ async def create( *, account_id: str, name: str, - primary_location_hint: Literal["wnam", "enam", "weur", "eeur", "apac", "oc"] | NotGiven = NOT_GIVEN, + primary_location_hint: Literal["wnam", "enam", "weur", "eeur", "apac", "oc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> D1: """ Returns the created D1 database. @@ -781,7 +781,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> D1: """ Updates the specified D1 database. @@ -824,15 +824,15 @@ def list( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + name: 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DatabaseListResponse, AsyncV4PagePaginationArray[DatabaseListResponse]]: """ Returns a list of D1 databases. @@ -886,7 +886,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes the specified D1 database. @@ -925,13 +925,13 @@ async def edit( database_id: str, *, account_id: str, - read_replication: database_edit_params.ReadReplication | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> D1: """ Updates partially the specified D1 database. @@ -976,14 +976,14 @@ async def export( *, account_id: str, output_format: Literal["polling"], - current_bookmark: str | NotGiven = NOT_GIVEN, - dump_options: database_export_params.DumpOptions | NotGiven = NOT_GIVEN, + current_bookmark: str | Omit = omit, + dump_options: database_export_params.DumpOptions | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseExportResponse: """Returns a URL where the SQL contents of your D1 can be downloaded. @@ -1044,7 +1044,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> D1: """ Returns the specified D1 database. @@ -1091,7 +1091,7 @@ async def import_( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseImportResponse: """ Generates a temporary URL for uploading an SQL file to, then instructing the D1 @@ -1133,7 +1133,7 @@ async def import_( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseImportResponse: """ Generates a temporary URL for uploading an SQL file to, then instructing the D1 @@ -1175,7 +1175,7 @@ async def import_( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseImportResponse: """ Generates a temporary URL for uploading an SQL file to, then instructing the D1 @@ -1212,15 +1212,15 @@ async def import_( *, account_id: str, action: Literal["init"] | Literal["ingest"] | Literal["poll"], - etag: str | NotGiven = NOT_GIVEN, - filename: str | NotGiven = NOT_GIVEN, - current_bookmark: str | NotGiven = NOT_GIVEN, + etag: str | Omit = omit, + filename: str | Omit = omit, + current_bookmark: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseImportResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -1253,13 +1253,13 @@ def query( *, account_id: str, sql: str, - params: List[str] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[QueryResult, AsyncSinglePage[QueryResult]]: """ Returns the query result as an object. @@ -1307,13 +1307,13 @@ def raw( *, account_id: str, sql: str, - params: List[str] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DatabaseRawResponse, AsyncSinglePage[DatabaseRawResponse]]: """Returns the query result rows as arrays rather than objects. diff --git a/src/cloudflare/resources/dcv_delegation.py b/src/cloudflare/resources/dcv_delegation.py index c6a830194b0..f421bf26ac2 100644 --- a/src/cloudflare/resources/dcv_delegation.py +++ b/src/cloudflare/resources/dcv_delegation.py @@ -6,7 +6,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Query, Headers, NotGiven, not_given from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DCVDelegationUUID]: """ Retrieve the account and zone specific unique identifier used as part of the @@ -112,7 +112,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DCVDelegationUUID]: """ Retrieve the account and zone specific unique identifier used as part of the diff --git a/src/cloudflare/resources/diagnostics/__init__.py b/src/cloudflare/resources/diagnostics/__init__.py index 4ccc6dce7cb..0c5fba15051 100644 --- a/src/cloudflare/resources/diagnostics/__init__.py +++ b/src/cloudflare/resources/diagnostics/__init__.py @@ -16,6 +16,14 @@ TraceroutesResourceWithStreamingResponse, AsyncTraceroutesResourceWithStreamingResponse, ) +from .endpoint_healthchecks import ( + EndpointHealthchecksResource, + AsyncEndpointHealthchecksResource, + EndpointHealthchecksResourceWithRawResponse, + AsyncEndpointHealthchecksResourceWithRawResponse, + EndpointHealthchecksResourceWithStreamingResponse, + AsyncEndpointHealthchecksResourceWithStreamingResponse, +) __all__ = [ "TraceroutesResource", @@ -24,6 +32,12 @@ "AsyncTraceroutesResourceWithRawResponse", "TraceroutesResourceWithStreamingResponse", "AsyncTraceroutesResourceWithStreamingResponse", + "EndpointHealthchecksResource", + "AsyncEndpointHealthchecksResource", + "EndpointHealthchecksResourceWithRawResponse", + "AsyncEndpointHealthchecksResourceWithRawResponse", + "EndpointHealthchecksResourceWithStreamingResponse", + "AsyncEndpointHealthchecksResourceWithStreamingResponse", "DiagnosticsResource", "AsyncDiagnosticsResource", "DiagnosticsResourceWithRawResponse", diff --git a/src/cloudflare/resources/diagnostics/diagnostics.py b/src/cloudflare/resources/diagnostics/diagnostics.py index e745c5cefb6..440f6803afe 100644 --- a/src/cloudflare/resources/diagnostics/diagnostics.py +++ b/src/cloudflare/resources/diagnostics/diagnostics.py @@ -12,6 +12,14 @@ TraceroutesResourceWithStreamingResponse, AsyncTraceroutesResourceWithStreamingResponse, ) +from .endpoint_healthchecks import ( + EndpointHealthchecksResource, + AsyncEndpointHealthchecksResource, + EndpointHealthchecksResourceWithRawResponse, + AsyncEndpointHealthchecksResourceWithRawResponse, + EndpointHealthchecksResourceWithStreamingResponse, + AsyncEndpointHealthchecksResourceWithStreamingResponse, +) __all__ = ["DiagnosticsResource", "AsyncDiagnosticsResource"] @@ -21,6 +29,10 @@ class DiagnosticsResource(SyncAPIResource): def traceroutes(self) -> TraceroutesResource: return TraceroutesResource(self._client) + @cached_property + def endpoint_healthchecks(self) -> EndpointHealthchecksResource: + return EndpointHealthchecksResource(self._client) + @cached_property def with_raw_response(self) -> DiagnosticsResourceWithRawResponse: """ @@ -46,6 +58,10 @@ class AsyncDiagnosticsResource(AsyncAPIResource): def traceroutes(self) -> AsyncTraceroutesResource: return AsyncTraceroutesResource(self._client) + @cached_property + def endpoint_healthchecks(self) -> AsyncEndpointHealthchecksResource: + return AsyncEndpointHealthchecksResource(self._client) + @cached_property def with_raw_response(self) -> AsyncDiagnosticsResourceWithRawResponse: """ @@ -74,6 +90,10 @@ def __init__(self, diagnostics: DiagnosticsResource) -> None: def traceroutes(self) -> TraceroutesResourceWithRawResponse: return TraceroutesResourceWithRawResponse(self._diagnostics.traceroutes) + @cached_property + def endpoint_healthchecks(self) -> EndpointHealthchecksResourceWithRawResponse: + return EndpointHealthchecksResourceWithRawResponse(self._diagnostics.endpoint_healthchecks) + class AsyncDiagnosticsResourceWithRawResponse: def __init__(self, diagnostics: AsyncDiagnosticsResource) -> None: @@ -83,6 +103,10 @@ def __init__(self, diagnostics: AsyncDiagnosticsResource) -> None: def traceroutes(self) -> AsyncTraceroutesResourceWithRawResponse: return AsyncTraceroutesResourceWithRawResponse(self._diagnostics.traceroutes) + @cached_property + def endpoint_healthchecks(self) -> AsyncEndpointHealthchecksResourceWithRawResponse: + return AsyncEndpointHealthchecksResourceWithRawResponse(self._diagnostics.endpoint_healthchecks) + class DiagnosticsResourceWithStreamingResponse: def __init__(self, diagnostics: DiagnosticsResource) -> None: @@ -92,6 +116,10 @@ def __init__(self, diagnostics: DiagnosticsResource) -> None: def traceroutes(self) -> TraceroutesResourceWithStreamingResponse: return TraceroutesResourceWithStreamingResponse(self._diagnostics.traceroutes) + @cached_property + def endpoint_healthchecks(self) -> EndpointHealthchecksResourceWithStreamingResponse: + return EndpointHealthchecksResourceWithStreamingResponse(self._diagnostics.endpoint_healthchecks) + class AsyncDiagnosticsResourceWithStreamingResponse: def __init__(self, diagnostics: AsyncDiagnosticsResource) -> None: @@ -100,3 +128,7 @@ def __init__(self, diagnostics: AsyncDiagnosticsResource) -> None: @cached_property def traceroutes(self) -> AsyncTraceroutesResourceWithStreamingResponse: return AsyncTraceroutesResourceWithStreamingResponse(self._diagnostics.traceroutes) + + @cached_property + def endpoint_healthchecks(self) -> AsyncEndpointHealthchecksResourceWithStreamingResponse: + return AsyncEndpointHealthchecksResourceWithStreamingResponse(self._diagnostics.endpoint_healthchecks) diff --git a/src/cloudflare/resources/diagnostics/endpoint_healthchecks.py b/src/cloudflare/resources/diagnostics/endpoint_healthchecks.py new file mode 100644 index 00000000000..0bba3422e7d --- /dev/null +++ b/src/cloudflare/resources/diagnostics/endpoint_healthchecks.py @@ -0,0 +1,647 @@ +# 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 ..._base_client import make_request_options +from ...types.diagnostics import endpoint_healthcheck_create_params, endpoint_healthcheck_update_params +from ...types.diagnostics.endpoint_healthcheck_get_response import EndpointHealthcheckGetResponse +from ...types.diagnostics.endpoint_healthcheck_list_response import EndpointHealthcheckListResponse +from ...types.diagnostics.endpoint_healthcheck_create_response import EndpointHealthcheckCreateResponse +from ...types.diagnostics.endpoint_healthcheck_delete_response import EndpointHealthcheckDeleteResponse +from ...types.diagnostics.endpoint_healthcheck_update_response import EndpointHealthcheckUpdateResponse + +__all__ = ["EndpointHealthchecksResource", "AsyncEndpointHealthchecksResource"] + + +class EndpointHealthchecksResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> EndpointHealthchecksResourceWithRawResponse: + """ + 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 EndpointHealthchecksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> EndpointHealthchecksResourceWithStreamingResponse: + """ + 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 EndpointHealthchecksResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + check_type: Literal["icmp"], + endpoint: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[EndpointHealthcheckCreateResponse]: + """ + Create Endpoint Health Check. + + Args: + account_id: Identifier + + check_type: type of check to perform + + endpoint: the IP address of the host to perform checks against + + name: Optional name associated with this check + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/diagnostics/endpoint-healthchecks", + body=maybe_transform( + { + "check_type": check_type, + "endpoint": endpoint, + "name": name, + }, + endpoint_healthcheck_create_params.EndpointHealthcheckCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[EndpointHealthcheckCreateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[EndpointHealthcheckCreateResponse]], ResultWrapper[EndpointHealthcheckCreateResponse] + ), + ) + + def update( + self, + id: str, + *, + account_id: str, + check_type: Literal["icmp"], + endpoint: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[EndpointHealthcheckUpdateResponse]: + """ + Update a Endpoint Health Check. + + Args: + account_id: Identifier + + id: UUID. + + check_type: type of check to perform + + endpoint: the IP address of the host to perform checks against + + name: Optional name associated with this check + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._put( + f"/accounts/{account_id}/diagnostics/endpoint-healthchecks/{id}", + body=maybe_transform( + { + "check_type": check_type, + "endpoint": endpoint, + "name": name, + }, + endpoint_healthcheck_update_params.EndpointHealthcheckUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[EndpointHealthcheckUpdateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[EndpointHealthcheckUpdateResponse]], ResultWrapper[EndpointHealthcheckUpdateResponse] + ), + ) + + def list( + 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, + ) -> Optional[EndpointHealthcheckListResponse]: + """ + List Endpoint Health Checks. + + Args: + account_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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/diagnostics/endpoint-healthchecks", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[EndpointHealthcheckListResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[EndpointHealthcheckListResponse]], ResultWrapper[EndpointHealthcheckListResponse] + ), + ) + + def delete( + self, + 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, + ) -> EndpointHealthcheckDeleteResponse: + """ + Delete Endpoint Health Check. + + Args: + account_id: Identifier + + id: UUID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._delete( + f"/accounts/{account_id}/diagnostics/endpoint-healthchecks/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EndpointHealthcheckDeleteResponse, + ) + + def get( + self, + 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, + ) -> Optional[EndpointHealthcheckGetResponse]: + """ + Get a single Endpoint Health Check. + + Args: + account_id: Identifier + + id: UUID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/accounts/{account_id}/diagnostics/endpoint-healthchecks/{id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[EndpointHealthcheckGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[EndpointHealthcheckGetResponse]], ResultWrapper[EndpointHealthcheckGetResponse]), + ) + + +class AsyncEndpointHealthchecksResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncEndpointHealthchecksResourceWithRawResponse: + """ + 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 AsyncEndpointHealthchecksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncEndpointHealthchecksResourceWithStreamingResponse: + """ + 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 AsyncEndpointHealthchecksResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + check_type: Literal["icmp"], + endpoint: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[EndpointHealthcheckCreateResponse]: + """ + Create Endpoint Health Check. + + Args: + account_id: Identifier + + check_type: type of check to perform + + endpoint: the IP address of the host to perform checks against + + name: Optional name associated with this check + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/diagnostics/endpoint-healthchecks", + body=await async_maybe_transform( + { + "check_type": check_type, + "endpoint": endpoint, + "name": name, + }, + endpoint_healthcheck_create_params.EndpointHealthcheckCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[EndpointHealthcheckCreateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[EndpointHealthcheckCreateResponse]], ResultWrapper[EndpointHealthcheckCreateResponse] + ), + ) + + async def update( + self, + id: str, + *, + account_id: str, + check_type: Literal["icmp"], + endpoint: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[EndpointHealthcheckUpdateResponse]: + """ + Update a Endpoint Health Check. + + Args: + account_id: Identifier + + id: UUID. + + check_type: type of check to perform + + endpoint: the IP address of the host to perform checks against + + name: Optional name associated with this check + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._put( + f"/accounts/{account_id}/diagnostics/endpoint-healthchecks/{id}", + body=await async_maybe_transform( + { + "check_type": check_type, + "endpoint": endpoint, + "name": name, + }, + endpoint_healthcheck_update_params.EndpointHealthcheckUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[EndpointHealthcheckUpdateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[EndpointHealthcheckUpdateResponse]], ResultWrapper[EndpointHealthcheckUpdateResponse] + ), + ) + + async def list( + 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, + ) -> Optional[EndpointHealthcheckListResponse]: + """ + List Endpoint Health Checks. + + Args: + account_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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/diagnostics/endpoint-healthchecks", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[EndpointHealthcheckListResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[EndpointHealthcheckListResponse]], ResultWrapper[EndpointHealthcheckListResponse] + ), + ) + + async def delete( + self, + 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, + ) -> EndpointHealthcheckDeleteResponse: + """ + Delete Endpoint Health Check. + + Args: + account_id: Identifier + + id: UUID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._delete( + f"/accounts/{account_id}/diagnostics/endpoint-healthchecks/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=EndpointHealthcheckDeleteResponse, + ) + + async def get( + self, + 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, + ) -> Optional[EndpointHealthcheckGetResponse]: + """ + Get a single Endpoint Health Check. + + Args: + account_id: Identifier + + id: UUID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/accounts/{account_id}/diagnostics/endpoint-healthchecks/{id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[EndpointHealthcheckGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[EndpointHealthcheckGetResponse]], ResultWrapper[EndpointHealthcheckGetResponse]), + ) + + +class EndpointHealthchecksResourceWithRawResponse: + def __init__(self, endpoint_healthchecks: EndpointHealthchecksResource) -> None: + self._endpoint_healthchecks = endpoint_healthchecks + + self.create = to_raw_response_wrapper( + endpoint_healthchecks.create, + ) + self.update = to_raw_response_wrapper( + endpoint_healthchecks.update, + ) + self.list = to_raw_response_wrapper( + endpoint_healthchecks.list, + ) + self.delete = to_raw_response_wrapper( + endpoint_healthchecks.delete, + ) + self.get = to_raw_response_wrapper( + endpoint_healthchecks.get, + ) + + +class AsyncEndpointHealthchecksResourceWithRawResponse: + def __init__(self, endpoint_healthchecks: AsyncEndpointHealthchecksResource) -> None: + self._endpoint_healthchecks = endpoint_healthchecks + + self.create = async_to_raw_response_wrapper( + endpoint_healthchecks.create, + ) + self.update = async_to_raw_response_wrapper( + endpoint_healthchecks.update, + ) + self.list = async_to_raw_response_wrapper( + endpoint_healthchecks.list, + ) + self.delete = async_to_raw_response_wrapper( + endpoint_healthchecks.delete, + ) + self.get = async_to_raw_response_wrapper( + endpoint_healthchecks.get, + ) + + +class EndpointHealthchecksResourceWithStreamingResponse: + def __init__(self, endpoint_healthchecks: EndpointHealthchecksResource) -> None: + self._endpoint_healthchecks = endpoint_healthchecks + + self.create = to_streamed_response_wrapper( + endpoint_healthchecks.create, + ) + self.update = to_streamed_response_wrapper( + endpoint_healthchecks.update, + ) + self.list = to_streamed_response_wrapper( + endpoint_healthchecks.list, + ) + self.delete = to_streamed_response_wrapper( + endpoint_healthchecks.delete, + ) + self.get = to_streamed_response_wrapper( + endpoint_healthchecks.get, + ) + + +class AsyncEndpointHealthchecksResourceWithStreamingResponse: + def __init__(self, endpoint_healthchecks: AsyncEndpointHealthchecksResource) -> None: + self._endpoint_healthchecks = endpoint_healthchecks + + self.create = async_to_streamed_response_wrapper( + endpoint_healthchecks.create, + ) + self.update = async_to_streamed_response_wrapper( + endpoint_healthchecks.update, + ) + self.list = async_to_streamed_response_wrapper( + endpoint_healthchecks.list, + ) + self.delete = async_to_streamed_response_wrapper( + endpoint_healthchecks.delete, + ) + self.get = async_to_streamed_response_wrapper( + endpoint_healthchecks.get, + ) diff --git a/src/cloudflare/resources/diagnostics/traceroutes.py b/src/cloudflare/resources/diagnostics/traceroutes.py index 3428333be8a..115fbfcfeb8 100644 --- a/src/cloudflare/resources/diagnostics/traceroutes.py +++ b/src/cloudflare/resources/diagnostics/traceroutes.py @@ -2,11 +2,9 @@ from __future__ import annotations -from typing import List - import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -48,15 +46,15 @@ def create( self, *, account_id: str, - targets: List[str], - colos: List[str] | NotGiven = NOT_GIVEN, - options: traceroute_create_params.Options | NotGiven = NOT_GIVEN, + targets: SequenceNotStr[str], + colos: SequenceNotStr[str] | Omit = omit, + options: traceroute_create_params.Options | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Traceroute]: """ Run traceroutes from Cloudflare colos. @@ -120,15 +118,15 @@ def create( self, *, account_id: str, - targets: List[str], - colos: List[str] | NotGiven = NOT_GIVEN, - options: traceroute_create_params.Options | NotGiven = NOT_GIVEN, + targets: SequenceNotStr[str], + colos: SequenceNotStr[str] | Omit = omit, + options: traceroute_create_params.Options | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Traceroute, AsyncSinglePage[Traceroute]]: """ Run traceroutes from Cloudflare colos. diff --git a/src/cloudflare/resources/dns/analytics/reports/bytimes.py b/src/cloudflare/resources/dns/analytics/reports/bytimes.py index e18d4872e7e..ea25529f907 100644 --- a/src/cloudflare/resources/dns/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns/analytics/reports/bytimes.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,21 +50,21 @@ def get( self, *, zone_id: str, - dimensions: str | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metrics: str | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: str | NotGiven = NOT_GIVEN, + dimensions: str | Omit = omit, + filters: str | Omit = omit, + limit: int | Omit = omit, + metrics: str | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: str | Omit = omit, time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] - | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ByTime]: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -153,21 +153,21 @@ async def get( self, *, zone_id: str, - dimensions: str | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metrics: str | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: str | NotGiven = NOT_GIVEN, + dimensions: str | Omit = omit, + filters: str | Omit = omit, + limit: int | Omit = omit, + metrics: str | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: str | Omit = omit, time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] - | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ByTime]: """ Retrieves a list of aggregate metrics grouped by time interval. diff --git a/src/cloudflare/resources/dns/analytics/reports/reports.py b/src/cloudflare/resources/dns/analytics/reports/reports.py index 39a975be9f5..2d1379eb601 100644 --- a/src/cloudflare/resources/dns/analytics/reports/reports.py +++ b/src/cloudflare/resources/dns/analytics/reports/reports.py @@ -15,7 +15,7 @@ BytimesResourceWithStreamingResponse, AsyncBytimesResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -61,19 +61,19 @@ def get( self, *, zone_id: str, - dimensions: str | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metrics: str | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: str | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + dimensions: str | Omit = omit, + filters: str | Omit = omit, + limit: int | Omit = omit, + metrics: str | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: str | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Report]: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -163,19 +163,19 @@ async def get( self, *, zone_id: str, - dimensions: str | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metrics: str | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: str | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + dimensions: str | Omit = omit, + filters: str | Omit = omit, + limit: int | Omit = omit, + metrics: str | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: str | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Report]: """ Retrieves a list of summarised aggregate metrics over a given time period. diff --git a/src/cloudflare/resources/dns/dnssec.py b/src/cloudflare/resources/dns/dnssec.py index 359df154967..a2b78039737 100644 --- a/src/cloudflare/resources/dns/dnssec.py +++ b/src/cloudflare/resources/dns/dnssec.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,7 +55,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Delete DNSSEC. @@ -89,16 +89,16 @@ def edit( self, *, zone_id: str, - dnssec_multi_signer: bool | NotGiven = NOT_GIVEN, - dnssec_presigned: bool | NotGiven = NOT_GIVEN, - dnssec_use_nsec3: bool | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, + dnssec_multi_signer: bool | Omit = omit, + dnssec_presigned: bool | Omit = omit, + dnssec_use_nsec3: bool | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSSEC]: """ Enable or disable DNSSEC. @@ -175,7 +175,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSSEC]: """ Details about DNSSEC status and configuration. @@ -235,7 +235,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Delete DNSSEC. @@ -269,16 +269,16 @@ async def edit( self, *, zone_id: str, - dnssec_multi_signer: bool | NotGiven = NOT_GIVEN, - dnssec_presigned: bool | NotGiven = NOT_GIVEN, - dnssec_use_nsec3: bool | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, + dnssec_multi_signer: bool | Omit = omit, + dnssec_presigned: bool | Omit = omit, + dnssec_use_nsec3: bool | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSSEC]: """ Enable or disable DNSSEC. @@ -355,7 +355,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSSEC]: """ Details about DNSSEC status and configuration. diff --git a/src/cloudflare/resources/dns/records.py b/src/cloudflare/resources/dns/records.py index 7fe82213b8c..1353b2d22c4 100644 --- a/src/cloudflare/resources/dns/records.py +++ b/src/cloudflare/resources/dns/records.py @@ -2,12 +2,13 @@ from __future__ import annotations -from typing import Any, List, Type, Iterable, Optional, cast +import typing_extensions +from typing import Any, Type, Iterable, Optional, cast from typing_extensions import Literal, overload import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -26,8 +27,9 @@ record_create_params, record_import_params, record_update_params, + record_scan_review_params, ) -from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ...pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ..._base_client import AsyncPaginator, make_request_options from ...types.dns.ttl_param import TTLParam from ...types.dns.record_tags import RecordTags @@ -39,6 +41,8 @@ from ...types.dns.record_batch_response import RecordBatchResponse from ...types.dns.record_delete_response import RecordDeleteResponse from ...types.dns.record_import_response import RecordImportResponse +from ...types.dns.record_scan_review_response import RecordScanReviewResponse +from ...types.dns.record_scan_trigger_response import RecordScanTriggerResponse __all__ = ["RecordsResource", "AsyncRecordsResource"] @@ -69,19 +73,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.ARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.ARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -96,7 +100,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -112,10 +120,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -132,19 +136,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["AAAA"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.AAAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.AAAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -159,7 +163,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -175,10 +183,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -195,19 +199,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CNAME"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.CNAMERecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -222,7 +226,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -238,10 +246,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -258,20 +262,20 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["MX"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.MXRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.MXRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -286,7 +290,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -305,10 +313,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -325,19 +329,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NS"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.NSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -352,7 +356,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -368,10 +376,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -388,19 +392,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["OPENPGPKEY"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -415,7 +419,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -431,10 +439,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -451,19 +455,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["PTR"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.PTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.PTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -478,7 +482,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -494,10 +502,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -514,19 +518,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TXT"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TXTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.TXTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -541,7 +545,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -562,10 +570,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -582,19 +586,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CAA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.CAARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.CAARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.CAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -609,7 +613,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -625,10 +633,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -645,19 +649,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CERT"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.CERTRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CERTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.CERTRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.CERTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -672,7 +676,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -688,10 +696,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -708,19 +712,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DNSKEY"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.DNSKEYRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.DNSKEYRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -735,7 +739,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -751,10 +759,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -771,19 +775,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.DSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.DSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.DSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -798,7 +802,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -814,10 +822,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -834,19 +838,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["HTTPS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.HTTPSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.HTTPSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -861,7 +865,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -877,10 +885,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -897,19 +901,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["LOC"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.LOCRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.LOCRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.LOCRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.LOCRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -924,7 +928,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -940,10 +948,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -960,19 +964,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NAPTR"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.NAPTRRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.NAPTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -987,7 +991,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1003,10 +1011,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1023,19 +1027,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SMIMEA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.SMIMEARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.SMIMEARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1050,7 +1054,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1066,10 +1074,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1086,19 +1090,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SRV"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SRVRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SRVRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.SRVRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.SRVRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1113,7 +1117,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1129,10 +1137,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1149,19 +1153,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SSHFP"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.SSHFPRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.SSHFPRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1176,7 +1180,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1192,10 +1200,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1212,19 +1216,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SVCB"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SVCBRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.SVCBRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.SVCBRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1239,7 +1243,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1255,10 +1263,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1275,19 +1279,19 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TLSA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.TLSARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TLSARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.TLSARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.TLSARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1302,7 +1306,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1318,10 +1326,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1338,20 +1342,20 @@ def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.URIRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.URIRecordData | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.URIRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -1366,7 +1370,11 @@ def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1385,10 +1393,6 @@ def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1399,12 +1403,13 @@ def create( """ ... - @required_args(["zone_id", "name", "type"]) + @required_args(["zone_id", "name", "ttl", "type"]) def create( self, *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"] | Literal["AAAA"] | Literal["CNAME"] @@ -1426,15 +1431,33 @@ def create( | Literal["SVCB"] | Literal["TLSA"] | Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, settings: record_create_params.ARecordSettings + | record_create_params.AAAARecordSettings | record_create_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + | record_create_params.MXRecordSettings + | record_create_params.NSRecordSettings + | record_create_params.DNSRecordsOpenpgpkeyRecordSettings + | record_create_params.PTRRecordSettings + | record_create_params.TXTRecordSettings + | record_create_params.CAARecordSettings + | record_create_params.CERTRecordSettings + | record_create_params.DNSKEYRecordSettings + | record_create_params.DSRecordSettings + | record_create_params.HTTPSRecordSettings + | record_create_params.LOCRecordSettings + | record_create_params.NAPTRRecordSettings + | record_create_params.SMIMEARecordSettings + | record_create_params.SRVRecordSettings + | record_create_params.SSHFPRecordSettings + | record_create_params.SVCBRecordSettings + | record_create_params.TLSARecordSettings + | record_create_params.URIRecordSettings + | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, + priority: float | Omit = omit, data: record_create_params.CAARecordData | record_create_params.CERTRecordData | record_create_params.DNSKEYRecordData @@ -1445,14 +1468,16 @@ def create( | record_create_params.SMIMEARecordData | record_create_params.SRVRecordData | record_create_params.SSHFPRecordData + | record_create_params.SVCBRecordData + | record_create_params.TLSARecordData | record_create_params.URIRecordData - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -1463,13 +1488,13 @@ def create( body=maybe_transform( { "name": name, + "ttl": ttl, "type": type, "comment": comment, "content": content, "proxied": proxied, "settings": settings, "tags": tags, - "ttl": ttl, "priority": priority, "data": data, }, @@ -1495,19 +1520,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.ARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.ARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1524,7 +1549,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1540,10 +1569,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1561,19 +1586,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["AAAA"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.AAAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.AAAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1590,7 +1615,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1606,10 +1635,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1627,19 +1652,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CNAME"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.CNAMERecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1656,7 +1681,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1672,10 +1701,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1693,20 +1718,20 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["MX"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.MXRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.MXRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1723,7 +1748,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1742,10 +1771,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1763,19 +1788,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NS"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.NSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1792,7 +1817,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1808,10 +1837,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1829,19 +1854,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["OPENPGPKEY"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1858,7 +1883,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1874,10 +1903,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1895,19 +1920,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["PTR"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.PTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.PTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1924,7 +1949,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -1940,10 +1969,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1961,19 +1986,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TXT"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TXTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.TXTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -1990,7 +2015,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2011,10 +2040,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2032,19 +2057,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CAA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.CAARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.CAARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.CAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2061,7 +2086,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2077,10 +2106,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2098,19 +2123,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CERT"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.CERTRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CERTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.CERTRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.CERTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2127,7 +2152,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2143,10 +2172,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2164,19 +2189,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DNSKEY"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.DNSKEYRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.DNSKEYRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2193,7 +2218,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2209,10 +2238,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2230,19 +2255,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.DSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.DSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.DSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2259,7 +2284,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2275,10 +2304,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2296,19 +2321,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["HTTPS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.HTTPSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.HTTPSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2325,7 +2350,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2341,10 +2370,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2362,19 +2387,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["LOC"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.LOCRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.LOCRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.LOCRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.LOCRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2391,7 +2416,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2407,10 +2436,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2428,19 +2453,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NAPTR"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.NAPTRRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.NAPTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2457,7 +2482,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2473,10 +2502,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2494,19 +2519,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SMIMEA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.SMIMEARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.SMIMEARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2523,7 +2548,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2539,10 +2568,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2560,19 +2585,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SRV"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SRVRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SRVRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.SRVRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.SRVRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2589,7 +2614,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2605,10 +2634,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2626,19 +2651,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SSHFP"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.SSHFPRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.SSHFPRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2655,7 +2680,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2671,10 +2700,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2692,19 +2717,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SVCB"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SVCBRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.SVCBRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.SVCBRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2721,7 +2746,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2737,10 +2766,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2758,19 +2783,19 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TLSA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.TLSARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TLSARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.TLSARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.TLSARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2787,7 +2812,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2803,10 +2832,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2824,20 +2849,20 @@ def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.URIRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.URIRecordData | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.URIRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -2854,7 +2879,11 @@ def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -2873,10 +2902,6 @@ def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2887,13 +2912,14 @@ def update( """ ... - @required_args(["zone_id", "name", "type"]) + @required_args(["zone_id", "name", "ttl", "type"]) def update( self, dns_record_id: str, *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"] | Literal["AAAA"] | Literal["CNAME"] @@ -2915,15 +2941,33 @@ def update( | Literal["SVCB"] | Literal["TLSA"] | Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, settings: record_update_params.ARecordSettings + | record_update_params.AAAARecordSettings | record_update_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + | record_update_params.MXRecordSettings + | record_update_params.NSRecordSettings + | record_update_params.DNSRecordsOpenpgpkeyRecordSettings + | record_update_params.PTRRecordSettings + | record_update_params.TXTRecordSettings + | record_update_params.CAARecordSettings + | record_update_params.CERTRecordSettings + | record_update_params.DNSKEYRecordSettings + | record_update_params.DSRecordSettings + | record_update_params.HTTPSRecordSettings + | record_update_params.LOCRecordSettings + | record_update_params.NAPTRRecordSettings + | record_update_params.SMIMEARecordSettings + | record_update_params.SRVRecordSettings + | record_update_params.SSHFPRecordSettings + | record_update_params.SVCBRecordSettings + | record_update_params.TLSARecordSettings + | record_update_params.URIRecordSettings + | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, + priority: float | Omit = omit, data: record_update_params.CAARecordData | record_update_params.CERTRecordData | record_update_params.DNSKEYRecordData @@ -2934,14 +2978,16 @@ def update( | record_update_params.SMIMEARecordData | record_update_params.SRVRecordData | record_update_params.SSHFPRecordData + | record_update_params.SVCBRecordData + | record_update_params.TLSARecordData | record_update_params.URIRecordData - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -2954,13 +3000,13 @@ def update( body=maybe_transform( { "name": name, + "ttl": ttl, "type": type, "comment": comment, "content": content, "proxied": proxied, "settings": settings, "tags": tags, - "ttl": ttl, "priority": priority, "data": data, }, @@ -2983,18 +3029,18 @@ def list( self, *, zone_id: str, - comment: record_list_params.Comment | NotGiven = NOT_GIVEN, - content: record_list_params.Content | NotGiven = NOT_GIVEN, - direction: SortDirection | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: record_list_params.Name | NotGiven = NOT_GIVEN, - order: Literal["type", "name", "content", "ttl", "proxied"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - tag: record_list_params.Tag | NotGiven = NOT_GIVEN, - tag_match: Literal["any", "all"] | NotGiven = NOT_GIVEN, + comment: record_list_params.Comment | Omit = omit, + content: record_list_params.Content | Omit = omit, + direction: SortDirection | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + name: record_list_params.Name | Omit = omit, + order: Literal["type", "name", "content", "ttl", "proxied"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + proxied: bool | Omit = omit, + search: str | Omit = omit, + tag: record_list_params.Tag | Omit = omit, + tag_match: Literal["any", "all"] | Omit = omit, type: Literal[ "A", "AAAA", @@ -3018,13 +3064,13 @@ def list( "TXT", "URI", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[RecordResponse]: """ List, search, sort, and filter a zones' DNS records. @@ -3111,7 +3157,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordDeleteResponse]: """ Delete DNS Record @@ -3149,16 +3195,16 @@ def batch( self, *, zone_id: str, - deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, - patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, - posts: Iterable[record_batch_params.Post] | NotGiven = NOT_GIVEN, - puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, + deletes: Iterable[record_batch_params.Delete] | Omit = omit, + patches: Iterable[BatchPatchParam] | Omit = omit, + posts: Iterable[record_batch_params.Post] | Omit = omit, + puts: Iterable[BatchPutParam] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordBatchResponse]: """ Send a Batch of DNS Record API calls to be executed together. @@ -3220,19 +3266,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.ARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.ARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3249,7 +3295,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3265,10 +3315,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3286,19 +3332,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["AAAA"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.AAAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.AAAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3315,7 +3361,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3331,10 +3381,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3352,19 +3398,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CNAME"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.CNAMERecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3381,7 +3427,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3397,10 +3447,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3418,20 +3464,20 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["MX"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.MXRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.MXRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3448,7 +3494,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3467,10 +3517,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3488,19 +3534,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NS"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.NSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3517,7 +3563,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3533,10 +3583,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3554,19 +3600,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["OPENPGPKEY"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3583,7 +3629,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3599,10 +3649,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3620,19 +3666,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["PTR"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.PTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.PTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3649,7 +3695,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3665,10 +3715,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3686,19 +3732,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TXT"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TXTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.TXTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3715,7 +3761,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3736,10 +3786,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3757,19 +3803,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CAA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.CAARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.CAARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.CAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3786,7 +3832,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3802,10 +3852,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3823,19 +3869,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CERT"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.CERTRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CERTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.CERTRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.CERTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3852,7 +3898,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3868,10 +3918,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3889,19 +3935,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DNSKEY"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.DNSKEYRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.DNSKEYRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3918,7 +3964,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -3934,10 +3984,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3955,19 +4001,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.DSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.DSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.DSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -3984,7 +4030,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4000,10 +4050,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4021,19 +4067,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["HTTPS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.HTTPSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.HTTPSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4050,7 +4096,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4066,10 +4116,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4087,19 +4133,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["LOC"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.LOCRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.LOCRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.LOCRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.LOCRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4116,7 +4162,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4132,10 +4182,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4153,19 +4199,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NAPTR"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.NAPTRRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.NAPTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4182,7 +4228,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4198,10 +4248,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4219,19 +4265,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SMIMEA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.SMIMEARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.SMIMEARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4248,7 +4294,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4264,10 +4314,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4285,19 +4331,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SRV"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SRVRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SRVRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.SRVRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.SRVRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4314,7 +4360,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4330,10 +4380,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4351,19 +4397,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SSHFP"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.SSHFPRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.SSHFPRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4380,7 +4426,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4396,10 +4446,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4417,19 +4463,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SVCB"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SVCBRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.SVCBRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.SVCBRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4446,7 +4492,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4462,10 +4512,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4483,19 +4529,19 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TLSA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.TLSARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TLSARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.TLSARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.TLSARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4512,7 +4558,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4528,10 +4578,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4549,20 +4595,20 @@ def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.URIRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.URIRecordData | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.URIRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -4579,7 +4625,11 @@ def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4598,10 +4648,6 @@ def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4612,13 +4658,14 @@ def edit( """ ... - @required_args(["zone_id", "name", "type"]) + @required_args(["zone_id", "name", "ttl", "type"]) def edit( self, dns_record_id: str, *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"] | Literal["AAAA"] | Literal["CNAME"] @@ -4640,13 +4687,33 @@ def edit( | Literal["SVCB"] | Literal["TLSA"] | Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.ARecordSettings | record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.ARecordSettings + | record_edit_params.AAAARecordSettings + | record_edit_params.CNAMERecordSettings + | record_edit_params.MXRecordSettings + | record_edit_params.NSRecordSettings + | record_edit_params.DNSRecordsOpenpgpkeyRecordSettings + | record_edit_params.PTRRecordSettings + | record_edit_params.TXTRecordSettings + | record_edit_params.CAARecordSettings + | record_edit_params.CERTRecordSettings + | record_edit_params.DNSKEYRecordSettings + | record_edit_params.DSRecordSettings + | record_edit_params.HTTPSRecordSettings + | record_edit_params.LOCRecordSettings + | record_edit_params.NAPTRRecordSettings + | record_edit_params.SMIMEARecordSettings + | record_edit_params.SRVRecordSettings + | record_edit_params.SSHFPRecordSettings + | record_edit_params.SVCBRecordSettings + | record_edit_params.TLSARecordSettings + | record_edit_params.URIRecordSettings + | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, + priority: float | Omit = omit, data: record_edit_params.CAARecordData | record_edit_params.CERTRecordData | record_edit_params.DNSKEYRecordData @@ -4657,14 +4724,16 @@ def edit( | record_edit_params.SMIMEARecordData | record_edit_params.SRVRecordData | record_edit_params.SSHFPRecordData + | record_edit_params.SVCBRecordData + | record_edit_params.TLSARecordData | record_edit_params.URIRecordData - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -4677,13 +4746,13 @@ def edit( body=maybe_transform( { "name": name, + "ttl": ttl, "type": type, "comment": comment, "content": content, "proxied": proxied, "settings": settings, "tags": tags, - "ttl": ttl, "priority": priority, "data": data, }, @@ -4711,7 +4780,7 @@ def export( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ You can export your @@ -4754,7 +4823,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ DNS Record Details @@ -4798,13 +4867,13 @@ def import_( *, zone_id: str, file: str, - proxied: str | NotGiven = NOT_GIVEN, + proxied: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordImportResponse]: """ You can upload your @@ -4862,6 +4931,9 @@ def import_( cast_to=cast(Type[Optional[RecordImportResponse]], ResultWrapper[RecordImportResponse]), ) + @typing_extensions.deprecated( + "This endpoint is deprecated in favor of a new asynchronous version. Please use the [/scan/trigger](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/scan/trigger) and [/scan/review](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/scan/review) endpoints instead.\n" + ) def scan( self, *, @@ -4872,7 +4944,7 @@ def scan( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordScanResponse]: """ Scan for common DNS records on your domain and automatically add them to your @@ -4904,8 +4976,137 @@ def scan( cast_to=cast(Type[Optional[RecordScanResponse]], ResultWrapper[RecordScanResponse]), ) - -class AsyncRecordsResource(AsyncAPIResource): + def scan_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[RecordResponse]: + """ + Retrieves the list of DNS records discovered up to this point by the + asynchronous scan. These records are temporary until explicitly accepted or + rejected via `POST /scan/review`. Additional records may be discovered by the + scan later. + + 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}/dns_records/scan/review", + page=SyncSinglePage[RecordResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=cast(Any, RecordResponse), # Union types cannot be passed in as arguments in the type system + ) + + def scan_review( + self, + *, + zone_id: str, + accepts: Iterable[record_scan_review_params.Accept] | Omit = omit, + rejects: Iterable[record_scan_review_params.Reject] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[RecordScanReviewResponse]: + """Accept or reject DNS records found by the DNS records scan. + + Accepted records + will be permanently added to the zone, while rejected records will be + permanently 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}") + return self._post( + f"/zones/{zone_id}/dns_records/scan/review", + body=maybe_transform( + { + "accepts": accepts, + "rejects": rejects, + }, + record_scan_review_params.RecordScanReviewParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RecordScanReviewResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RecordScanReviewResponse]], ResultWrapper[RecordScanReviewResponse]), + ) + + def scan_trigger( + 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, + ) -> RecordScanTriggerResponse: + """Initiates an asynchronous scan for common DNS records on your domain. + + Note that + this **does not** automatically add records to your zone. The scan runs in the + background, and results can be reviewed later using the `/scan/review` + endpoints. Useful if you haven't updated your nameservers yet. + + Args: + zone_id: Identifier. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._post( + f"/zones/{zone_id}/dns_records/scan/trigger", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RecordScanTriggerResponse, + ) + + +class AsyncRecordsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRecordsResourceWithRawResponse: """ @@ -4931,19 +5132,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.ARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.ARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -4958,7 +5159,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -4974,10 +5179,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4994,19 +5195,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["AAAA"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.AAAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.AAAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5021,7 +5222,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5037,10 +5242,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5057,19 +5258,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CNAME"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.CNAMERecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5084,7 +5285,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5100,10 +5305,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5120,20 +5321,20 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["MX"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.MXRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.MXRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5148,7 +5349,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5167,10 +5372,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5187,19 +5388,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NS"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.NSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5214,7 +5415,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5230,10 +5435,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5250,19 +5451,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["OPENPGPKEY"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.DNSRecordsOpenpgpkeyRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5277,7 +5478,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5293,10 +5498,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5313,19 +5514,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["PTR"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.PTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.PTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5340,7 +5541,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5356,10 +5561,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5376,19 +5577,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TXT"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TXTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.TXTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5403,7 +5604,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5424,10 +5629,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5444,19 +5645,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CAA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.CAARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.CAARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.CAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5471,7 +5672,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5487,10 +5692,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5507,19 +5708,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CERT"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.CERTRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.CERTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.CERTRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.CERTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5534,7 +5735,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5550,10 +5755,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5570,19 +5771,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DNSKEY"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.DNSKEYRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.DNSKEYRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5597,7 +5798,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5613,10 +5818,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5633,19 +5834,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.DSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.DSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.DSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.DSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5660,7 +5861,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5676,10 +5881,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5696,19 +5897,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["HTTPS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.HTTPSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.HTTPSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5723,7 +5924,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5739,10 +5944,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5759,19 +5960,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["LOC"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.LOCRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.LOCRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.LOCRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.LOCRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5786,7 +5987,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5802,10 +6007,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5822,19 +6023,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NAPTR"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.NAPTRRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.NAPTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5849,7 +6050,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5865,10 +6070,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5885,19 +6086,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SMIMEA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.SMIMEARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.SMIMEARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5912,7 +6113,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5928,10 +6133,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5948,19 +6149,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SRV"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SRVRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SRVRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.SRVRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.SRVRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -5975,7 +6176,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -5991,10 +6196,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6011,19 +6212,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SSHFP"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.SSHFPRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.SSHFPRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -6038,7 +6239,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6054,10 +6259,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6074,19 +6275,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SVCB"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.SVCBRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.SVCBRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.SVCBRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -6101,7 +6302,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6117,10 +6322,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6137,19 +6338,19 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TLSA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.TLSARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.TLSARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.TLSARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.TLSARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -6164,7 +6365,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6180,10 +6385,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6200,20 +6401,20 @@ async def create( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - data: record_create_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_create_params.URIRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_create_params.URIRecordData | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_create_params.URIRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Create a new DNS record for a zone. @@ -6228,7 +6429,11 @@ async def create( Args: zone_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6247,10 +6452,6 @@ async def create( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6261,12 +6462,13 @@ async def create( """ ... - @required_args(["zone_id", "name", "type"]) + @required_args(["zone_id", "name", "ttl", "type"]) async def create( self, *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"] | Literal["AAAA"] | Literal["CNAME"] @@ -6288,15 +6490,33 @@ async def create( | Literal["SVCB"] | Literal["TLSA"] | Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, settings: record_create_params.ARecordSettings + | record_create_params.AAAARecordSettings | record_create_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + | record_create_params.MXRecordSettings + | record_create_params.NSRecordSettings + | record_create_params.DNSRecordsOpenpgpkeyRecordSettings + | record_create_params.PTRRecordSettings + | record_create_params.TXTRecordSettings + | record_create_params.CAARecordSettings + | record_create_params.CERTRecordSettings + | record_create_params.DNSKEYRecordSettings + | record_create_params.DSRecordSettings + | record_create_params.HTTPSRecordSettings + | record_create_params.LOCRecordSettings + | record_create_params.NAPTRRecordSettings + | record_create_params.SMIMEARecordSettings + | record_create_params.SRVRecordSettings + | record_create_params.SSHFPRecordSettings + | record_create_params.SVCBRecordSettings + | record_create_params.TLSARecordSettings + | record_create_params.URIRecordSettings + | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, + priority: float | Omit = omit, data: record_create_params.CAARecordData | record_create_params.CERTRecordData | record_create_params.DNSKEYRecordData @@ -6307,14 +6527,16 @@ async def create( | record_create_params.SMIMEARecordData | record_create_params.SRVRecordData | record_create_params.SSHFPRecordData + | record_create_params.SVCBRecordData + | record_create_params.TLSARecordData | record_create_params.URIRecordData - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -6325,13 +6547,13 @@ async def create( body=await async_maybe_transform( { "name": name, + "ttl": ttl, "type": type, "comment": comment, "content": content, "proxied": proxied, "settings": settings, "tags": tags, - "ttl": ttl, "priority": priority, "data": data, }, @@ -6357,19 +6579,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.ARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.ARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6386,7 +6608,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6402,10 +6628,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6423,19 +6645,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["AAAA"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.AAAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.AAAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6452,7 +6674,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6468,10 +6694,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6489,19 +6711,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CNAME"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.CNAMERecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6518,7 +6740,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6534,10 +6760,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6555,20 +6777,20 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["MX"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.MXRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.MXRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6585,7 +6807,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6604,10 +6830,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6625,19 +6847,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NS"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.NSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6654,7 +6876,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6670,10 +6896,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6691,19 +6913,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["OPENPGPKEY"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.DNSRecordsOpenpgpkeyRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6720,7 +6942,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6736,10 +6962,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6757,19 +6979,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["PTR"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.PTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.PTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6786,7 +7008,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6802,10 +7028,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6823,19 +7045,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TXT"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TXTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.TXTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6852,7 +7074,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6873,10 +7099,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6894,19 +7116,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CAA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.CAARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.CAARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.CAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6923,7 +7145,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -6939,10 +7165,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -6960,19 +7182,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CERT"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.CERTRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.CERTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.CERTRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.CERTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -6989,7 +7211,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7005,10 +7231,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7026,19 +7248,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DNSKEY"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.DNSKEYRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.DNSKEYRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7055,7 +7277,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7071,10 +7297,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7092,19 +7314,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.DSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.DSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.DSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.DSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7121,7 +7343,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7137,10 +7363,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7158,19 +7380,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["HTTPS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.HTTPSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.HTTPSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7187,7 +7409,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7203,10 +7429,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7224,19 +7446,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["LOC"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.LOCRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.LOCRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.LOCRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.LOCRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7253,7 +7475,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7269,10 +7495,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7290,19 +7512,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NAPTR"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.NAPTRRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.NAPTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7319,7 +7541,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7335,10 +7561,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7356,19 +7578,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SMIMEA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.SMIMEARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.SMIMEARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7385,7 +7607,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7401,10 +7627,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7422,19 +7644,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SRV"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SRVRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SRVRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.SRVRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.SRVRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7451,7 +7673,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7467,10 +7693,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7488,19 +7710,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SSHFP"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.SSHFPRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.SSHFPRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7517,7 +7739,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7533,10 +7759,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7554,19 +7776,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SVCB"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.SVCBRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.SVCBRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.SVCBRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7583,7 +7805,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7599,10 +7825,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7620,19 +7842,19 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TLSA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.TLSARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.TLSARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.TLSARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.TLSARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7649,7 +7871,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7665,10 +7891,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7686,20 +7908,20 @@ async def update( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - data: record_update_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_update_params.URIRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_update_params.URIRecordData | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_update_params.URIRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Overwrite an existing DNS record. @@ -7716,7 +7938,11 @@ async def update( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -7735,10 +7961,6 @@ async def update( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -7749,13 +7971,14 @@ async def update( """ ... - @required_args(["zone_id", "name", "type"]) + @required_args(["zone_id", "name", "ttl", "type"]) async def update( self, dns_record_id: str, *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"] | Literal["AAAA"] | Literal["CNAME"] @@ -7777,15 +8000,33 @@ async def update( | Literal["SVCB"] | Literal["TLSA"] | Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, settings: record_update_params.ARecordSettings + | record_update_params.AAAARecordSettings | record_update_params.CNAMERecordSettings - | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + | record_update_params.MXRecordSettings + | record_update_params.NSRecordSettings + | record_update_params.DNSRecordsOpenpgpkeyRecordSettings + | record_update_params.PTRRecordSettings + | record_update_params.TXTRecordSettings + | record_update_params.CAARecordSettings + | record_update_params.CERTRecordSettings + | record_update_params.DNSKEYRecordSettings + | record_update_params.DSRecordSettings + | record_update_params.HTTPSRecordSettings + | record_update_params.LOCRecordSettings + | record_update_params.NAPTRRecordSettings + | record_update_params.SMIMEARecordSettings + | record_update_params.SRVRecordSettings + | record_update_params.SSHFPRecordSettings + | record_update_params.SVCBRecordSettings + | record_update_params.TLSARecordSettings + | record_update_params.URIRecordSettings + | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, + priority: float | Omit = omit, data: record_update_params.CAARecordData | record_update_params.CERTRecordData | record_update_params.DNSKEYRecordData @@ -7796,14 +8037,16 @@ async def update( | record_update_params.SMIMEARecordData | record_update_params.SRVRecordData | record_update_params.SSHFPRecordData + | record_update_params.SVCBRecordData + | record_update_params.TLSARecordData | record_update_params.URIRecordData - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -7816,13 +8059,13 @@ async def update( body=await async_maybe_transform( { "name": name, + "ttl": ttl, "type": type, "comment": comment, "content": content, "proxied": proxied, "settings": settings, "tags": tags, - "ttl": ttl, "priority": priority, "data": data, }, @@ -7845,18 +8088,18 @@ def list( self, *, zone_id: str, - comment: record_list_params.Comment | NotGiven = NOT_GIVEN, - content: record_list_params.Content | NotGiven = NOT_GIVEN, - direction: SortDirection | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: record_list_params.Name | NotGiven = NOT_GIVEN, - order: Literal["type", "name", "content", "ttl", "proxied"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - tag: record_list_params.Tag | NotGiven = NOT_GIVEN, - tag_match: Literal["any", "all"] | NotGiven = NOT_GIVEN, + comment: record_list_params.Comment | Omit = omit, + content: record_list_params.Content | Omit = omit, + direction: SortDirection | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + name: record_list_params.Name | Omit = omit, + order: Literal["type", "name", "content", "ttl", "proxied"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + proxied: bool | Omit = omit, + search: str | Omit = omit, + tag: record_list_params.Tag | Omit = omit, + tag_match: Literal["any", "all"] | Omit = omit, type: Literal[ "A", "AAAA", @@ -7880,13 +8123,13 @@ def list( "TXT", "URI", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RecordResponse, AsyncV4PagePaginationArray[RecordResponse]]: """ List, search, sort, and filter a zones' DNS records. @@ -7973,7 +8216,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordDeleteResponse]: """ Delete DNS Record @@ -8011,16 +8254,16 @@ async def batch( self, *, zone_id: str, - deletes: Iterable[record_batch_params.Delete] | NotGiven = NOT_GIVEN, - patches: Iterable[BatchPatchParam] | NotGiven = NOT_GIVEN, - posts: Iterable[record_batch_params.Post] | NotGiven = NOT_GIVEN, - puts: Iterable[BatchPutParam] | NotGiven = NOT_GIVEN, + deletes: Iterable[record_batch_params.Delete] | Omit = omit, + patches: Iterable[BatchPatchParam] | Omit = omit, + posts: Iterable[record_batch_params.Post] | Omit = omit, + puts: Iterable[BatchPutParam] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordBatchResponse]: """ Send a Batch of DNS Record API calls to be executed together. @@ -8082,19 +8325,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.ARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.ARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8111,7 +8354,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8127,10 +8374,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8148,19 +8391,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["AAAA"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.AAAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.AAAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8177,7 +8420,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8193,10 +8440,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8214,19 +8457,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CNAME"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.CNAMERecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8243,7 +8486,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8255,13 +8502,9 @@ async def edit( proxied: Whether the record is receiving the performance and security benefits of Cloudflare. - settings: Settings for the DNS record. - - tags: Custom tags for the DNS record. This field has no effect on DNS responses. - - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. + settings: Settings for the DNS record. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. extra_headers: Send extra headers @@ -8280,20 +8523,20 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["MX"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.MXRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.MXRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8310,7 +8553,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8329,10 +8576,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8350,19 +8593,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NS"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.NSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8379,7 +8622,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8395,10 +8642,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8416,19 +8659,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["OPENPGPKEY"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.DNSRecordsOpenpgpkeyRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8445,7 +8688,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8461,10 +8708,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8482,19 +8725,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["PTR"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.PTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.PTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8511,7 +8754,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8527,10 +8774,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8548,19 +8791,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TXT"], - comment: str | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TXTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.TXTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8577,7 +8820,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8598,10 +8845,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8619,19 +8862,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CAA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.CAARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CAARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.CAARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.CAARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8648,7 +8891,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8664,10 +8911,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8685,19 +8928,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["CERT"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.CERTRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.CERTRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.CERTRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.CERTRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8714,7 +8957,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8730,10 +8977,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8751,19 +8994,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DNSKEY"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.DNSKEYRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DNSKEYRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.DNSKEYRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.DNSKEYRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8780,7 +9023,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8796,10 +9043,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8817,19 +9060,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["DS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.DSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.DSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.DSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.DSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8846,7 +9089,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8862,10 +9109,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8883,19 +9126,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["HTTPS"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.HTTPSRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.HTTPSRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.HTTPSRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.HTTPSRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8912,7 +9155,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8928,10 +9175,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -8949,19 +9192,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["LOC"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.LOCRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.LOCRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.LOCRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.LOCRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -8978,7 +9221,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -8994,10 +9241,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9015,19 +9258,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["NAPTR"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.NAPTRRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.NAPTRRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.NAPTRRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.NAPTRRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -9044,7 +9287,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -9060,10 +9307,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9081,19 +9324,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SMIMEA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SMIMEARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SMIMEARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.SMIMEARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.SMIMEARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -9110,7 +9353,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -9126,10 +9373,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9147,19 +9390,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SRV"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SRVRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SRVRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.SRVRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.SRVRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -9176,7 +9419,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -9192,10 +9439,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9213,19 +9456,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SSHFP"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SSHFPRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SSHFPRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.SSHFPRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.SSHFPRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -9242,7 +9485,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -9258,10 +9505,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9279,19 +9522,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["SVCB"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.SVCBRecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.SVCBRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.SVCBRecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.SVCBRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -9308,7 +9551,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -9324,10 +9571,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9345,19 +9588,19 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["TLSA"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.TLSARecordData | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.TLSARecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.TLSARecordData | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.TLSARecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -9374,7 +9617,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -9390,10 +9637,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9411,20 +9654,20 @@ async def edit( *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - data: record_edit_params.URIRecordData | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.URIRecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + data: record_edit_params.URIRecordData | Omit = omit, + priority: float | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.URIRecordSettings | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ Update an existing DNS record. @@ -9441,7 +9684,11 @@ async def edit( dns_record_id: Identifier. - name: DNS record name (or @ for the zone apex) in Punycode. + name: Complete DNS record name, including the zone name, in Punycode. + + ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + Value must be between 60 and 86400, with the minimum reduced to 30 for + Enterprise zones. type: Record type. @@ -9460,10 +9707,6 @@ async def edit( tags: Custom tags for the DNS record. This field has no effect on DNS responses. - ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - Value must be between 60 and 86400, with the minimum reduced to 30 for - Enterprise zones. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -9474,13 +9717,14 @@ async def edit( """ ... - @required_args(["zone_id", "name", "type"]) + @required_args(["zone_id", "name", "ttl", "type"]) async def edit( self, dns_record_id: str, *, zone_id: str, name: str, + ttl: TTLParam, type: Literal["A"] | Literal["AAAA"] | Literal["CNAME"] @@ -9502,13 +9746,33 @@ async def edit( | Literal["SVCB"] | Literal["TLSA"] | Literal["URI"], - comment: str | NotGiven = NOT_GIVEN, - content: str | str | str | str | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - settings: record_edit_params.ARecordSettings | record_edit_params.CNAMERecordSettings | NotGiven = NOT_GIVEN, - tags: List[RecordTags] | NotGiven = NOT_GIVEN, - ttl: TTLParam | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + content: str | Omit = omit, + proxied: bool | Omit = omit, + settings: record_edit_params.ARecordSettings + | record_edit_params.AAAARecordSettings + | record_edit_params.CNAMERecordSettings + | record_edit_params.MXRecordSettings + | record_edit_params.NSRecordSettings + | record_edit_params.DNSRecordsOpenpgpkeyRecordSettings + | record_edit_params.PTRRecordSettings + | record_edit_params.TXTRecordSettings + | record_edit_params.CAARecordSettings + | record_edit_params.CERTRecordSettings + | record_edit_params.DNSKEYRecordSettings + | record_edit_params.DSRecordSettings + | record_edit_params.HTTPSRecordSettings + | record_edit_params.LOCRecordSettings + | record_edit_params.NAPTRRecordSettings + | record_edit_params.SMIMEARecordSettings + | record_edit_params.SRVRecordSettings + | record_edit_params.SSHFPRecordSettings + | record_edit_params.SVCBRecordSettings + | record_edit_params.TLSARecordSettings + | record_edit_params.URIRecordSettings + | Omit = omit, + tags: SequenceNotStr[RecordTags] | Omit = omit, + priority: float | Omit = omit, data: record_edit_params.CAARecordData | record_edit_params.CERTRecordData | record_edit_params.DNSKEYRecordData @@ -9519,14 +9783,16 @@ async def edit( | record_edit_params.SMIMEARecordData | record_edit_params.SRVRecordData | record_edit_params.SSHFPRecordData + | record_edit_params.SVCBRecordData + | record_edit_params.TLSARecordData | record_edit_params.URIRecordData - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -9539,13 +9805,13 @@ async def edit( body=await async_maybe_transform( { "name": name, + "ttl": ttl, "type": type, "comment": comment, "content": content, "proxied": proxied, "settings": settings, "tags": tags, - "ttl": ttl, "priority": priority, "data": data, }, @@ -9573,7 +9839,7 @@ async def export( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ You can export your @@ -9616,7 +9882,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordResponse]: """ DNS Record Details @@ -9660,13 +9926,13 @@ async def import_( *, zone_id: str, file: str, - proxied: str | NotGiven = NOT_GIVEN, + proxied: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordImportResponse]: """ You can upload your @@ -9724,6 +9990,9 @@ async def import_( cast_to=cast(Type[Optional[RecordImportResponse]], ResultWrapper[RecordImportResponse]), ) + @typing_extensions.deprecated( + "This endpoint is deprecated in favor of a new asynchronous version. Please use the [/scan/trigger](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/scan/trigger) and [/scan/review](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/scan/review) endpoints instead.\n" + ) async def scan( self, *, @@ -9734,7 +10003,7 @@ async def scan( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecordScanResponse]: """ Scan for common DNS records on your domain and automatically add them to your @@ -9766,6 +10035,135 @@ async def scan( cast_to=cast(Type[Optional[RecordScanResponse]], ResultWrapper[RecordScanResponse]), ) + def scan_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[RecordResponse, AsyncSinglePage[RecordResponse]]: + """ + Retrieves the list of DNS records discovered up to this point by the + asynchronous scan. These records are temporary until explicitly accepted or + rejected via `POST /scan/review`. Additional records may be discovered by the + scan later. + + 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}/dns_records/scan/review", + page=AsyncSinglePage[RecordResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=cast(Any, RecordResponse), # Union types cannot be passed in as arguments in the type system + ) + + async def scan_review( + self, + *, + zone_id: str, + accepts: Iterable[record_scan_review_params.Accept] | Omit = omit, + rejects: Iterable[record_scan_review_params.Reject] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[RecordScanReviewResponse]: + """Accept or reject DNS records found by the DNS records scan. + + Accepted records + will be permanently added to the zone, while rejected records will be + permanently 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}") + return await self._post( + f"/zones/{zone_id}/dns_records/scan/review", + body=await async_maybe_transform( + { + "accepts": accepts, + "rejects": rejects, + }, + record_scan_review_params.RecordScanReviewParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RecordScanReviewResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RecordScanReviewResponse]], ResultWrapper[RecordScanReviewResponse]), + ) + + async def scan_trigger( + 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, + ) -> RecordScanTriggerResponse: + """Initiates an asynchronous scan for common DNS records on your domain. + + Note that + this **does not** automatically add records to your zone. The scan runs in the + background, and results can be reviewed later using the `/scan/review` + endpoints. Useful if you haven't updated your nameservers yet. + + Args: + zone_id: Identifier. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._post( + f"/zones/{zone_id}/dns_records/scan/trigger", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RecordScanTriggerResponse, + ) + class RecordsResourceWithRawResponse: def __init__(self, records: RecordsResource) -> None: @@ -9798,8 +10196,19 @@ def __init__(self, records: RecordsResource) -> None: self.import_ = to_raw_response_wrapper( records.import_, ) - self.scan = to_raw_response_wrapper( - records.scan, + self.scan = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + records.scan, # pyright: ignore[reportDeprecated], + ) + ) + self.scan_list = to_raw_response_wrapper( + records.scan_list, + ) + self.scan_review = to_raw_response_wrapper( + records.scan_review, + ) + self.scan_trigger = to_raw_response_wrapper( + records.scan_trigger, ) @@ -9834,8 +10243,19 @@ def __init__(self, records: AsyncRecordsResource) -> None: self.import_ = async_to_raw_response_wrapper( records.import_, ) - self.scan = async_to_raw_response_wrapper( - records.scan, + self.scan = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + records.scan, # pyright: ignore[reportDeprecated], + ) + ) + self.scan_list = async_to_raw_response_wrapper( + records.scan_list, + ) + self.scan_review = async_to_raw_response_wrapper( + records.scan_review, + ) + self.scan_trigger = async_to_raw_response_wrapper( + records.scan_trigger, ) @@ -9870,8 +10290,19 @@ def __init__(self, records: RecordsResource) -> None: self.import_ = to_streamed_response_wrapper( records.import_, ) - self.scan = to_streamed_response_wrapper( - records.scan, + self.scan = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + records.scan, # pyright: ignore[reportDeprecated], + ) + ) + self.scan_list = to_streamed_response_wrapper( + records.scan_list, + ) + self.scan_review = to_streamed_response_wrapper( + records.scan_review, + ) + self.scan_trigger = to_streamed_response_wrapper( + records.scan_trigger, ) @@ -9906,6 +10337,17 @@ def __init__(self, records: AsyncRecordsResource) -> None: self.import_ = async_to_streamed_response_wrapper( records.import_, ) - self.scan = async_to_streamed_response_wrapper( - records.scan, + self.scan = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + records.scan, # pyright: ignore[reportDeprecated], + ) + ) + self.scan_list = async_to_streamed_response_wrapper( + records.scan_list, + ) + self.scan_review = async_to_streamed_response_wrapper( + records.scan_review, + ) + self.scan_trigger = async_to_streamed_response_wrapper( + records.scan_trigger, ) diff --git a/src/cloudflare/resources/dns/settings/account/account.py b/src/cloudflare/resources/dns/settings/account/account.py index d538690fabc..0dac25f716e 100644 --- a/src/cloudflare/resources/dns/settings/account/account.py +++ b/src/cloudflare/resources/dns/settings/account/account.py @@ -14,7 +14,7 @@ ViewsResourceWithStreamingResponse, AsyncViewsResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -61,13 +61,13 @@ def edit( self, *, account_id: str, - zone_defaults: account_edit_params.ZoneDefaults | NotGiven = NOT_GIVEN, + zone_defaults: account_edit_params.ZoneDefaults | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountEditResponse]: """ Update DNS settings for an account @@ -107,7 +107,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountGetResponse]: """ Show DNS settings for an account @@ -166,13 +166,13 @@ async def edit( self, *, account_id: str, - zone_defaults: account_edit_params.ZoneDefaults | NotGiven = NOT_GIVEN, + zone_defaults: account_edit_params.ZoneDefaults | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountEditResponse]: """ Update DNS settings for an account @@ -212,7 +212,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountGetResponse]: """ Show DNS settings for an account diff --git a/src/cloudflare/resources/dns/settings/account/views.py b/src/cloudflare/resources/dns/settings/account/views.py index 673a0ed21a4..9087a872c50 100644 --- a/src/cloudflare/resources/dns/settings/account/views.py +++ b/src/cloudflare/resources/dns/settings/account/views.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,13 +55,13 @@ def create( *, account_id: str, name: str, - zones: List[str], + zones: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ViewCreateResponse]: """ Create Internal DNS View for an account @@ -106,20 +106,20 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: view_list_params.Name | NotGiven = NOT_GIVEN, - order: Literal["name", "created_on", "modified_on"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - zone_name: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + name: view_list_params.Name | Omit = omit, + order: Literal["name", "created_on", "modified_on"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + zone_id: str | Omit = omit, + zone_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[ViewListResponse]: """ List DNS Internal Views for an Account @@ -188,7 +188,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ViewDeleteResponse]: """ Delete an existing Internal DNS View @@ -227,14 +227,14 @@ def edit( view_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - zones: List[str] | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + zones: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ViewEditResponse]: """ Update an existing Internal DNS View @@ -289,7 +289,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ViewGetResponse]: """ Get DNS Internal View @@ -349,13 +349,13 @@ async def create( *, account_id: str, name: str, - zones: List[str], + zones: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ViewCreateResponse]: """ Create Internal DNS View for an account @@ -400,20 +400,20 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: view_list_params.Name | NotGiven = NOT_GIVEN, - order: Literal["name", "created_on", "modified_on"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - zone_name: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + name: view_list_params.Name | Omit = omit, + order: Literal["name", "created_on", "modified_on"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + zone_id: str | Omit = omit, + zone_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ViewListResponse, AsyncV4PagePaginationArray[ViewListResponse]]: """ List DNS Internal Views for an Account @@ -482,7 +482,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ViewDeleteResponse]: """ Delete an existing Internal DNS View @@ -521,14 +521,14 @@ async def edit( view_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - zones: List[str] | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + zones: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ViewEditResponse]: """ Update an existing Internal DNS View @@ -583,7 +583,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ViewGetResponse]: """ Get DNS Internal View diff --git a/src/cloudflare/resources/dns/settings/zone.py b/src/cloudflare/resources/dns/settings/zone.py index e59d1b27b69..e6192dd17c4 100644 --- a/src/cloudflare/resources/dns/settings/zone.py +++ b/src/cloudflare/resources/dns/settings/zone.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,21 +50,21 @@ def edit( self, *, zone_id: str, - flatten_all_cnames: bool | NotGiven = NOT_GIVEN, - foundation_dns: bool | NotGiven = NOT_GIVEN, - internal_dns: zone_edit_params.InternalDNS | NotGiven = NOT_GIVEN, - multi_provider: bool | NotGiven = NOT_GIVEN, - nameservers: zone_edit_params.Nameservers | NotGiven = NOT_GIVEN, - ns_ttl: float | NotGiven = NOT_GIVEN, - secondary_overrides: bool | NotGiven = NOT_GIVEN, - soa: zone_edit_params.SOA | NotGiven = NOT_GIVEN, - zone_mode: Literal["standard", "cdn_only", "dns_only"] | NotGiven = NOT_GIVEN, + flatten_all_cnames: bool | Omit = omit, + foundation_dns: bool | Omit = omit, + internal_dns: zone_edit_params.InternalDNS | Omit = omit, + multi_provider: bool | Omit = omit, + nameservers: zone_edit_params.Nameservers | Omit = omit, + ns_ttl: float | Omit = omit, + secondary_overrides: bool | Omit = omit, + soa: zone_edit_params.SOA | Omit = omit, + zone_mode: Literal["standard", "cdn_only", "dns_only"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneEditResponse]: """ Update DNS settings for a zone @@ -139,7 +139,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneGetResponse]: """ Show DNS settings for a zone @@ -194,21 +194,21 @@ async def edit( self, *, zone_id: str, - flatten_all_cnames: bool | NotGiven = NOT_GIVEN, - foundation_dns: bool | NotGiven = NOT_GIVEN, - internal_dns: zone_edit_params.InternalDNS | NotGiven = NOT_GIVEN, - multi_provider: bool | NotGiven = NOT_GIVEN, - nameservers: zone_edit_params.Nameservers | NotGiven = NOT_GIVEN, - ns_ttl: float | NotGiven = NOT_GIVEN, - secondary_overrides: bool | NotGiven = NOT_GIVEN, - soa: zone_edit_params.SOA | NotGiven = NOT_GIVEN, - zone_mode: Literal["standard", "cdn_only", "dns_only"] | NotGiven = NOT_GIVEN, + flatten_all_cnames: bool | Omit = omit, + foundation_dns: bool | Omit = omit, + internal_dns: zone_edit_params.InternalDNS | Omit = omit, + multi_provider: bool | Omit = omit, + nameservers: zone_edit_params.Nameservers | Omit = omit, + ns_ttl: float | Omit = omit, + secondary_overrides: bool | Omit = omit, + soa: zone_edit_params.SOA | Omit = omit, + zone_mode: Literal["standard", "cdn_only", "dns_only"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneEditResponse]: """ Update DNS settings for a zone @@ -283,7 +283,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneGetResponse]: """ Show DNS settings for a zone diff --git a/src/cloudflare/resources/dns/zone_transfers/acls.py b/src/cloudflare/resources/dns/zone_transfers/acls.py index 10045c20ee8..1bc1881c3de 100644 --- a/src/cloudflare/resources/dns/zone_transfers/acls.py +++ b/src/cloudflare/resources/dns/zone_transfers/acls.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -57,7 +57,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ACL]: """ Create ACL. @@ -112,7 +112,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ACL]: """ Modify ACL. @@ -166,7 +166,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ACL]: """ List ACLs. @@ -201,7 +201,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ACLDeleteResponse]: """ Delete ACL. @@ -241,7 +241,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ACL]: """ Get ACL. @@ -303,7 +303,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ACL]: """ Create ACL. @@ -358,7 +358,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ACL]: """ Modify ACL. @@ -412,7 +412,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ACL, AsyncSinglePage[ACL]]: """ List ACLs. @@ -447,7 +447,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ACLDeleteResponse]: """ Delete ACL. @@ -487,7 +487,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ACL]: """ Get ACL. diff --git a/src/cloudflare/resources/dns/zone_transfers/force_axfr.py b/src/cloudflare/resources/dns/zone_transfers/force_axfr.py index cad0c3ade05..a9d4f10976b 100644 --- a/src/cloudflare/resources/dns/zone_transfers/force_axfr.py +++ b/src/cloudflare/resources/dns/zone_transfers/force_axfr.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,7 +54,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Sends AXFR zone transfer request to primary nameserver(s). @@ -114,7 +114,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Sends AXFR zone transfer request to primary nameserver(s). diff --git a/src/cloudflare/resources/dns/zone_transfers/incoming.py b/src/cloudflare/resources/dns/zone_transfers/incoming.py index 13a3f492d25..d2b75511030 100644 --- a/src/cloudflare/resources/dns/zone_transfers/incoming.py +++ b/src/cloudflare/resources/dns/zone_transfers/incoming.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -53,13 +53,13 @@ def create( zone_id: str, auto_refresh_seconds: float, name: str, - peers: List[str], + peers: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IncomingCreateResponse]: """ Create secondary zone configuration for incoming zone transfers. @@ -108,13 +108,13 @@ def update( zone_id: str, auto_refresh_seconds: float, name: str, - peers: List[str], + peers: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IncomingUpdateResponse]: """ Update secondary zone configuration for incoming zone transfers. @@ -166,7 +166,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IncomingDeleteResponse]: """ Delete secondary zone configuration for incoming zone transfers. @@ -203,7 +203,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IncomingGetResponse]: """ Get secondary zone configuration for incoming zone transfers. @@ -258,13 +258,13 @@ async def create( zone_id: str, auto_refresh_seconds: float, name: str, - peers: List[str], + peers: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IncomingCreateResponse]: """ Create secondary zone configuration for incoming zone transfers. @@ -313,13 +313,13 @@ async def update( zone_id: str, auto_refresh_seconds: float, name: str, - peers: List[str], + peers: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IncomingUpdateResponse]: """ Update secondary zone configuration for incoming zone transfers. @@ -371,7 +371,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IncomingDeleteResponse]: """ Delete secondary zone configuration for incoming zone transfers. @@ -408,7 +408,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IncomingGetResponse]: """ Get secondary zone configuration for incoming zone transfers. diff --git a/src/cloudflare/resources/dns/zone_transfers/outgoing/outgoing.py b/src/cloudflare/resources/dns/zone_transfers/outgoing/outgoing.py index 3f099632eb5..be827a34571 100644 --- a/src/cloudflare/resources/dns/zone_transfers/outgoing/outgoing.py +++ b/src/cloudflare/resources/dns/zone_transfers/outgoing/outgoing.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx @@ -14,7 +14,7 @@ StatusResourceWithStreamingResponse, AsyncStatusResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -73,13 +73,13 @@ def create( *, zone_id: str, name: str, - peers: List[str], + peers: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OutgoingCreateResponse]: """ Create primary zone configuration for outgoing zone transfers. @@ -123,13 +123,13 @@ def update( *, zone_id: str, name: str, - peers: List[str], + peers: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OutgoingUpdateResponse]: """ Update primary zone configuration for outgoing zone transfers. @@ -177,7 +177,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OutgoingDeleteResponse]: """ Delete primary zone configuration for outgoing zone transfers. @@ -215,7 +215,7 @@ def disable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Disable outgoing zone transfers for primary zone and clears IXFR backlog of @@ -255,7 +255,7 @@ def enable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Enable outgoing zone transfers for primary zone. @@ -294,7 +294,7 @@ def force_notify( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone. @@ -332,7 +332,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OutgoingGetResponse]: """ Get primary zone configuration for outgoing zone transfers. @@ -390,13 +390,13 @@ async def create( *, zone_id: str, name: str, - peers: List[str], + peers: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OutgoingCreateResponse]: """ Create primary zone configuration for outgoing zone transfers. @@ -440,13 +440,13 @@ async def update( *, zone_id: str, name: str, - peers: List[str], + peers: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OutgoingUpdateResponse]: """ Update primary zone configuration for outgoing zone transfers. @@ -494,7 +494,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OutgoingDeleteResponse]: """ Delete primary zone configuration for outgoing zone transfers. @@ -532,7 +532,7 @@ async def disable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Disable outgoing zone transfers for primary zone and clears IXFR backlog of @@ -572,7 +572,7 @@ async def enable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Enable outgoing zone transfers for primary zone. @@ -611,7 +611,7 @@ async def force_notify( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Notifies the secondary nameserver(s) and clears IXFR backlog of primary zone. @@ -649,7 +649,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OutgoingGetResponse]: """ Get primary zone configuration for outgoing zone transfers. diff --git a/src/cloudflare/resources/dns/zone_transfers/outgoing/status.py b/src/cloudflare/resources/dns/zone_transfers/outgoing/status.py index d3d1c06d3d1..7fdfddd1406 100644 --- a/src/cloudflare/resources/dns/zone_transfers/outgoing/status.py +++ b/src/cloudflare/resources/dns/zone_transfers/outgoing/status.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Get primary zone transfer status. @@ -109,7 +109,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Get primary zone transfer status. diff --git a/src/cloudflare/resources/dns/zone_transfers/peers.py b/src/cloudflare/resources/dns/zone_transfers/peers.py index e414bd59da7..034156f7433 100644 --- a/src/cloudflare/resources/dns/zone_transfers/peers.py +++ b/src/cloudflare/resources/dns/zone_transfers/peers.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Peer]: """ Create Peer. @@ -93,16 +93,16 @@ def update( *, account_id: str, name: str, - ip: str | NotGiven = NOT_GIVEN, - ixfr_enable: bool | NotGiven = NOT_GIVEN, - port: float | NotGiven = NOT_GIVEN, - tsig_id: str | NotGiven = NOT_GIVEN, + ip: str | Omit = omit, + ixfr_enable: bool | Omit = omit, + port: float | Omit = omit, + tsig_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Peer]: """ Modify Peer. @@ -167,7 +167,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Peer]: """ List Peers. @@ -202,7 +202,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PeerDeleteResponse]: """ Delete Peer. @@ -242,7 +242,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Peer]: """ Get Peer. @@ -303,7 +303,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Peer]: """ Create Peer. @@ -340,16 +340,16 @@ async def update( *, account_id: str, name: str, - ip: str | NotGiven = NOT_GIVEN, - ixfr_enable: bool | NotGiven = NOT_GIVEN, - port: float | NotGiven = NOT_GIVEN, - tsig_id: str | NotGiven = NOT_GIVEN, + ip: str | Omit = omit, + ixfr_enable: bool | Omit = omit, + port: float | Omit = omit, + tsig_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Peer]: """ Modify Peer. @@ -414,7 +414,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Peer, AsyncSinglePage[Peer]]: """ List Peers. @@ -449,7 +449,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PeerDeleteResponse]: """ Delete Peer. @@ -489,7 +489,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Peer]: """ Get Peer. diff --git a/src/cloudflare/resources/dns/zone_transfers/tsigs.py b/src/cloudflare/resources/dns/zone_transfers/tsigs.py index 4ef8e47368b..8bb678709d2 100644 --- a/src/cloudflare/resources/dns/zone_transfers/tsigs.py +++ b/src/cloudflare/resources/dns/zone_transfers/tsigs.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,7 +58,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TSIG]: """ Create TSIG. @@ -113,7 +113,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TSIG]: """ Modify TSIG. @@ -166,7 +166,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[TSIG]: """ List TSIGs. @@ -201,7 +201,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TSIGDeleteResponse]: """ Delete TSIG. @@ -241,7 +241,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TSIG]: """ Get TSIG. @@ -304,7 +304,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TSIG]: """ Create TSIG. @@ -359,7 +359,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TSIG]: """ Modify TSIG. @@ -412,7 +412,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TSIG, AsyncSinglePage[TSIG]]: """ List TSIGs. @@ -447,7 +447,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TSIGDeleteResponse]: """ Delete TSIG. @@ -487,7 +487,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TSIG]: """ Get TSIG. diff --git a/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py b/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py index 638bc7968b1..ee2e650d980 100644 --- a/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,21 +51,21 @@ def get( dns_firewall_id: str, *, account_id: str, - dimensions: str | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metrics: str | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: str | NotGiven = NOT_GIVEN, + dimensions: str | Omit = omit, + filters: str | Omit = omit, + limit: int | Omit = omit, + metrics: str | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: str | Omit = omit, time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] - | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ByTime]: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -159,21 +159,21 @@ async def get( dns_firewall_id: str, *, account_id: str, - dimensions: str | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metrics: str | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: str | NotGiven = NOT_GIVEN, + dimensions: str | Omit = omit, + filters: str | Omit = omit, + limit: int | Omit = omit, + metrics: str | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: str | Omit = omit, time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] - | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ByTime]: """ Retrieves a list of aggregate metrics grouped by time interval. diff --git a/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py b/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py index 6943542d65c..00c7ccd859b 100644 --- a/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py +++ b/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py @@ -15,7 +15,7 @@ BytimesResourceWithStreamingResponse, AsyncBytimesResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -62,19 +62,19 @@ def get( dns_firewall_id: str, *, account_id: str, - dimensions: str | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metrics: str | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: str | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + dimensions: str | Omit = omit, + filters: str | Omit = omit, + limit: int | Omit = omit, + metrics: str | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: str | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Report]: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -169,19 +169,19 @@ async def get( dns_firewall_id: str, *, account_id: str, - dimensions: str | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metrics: str | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: str | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + dimensions: str | Omit = omit, + filters: str | Omit = omit, + limit: int | Omit = omit, + metrics: str | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: str | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Report]: """ Retrieves a list of summarised aggregate metrics over a given time period. diff --git a/src/cloudflare/resources/dns_firewall/dns_firewall.py b/src/cloudflare/resources/dns_firewall/dns_firewall.py index 404082f4d31..4f3c7490cb4 100644 --- a/src/cloudflare/resources/dns_firewall/dns_firewall.py +++ b/src/cloudflare/resources/dns_firewall/dns_firewall.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -84,21 +84,21 @@ def create( *, account_id: str, name: str, - upstream_ips: List[UpstreamIPs], - attack_mitigation: Optional[AttackMitigationParam] | NotGiven = NOT_GIVEN, - deprecate_any_requests: bool | NotGiven = NOT_GIVEN, - ecs_fallback: bool | NotGiven = NOT_GIVEN, - maximum_cache_ttl: float | NotGiven = NOT_GIVEN, - minimum_cache_ttl: float | NotGiven = NOT_GIVEN, - negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, - ratelimit: Optional[float] | NotGiven = NOT_GIVEN, - retries: float | NotGiven = NOT_GIVEN, + upstream_ips: SequenceNotStr[UpstreamIPs], + attack_mitigation: Optional[AttackMitigationParam] | Omit = omit, + deprecate_any_requests: bool | Omit = omit, + ecs_fallback: bool | Omit = omit, + maximum_cache_ttl: float | Omit = omit, + minimum_cache_ttl: float | Omit = omit, + negative_cache_ttl: Optional[float] | Omit = omit, + ratelimit: Optional[float] | Omit = omit, + retries: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSFirewallCreateResponse]: """ Create a DNS Firewall cluster @@ -114,16 +114,34 @@ def create( ecs_fallback: Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent - maximum_cache_ttl: Maximum DNS cache TTL This setting sets an upper bound on DNS TTLs for purposes - of caching between DNS Firewall and the upstream servers. Higher TTLs will be - decreased to the maximum defined here for caching purposes. + maximum_cache_ttl: By default, Cloudflare attempts to cache responses for as long as indicated by + the TTL received from upstream nameservers. This setting sets an upper bound on + this duration. For caching purposes, higher TTLs will be decreased to the + maximum value defined by this setting. - minimum_cache_ttl: Minimum DNS cache TTL This setting sets a lower bound on DNS TTLs for purposes - of caching between DNS Firewall and the upstream servers. Lower TTLs will be - increased to the minimum defined here for caching purposes. + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. - negative_cache_ttl: Negative DNS cache TTL This setting controls how long DNS Firewall should cache - negative responses (e.g., NXDOMAIN) from the upstream servers. + minimum_cache_ttl: By default, Cloudflare attempts to cache responses for as long as indicated by + the TTL received from upstream nameservers. This setting sets a lower bound on + this duration. For caching purposes, lower TTLs will be increased to the minimum + value defined by this setting. + + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. + + Note that, even with this setting, there is no guarantee that a response will be + cached for at least the specified duration. Cached responses may be removed + earlier for capacity or other operational reasons. + + negative_cache_ttl: This setting controls how long DNS Firewall should cache negative responses + (e.g., NXDOMAIN) from the upstream servers. + + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. ratelimit: Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster) @@ -172,14 +190,14 @@ def list( self, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[DNSFirewallListResponse]: """ List DNS Firewall clusters for an account @@ -230,7 +248,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSFirewallDeleteResponse]: """ Delete a DNS Firewall cluster @@ -269,22 +287,22 @@ def edit( dns_firewall_id: str, *, account_id: str, - attack_mitigation: Optional[AttackMitigationParam] | NotGiven = NOT_GIVEN, - deprecate_any_requests: bool | NotGiven = NOT_GIVEN, - ecs_fallback: bool | NotGiven = NOT_GIVEN, - maximum_cache_ttl: float | NotGiven = NOT_GIVEN, - minimum_cache_ttl: float | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, - ratelimit: Optional[float] | NotGiven = NOT_GIVEN, - retries: float | NotGiven = NOT_GIVEN, - upstream_ips: List[UpstreamIPs] | NotGiven = NOT_GIVEN, + attack_mitigation: Optional[AttackMitigationParam] | Omit = omit, + deprecate_any_requests: bool | Omit = omit, + ecs_fallback: bool | Omit = omit, + maximum_cache_ttl: float | Omit = omit, + minimum_cache_ttl: float | Omit = omit, + name: str | Omit = omit, + negative_cache_ttl: Optional[float] | Omit = omit, + ratelimit: Optional[float] | Omit = omit, + retries: float | Omit = omit, + upstream_ips: SequenceNotStr[UpstreamIPs] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSFirewallEditResponse]: """ Modify the configuration of a DNS Firewall cluster @@ -300,18 +318,36 @@ def edit( ecs_fallback: Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent - maximum_cache_ttl: Maximum DNS cache TTL This setting sets an upper bound on DNS TTLs for purposes - of caching between DNS Firewall and the upstream servers. Higher TTLs will be - decreased to the maximum defined here for caching purposes. + maximum_cache_ttl: By default, Cloudflare attempts to cache responses for as long as indicated by + the TTL received from upstream nameservers. This setting sets an upper bound on + this duration. For caching purposes, higher TTLs will be decreased to the + maximum value defined by this setting. - minimum_cache_ttl: Minimum DNS cache TTL This setting sets a lower bound on DNS TTLs for purposes - of caching between DNS Firewall and the upstream servers. Lower TTLs will be - increased to the minimum defined here for caching purposes. + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. + + minimum_cache_ttl: By default, Cloudflare attempts to cache responses for as long as indicated by + the TTL received from upstream nameservers. This setting sets a lower bound on + this duration. For caching purposes, lower TTLs will be increased to the minimum + value defined by this setting. + + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. + + Note that, even with this setting, there is no guarantee that a response will be + cached for at least the specified duration. Cached responses may be removed + earlier for capacity or other operational reasons. name: DNS Firewall cluster name - negative_cache_ttl: Negative DNS cache TTL This setting controls how long DNS Firewall should cache - negative responses (e.g., NXDOMAIN) from the upstream servers. + negative_cache_ttl: This setting controls how long DNS Firewall should cache negative responses + (e.g., NXDOMAIN) from the upstream servers. + + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. ratelimit: Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster) @@ -368,7 +404,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSFirewallGetResponse]: """ Show a single DNS Firewall cluster for an account @@ -436,21 +472,21 @@ async def create( *, account_id: str, name: str, - upstream_ips: List[UpstreamIPs], - attack_mitigation: Optional[AttackMitigationParam] | NotGiven = NOT_GIVEN, - deprecate_any_requests: bool | NotGiven = NOT_GIVEN, - ecs_fallback: bool | NotGiven = NOT_GIVEN, - maximum_cache_ttl: float | NotGiven = NOT_GIVEN, - minimum_cache_ttl: float | NotGiven = NOT_GIVEN, - negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, - ratelimit: Optional[float] | NotGiven = NOT_GIVEN, - retries: float | NotGiven = NOT_GIVEN, + upstream_ips: SequenceNotStr[UpstreamIPs], + attack_mitigation: Optional[AttackMitigationParam] | Omit = omit, + deprecate_any_requests: bool | Omit = omit, + ecs_fallback: bool | Omit = omit, + maximum_cache_ttl: float | Omit = omit, + minimum_cache_ttl: float | Omit = omit, + negative_cache_ttl: Optional[float] | Omit = omit, + ratelimit: Optional[float] | Omit = omit, + retries: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSFirewallCreateResponse]: """ Create a DNS Firewall cluster @@ -466,16 +502,34 @@ async def create( ecs_fallback: Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent - maximum_cache_ttl: Maximum DNS cache TTL This setting sets an upper bound on DNS TTLs for purposes - of caching between DNS Firewall and the upstream servers. Higher TTLs will be - decreased to the maximum defined here for caching purposes. + maximum_cache_ttl: By default, Cloudflare attempts to cache responses for as long as indicated by + the TTL received from upstream nameservers. This setting sets an upper bound on + this duration. For caching purposes, higher TTLs will be decreased to the + maximum value defined by this setting. - minimum_cache_ttl: Minimum DNS cache TTL This setting sets a lower bound on DNS TTLs for purposes - of caching between DNS Firewall and the upstream servers. Lower TTLs will be - increased to the minimum defined here for caching purposes. + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. - negative_cache_ttl: Negative DNS cache TTL This setting controls how long DNS Firewall should cache - negative responses (e.g., NXDOMAIN) from the upstream servers. + minimum_cache_ttl: By default, Cloudflare attempts to cache responses for as long as indicated by + the TTL received from upstream nameservers. This setting sets a lower bound on + this duration. For caching purposes, lower TTLs will be increased to the minimum + value defined by this setting. + + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. + + Note that, even with this setting, there is no guarantee that a response will be + cached for at least the specified duration. Cached responses may be removed + earlier for capacity or other operational reasons. + + negative_cache_ttl: This setting controls how long DNS Firewall should cache negative responses + (e.g., NXDOMAIN) from the upstream servers. + + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. ratelimit: Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster) @@ -524,14 +578,14 @@ def list( self, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DNSFirewallListResponse, AsyncV4PagePaginationArray[DNSFirewallListResponse]]: """ List DNS Firewall clusters for an account @@ -582,7 +636,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSFirewallDeleteResponse]: """ Delete a DNS Firewall cluster @@ -621,22 +675,22 @@ async def edit( dns_firewall_id: str, *, account_id: str, - attack_mitigation: Optional[AttackMitigationParam] | NotGiven = NOT_GIVEN, - deprecate_any_requests: bool | NotGiven = NOT_GIVEN, - ecs_fallback: bool | NotGiven = NOT_GIVEN, - maximum_cache_ttl: float | NotGiven = NOT_GIVEN, - minimum_cache_ttl: float | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - negative_cache_ttl: Optional[float] | NotGiven = NOT_GIVEN, - ratelimit: Optional[float] | NotGiven = NOT_GIVEN, - retries: float | NotGiven = NOT_GIVEN, - upstream_ips: List[UpstreamIPs] | NotGiven = NOT_GIVEN, + attack_mitigation: Optional[AttackMitigationParam] | Omit = omit, + deprecate_any_requests: bool | Omit = omit, + ecs_fallback: bool | Omit = omit, + maximum_cache_ttl: float | Omit = omit, + minimum_cache_ttl: float | Omit = omit, + name: str | Omit = omit, + negative_cache_ttl: Optional[float] | Omit = omit, + ratelimit: Optional[float] | Omit = omit, + retries: float | Omit = omit, + upstream_ips: SequenceNotStr[UpstreamIPs] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSFirewallEditResponse]: """ Modify the configuration of a DNS Firewall cluster @@ -652,18 +706,36 @@ async def edit( ecs_fallback: Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent - maximum_cache_ttl: Maximum DNS cache TTL This setting sets an upper bound on DNS TTLs for purposes - of caching between DNS Firewall and the upstream servers. Higher TTLs will be - decreased to the maximum defined here for caching purposes. + maximum_cache_ttl: By default, Cloudflare attempts to cache responses for as long as indicated by + the TTL received from upstream nameservers. This setting sets an upper bound on + this duration. For caching purposes, higher TTLs will be decreased to the + maximum value defined by this setting. - minimum_cache_ttl: Minimum DNS cache TTL This setting sets a lower bound on DNS TTLs for purposes - of caching between DNS Firewall and the upstream servers. Lower TTLs will be - increased to the minimum defined here for caching purposes. + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. + + minimum_cache_ttl: By default, Cloudflare attempts to cache responses for as long as indicated by + the TTL received from upstream nameservers. This setting sets a lower bound on + this duration. For caching purposes, lower TTLs will be increased to the minimum + value defined by this setting. + + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. + + Note that, even with this setting, there is no guarantee that a response will be + cached for at least the specified duration. Cached responses may be removed + earlier for capacity or other operational reasons. name: DNS Firewall cluster name - negative_cache_ttl: Negative DNS cache TTL This setting controls how long DNS Firewall should cache - negative responses (e.g., NXDOMAIN) from the upstream servers. + negative_cache_ttl: This setting controls how long DNS Firewall should cache negative responses + (e.g., NXDOMAIN) from the upstream servers. + + This setting does not affect the TTL value in the DNS response Cloudflare + returns to clients. Cloudflare will always forward the TTL value received from + upstream nameservers. ratelimit: Ratelimit in queries per second per datacenter (applies to DNS queries sent to the upstream nameservers configured on the cluster) @@ -720,7 +792,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DNSFirewallGetResponse]: """ Show a single DNS Firewall cluster for an account diff --git a/src/cloudflare/resources/dns_firewall/reverse_dns.py b/src/cloudflare/resources/dns_firewall/reverse_dns.py index 20be978c91d..bb4a2db63b0 100644 --- a/src/cloudflare/resources/dns_firewall/reverse_dns.py +++ b/src/cloudflare/resources/dns_firewall/reverse_dns.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,13 +50,13 @@ def edit( dns_firewall_id: str, *, account_id: str, - ptr: Dict[str, str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ReverseDNSEditResponse]: """ Update reverse DNS configuration (PTR records) for a DNS Firewall cluster @@ -103,7 +103,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ReverseDNSGetResponse]: """ Show reverse DNS configuration (PTR records) for a DNS Firewall cluster @@ -163,13 +163,13 @@ async def edit( dns_firewall_id: str, *, account_id: str, - ptr: Dict[str, str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ReverseDNSEditResponse]: """ Update reverse DNS configuration (PTR records) for a DNS Firewall cluster @@ -216,7 +216,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ReverseDNSGetResponse]: """ Show reverse DNS configuration (PTR records) for a DNS Firewall cluster diff --git a/src/cloudflare/resources/durable_objects/namespaces/namespaces.py b/src/cloudflare/resources/durable_objects/namespaces/namespaces.py index 83bc2a2f3d2..b35378602bc 100644 --- a/src/cloudflare/resources/durable_objects/namespaces/namespaces.py +++ b/src/cloudflare/resources/durable_objects/namespaces/namespaces.py @@ -12,7 +12,8 @@ ObjectsResourceWithStreamingResponse, AsyncObjectsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 ( @@ -21,8 +22,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....pagination import SyncSinglePage, AsyncSinglePage +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options +from ....types.durable_objects import namespace_list_params from ....types.durable_objects.namespace import Namespace __all__ = ["NamespacesResource", "AsyncNamespacesResource"] @@ -56,19 +58,25 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[Namespace]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[Namespace]: """ Returns the Durable Object namespaces owned by an account. Args: account_id: Identifier. + page: Current page. + + per_page: Items per-page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -81,9 +89,19 @@ def list( 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}/workers/durable_objects/namespaces", - page=SyncSinglePage[Namespace], + page=SyncV4PagePaginationArray[Namespace], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + namespace_list_params.NamespaceListParams, + ), ), model=Namespace, ) @@ -117,19 +135,25 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[Namespace, AsyncSinglePage[Namespace]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Namespace, AsyncV4PagePaginationArray[Namespace]]: """ Returns the Durable Object namespaces owned by an account. Args: account_id: Identifier. + page: Current page. + + per_page: Items per-page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -142,9 +166,19 @@ def list( 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}/workers/durable_objects/namespaces", - page=AsyncSinglePage[Namespace], + page=AsyncV4PagePaginationArray[Namespace], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + namespace_list_params.NamespaceListParams, + ), ), model=Namespace, ) diff --git a/src/cloudflare/resources/durable_objects/namespaces/objects.py b/src/cloudflare/resources/durable_objects/namespaces/objects.py index e051df6cdf6..64e42f7f928 100644 --- a/src/cloudflare/resources/durable_objects/namespaces/objects.py +++ b/src/cloudflare/resources/durable_objects/namespaces/objects.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -14,7 +14,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ....pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination +from ....pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter from ...._base_client import AsyncPaginator, make_request_options from ....types.durable_objects.namespaces import object_list_params from ....types.durable_objects.namespaces.durable_object import DurableObject @@ -47,15 +47,15 @@ def list( id: str, *, account_id: str, - cursor: str | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncCursorLimitPagination[DurableObject]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncCursorPaginationAfter[DurableObject]: """ Returns the Durable Objects in a given namespace. @@ -85,7 +85,7 @@ def list( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get_api_list( f"/accounts/{account_id}/workers/durable_objects/namespaces/{id}/objects", - page=SyncCursorLimitPagination[DurableObject], + page=SyncCursorPaginationAfter[DurableObject], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -128,15 +128,15 @@ def list( id: str, *, account_id: str, - cursor: str | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this 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[DurableObject, AsyncCursorLimitPagination[DurableObject]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[DurableObject, AsyncCursorPaginationAfter[DurableObject]]: """ Returns the Durable Objects in a given namespace. @@ -166,7 +166,7 @@ def list( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get_api_list( f"/accounts/{account_id}/workers/durable_objects/namespaces/{id}/objects", - page=AsyncCursorLimitPagination[DurableObject], + page=AsyncCursorPaginationAfter[DurableObject], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/email_routing/addresses.py b/src/cloudflare/resources/email_routing/addresses.py index 42c1fbc3063..4cf6946ce13 100644 --- a/src/cloudflare/resources/email_routing/addresses.py +++ b/src/cloudflare/resources/email_routing/addresses.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Address]: """Create a destination address to forward your emails to. @@ -95,16 +95,16 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - verified: Literal[True, False] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + verified: Literal[True, False] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Address]: """ Lists existing destination addresses. @@ -161,7 +161,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Address]: """ Deletes a specific destination address. @@ -207,7 +207,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Address]: """ Gets information for a specific destination email already created. @@ -274,7 +274,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Address]: """Create a destination address to forward your emails to. @@ -313,16 +313,16 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - verified: Literal[True, False] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + verified: Literal[True, False] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Address, AsyncV4PagePaginationArray[Address]]: """ Lists existing destination addresses. @@ -379,7 +379,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Address]: """ Deletes a specific destination address. @@ -425,7 +425,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Address]: """ Gets information for a specific destination email already created. diff --git a/src/cloudflare/resources/email_routing/dns.py b/src/cloudflare/resources/email_routing/dns.py index eee6d634c41..2dce6f176e8 100644 --- a/src/cloudflare/resources/email_routing/dns.py +++ b/src/cloudflare/resources/email_routing/dns.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,13 +51,13 @@ def create( self, *, zone_id: str, - name: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Settings]: """Enable you Email Routing zone. @@ -100,7 +100,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DNSRecord]: """Disable your Email Routing zone. @@ -134,13 +134,13 @@ def edit( self, *, zone_id: str, - name: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Settings]: """ Unlock MX Records previously locked by Email Routing. @@ -177,13 +177,13 @@ def get( self, *, zone_id: str, - subdomain: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DNSGetResponse: """ Show the DNS records needed to configure your Email Routing zone. @@ -243,13 +243,13 @@ async def create( self, *, zone_id: str, - name: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Settings]: """Enable you Email Routing zone. @@ -292,7 +292,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DNSRecord, AsyncSinglePage[DNSRecord]]: """Disable your Email Routing zone. @@ -326,13 +326,13 @@ async def edit( self, *, zone_id: str, - name: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Settings]: """ Unlock MX Records previously locked by Email Routing. @@ -369,13 +369,13 @@ async def get( self, *, zone_id: str, - subdomain: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DNSGetResponse: """ Show the DNS records needed to configure your Email Routing zone. diff --git a/src/cloudflare/resources/email_routing/email_routing.py b/src/cloudflare/resources/email_routing/email_routing.py index 142ae4eaa4e..58e4029f429 100644 --- a/src/cloudflare/resources/email_routing/email_routing.py +++ b/src/cloudflare/resources/email_routing/email_routing.py @@ -15,7 +15,7 @@ DNSResourceWithStreamingResponse, AsyncDNSResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from .addresses import ( @@ -92,7 +92,7 @@ def disable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Settings]: """Disable your Email Routing zone. @@ -136,7 +136,7 @@ def enable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Settings]: """Enable you Email Routing zone. @@ -177,7 +177,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Settings]: """ Get information about the settings for your Email Routing zone. @@ -251,7 +251,7 @@ async def disable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Settings]: """Disable your Email Routing zone. @@ -295,7 +295,7 @@ async def enable( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Settings]: """Enable you Email Routing zone. @@ -336,7 +336,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Settings]: """ Get information about the settings for your Email Routing zone. @@ -373,12 +373,12 @@ def __init__(self, email_routing: EmailRoutingResource) -> None: self.disable = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - email_routing.disable # pyright: ignore[reportDeprecated], + email_routing.disable, # pyright: ignore[reportDeprecated], ) ) self.enable = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - email_routing.enable # pyright: ignore[reportDeprecated], + email_routing.enable, # pyright: ignore[reportDeprecated], ) ) self.get = to_raw_response_wrapper( @@ -404,12 +404,12 @@ def __init__(self, email_routing: AsyncEmailRoutingResource) -> None: self.disable = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - email_routing.disable # pyright: ignore[reportDeprecated], + email_routing.disable, # pyright: ignore[reportDeprecated], ) ) self.enable = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - email_routing.enable # pyright: ignore[reportDeprecated], + email_routing.enable, # pyright: ignore[reportDeprecated], ) ) self.get = async_to_raw_response_wrapper( @@ -435,12 +435,12 @@ def __init__(self, email_routing: EmailRoutingResource) -> None: self.disable = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - email_routing.disable # pyright: ignore[reportDeprecated], + email_routing.disable, # pyright: ignore[reportDeprecated], ) ) self.enable = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - email_routing.enable # pyright: ignore[reportDeprecated], + email_routing.enable, # pyright: ignore[reportDeprecated], ) ) self.get = to_streamed_response_wrapper( @@ -466,12 +466,12 @@ def __init__(self, email_routing: AsyncEmailRoutingResource) -> None: self.disable = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - email_routing.disable # pyright: ignore[reportDeprecated], + email_routing.disable, # pyright: ignore[reportDeprecated], ) ) self.enable = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - email_routing.enable # pyright: ignore[reportDeprecated], + email_routing.enable, # pyright: ignore[reportDeprecated], ) ) self.get = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/email_routing/rules/catch_alls.py b/src/cloudflare/resources/email_routing/rules/catch_alls.py index 9058f21c754..0ce7f69c823 100644 --- a/src/cloudflare/resources/email_routing/rules/catch_alls.py +++ b/src/cloudflare/resources/email_routing/rules/catch_alls.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,14 +54,14 @@ def update( zone_id: str, actions: Iterable[CatchAllActionParam], matchers: Iterable[CatchAllMatcherParam], - enabled: Literal[True, False] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + enabled: Literal[True, False] | 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CatchAllUpdateResponse]: """ Enable or disable catch-all routing rule, or change action to forward to @@ -118,7 +118,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CatchAllGetResponse]: """ Get information on the default catch-all routing rule. @@ -175,14 +175,14 @@ async def update( zone_id: str, actions: Iterable[CatchAllActionParam], matchers: Iterable[CatchAllMatcherParam], - enabled: Literal[True, False] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + enabled: Literal[True, False] | 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CatchAllUpdateResponse]: """ Enable or disable catch-all routing rule, or change action to forward to @@ -239,7 +239,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CatchAllGetResponse]: """ Get information on the default catch-all routing rule. diff --git a/src/cloudflare/resources/email_routing/rules/rules.py b/src/cloudflare/resources/email_routing/rules/rules.py index d14d0cbc72a..55c49d259cd 100644 --- a/src/cloudflare/resources/email_routing/rules/rules.py +++ b/src/cloudflare/resources/email_routing/rules/rules.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .catch_alls import ( @@ -66,15 +66,15 @@ def create( zone_id: str, actions: Iterable[ActionParam], matchers: Iterable[MatcherParam], - enabled: Literal[True, False] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + enabled: Literal[True, False] | Omit = omit, + name: str | Omit = omit, + priority: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EmailRoutingRule]: """ Rules consist of a set of criteria for matching emails (such as an email being @@ -133,15 +133,15 @@ def update( zone_id: str, actions: Iterable[ActionParam], matchers: Iterable[MatcherParam], - enabled: Literal[True, False] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + enabled: Literal[True, False] | Omit = omit, + name: str | Omit = omit, + priority: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EmailRoutingRule]: """ Update actions and matches, or enable/disable specific routing rules. @@ -199,15 +199,15 @@ def list( self, *, zone_id: str, - enabled: Literal[True, False] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + enabled: Literal[True, False] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[EmailRoutingRule]: """ Lists existing routing rules. @@ -261,7 +261,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EmailRoutingRule]: """ Delete a specific routing rule. @@ -305,7 +305,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EmailRoutingRule]: """ Get information for a specific routing rule already created. @@ -370,15 +370,15 @@ async def create( zone_id: str, actions: Iterable[ActionParam], matchers: Iterable[MatcherParam], - enabled: Literal[True, False] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + enabled: Literal[True, False] | Omit = omit, + name: str | Omit = omit, + priority: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EmailRoutingRule]: """ Rules consist of a set of criteria for matching emails (such as an email being @@ -437,15 +437,15 @@ async def update( zone_id: str, actions: Iterable[ActionParam], matchers: Iterable[MatcherParam], - enabled: Literal[True, False] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + enabled: Literal[True, False] | Omit = omit, + name: str | Omit = omit, + priority: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EmailRoutingRule]: """ Update actions and matches, or enable/disable specific routing rules. @@ -503,15 +503,15 @@ def list( self, *, zone_id: str, - enabled: Literal[True, False] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + enabled: Literal[True, False] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EmailRoutingRule, AsyncV4PagePaginationArray[EmailRoutingRule]]: """ Lists existing routing rules. @@ -565,7 +565,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EmailRoutingRule]: """ Delete a specific routing rule. @@ -609,7 +609,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EmailRoutingRule]: """ Get information for a specific routing rule already created. diff --git a/src/cloudflare/resources/email_security/investigate/detections.py b/src/cloudflare/resources/email_security/investigate/detections.py index 5cdf12ea035..f3e5c978d25 100644 --- a/src/cloudflare/resources/email_security/investigate/detections.py +++ b/src/cloudflare/resources/email_security/investigate/detections.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DetectionGetResponse: """ Returns detection details such as threat categories and sender information for @@ -118,7 +118,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DetectionGetResponse: """ Returns detection details such as threat categories and sender information for diff --git a/src/cloudflare/resources/email_security/investigate/investigate.py b/src/cloudflare/resources/email_security/investigate/investigate.py index 519073eca2a..7154ac7dc55 100644 --- a/src/cloudflare/resources/email_security/investigate/investigate.py +++ b/src/cloudflare/resources/email_security/investigate/investigate.py @@ -48,7 +48,7 @@ ReleaseResourceWithStreamingResponse, AsyncReleaseResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform from ...._compat import cached_property from .detections import ( @@ -136,27 +136,28 @@ def list( self, *, account_id: str, - action_log: bool | NotGiven = NOT_GIVEN, - alert_id: str | NotGiven = NOT_GIVEN, - detections_only: bool | NotGiven = NOT_GIVEN, - domain: str | NotGiven = NOT_GIVEN, - end: Union[str, datetime] | NotGiven = NOT_GIVEN, - final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | NotGiven = NOT_GIVEN, - message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"] | NotGiven = NOT_GIVEN, - message_id: str | NotGiven = NOT_GIVEN, - metric: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - query: str | NotGiven = NOT_GIVEN, - recipient: str | NotGiven = NOT_GIVEN, - sender: str | NotGiven = NOT_GIVEN, - start: Union[str, datetime] | NotGiven = NOT_GIVEN, + action_log: bool | Omit = omit, + alert_id: str | Omit = omit, + detections_only: bool | Omit = omit, + domain: str | Omit = omit, + end: Union[str, datetime] | Omit = omit, + final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit, + message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"] | Omit = omit, + message_id: str | Omit = omit, + metric: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + query: str | Omit = omit, + recipient: str | Omit = omit, + sender: str | Omit = omit, + start: Union[str, datetime] | Omit = omit, + subject: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[InvestigateListResponse]: """ Returns information for each email that matches the search parameter(s). @@ -242,6 +243,7 @@ def list( "recipient": recipient, "sender": sender, "start": start, + "subject": subject, }, investigate_list_params.InvestigateListParams, ), @@ -259,7 +261,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InvestigateGetResponse: """ Get message details @@ -346,27 +348,28 @@ def list( self, *, account_id: str, - action_log: bool | NotGiven = NOT_GIVEN, - alert_id: str | NotGiven = NOT_GIVEN, - detections_only: bool | NotGiven = NOT_GIVEN, - domain: str | NotGiven = NOT_GIVEN, - end: Union[str, datetime] | NotGiven = NOT_GIVEN, - final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | NotGiven = NOT_GIVEN, - message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"] | NotGiven = NOT_GIVEN, - message_id: str | NotGiven = NOT_GIVEN, - metric: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - query: str | NotGiven = NOT_GIVEN, - recipient: str | NotGiven = NOT_GIVEN, - sender: str | NotGiven = NOT_GIVEN, - start: Union[str, datetime] | NotGiven = NOT_GIVEN, + action_log: bool | Omit = omit, + alert_id: str | Omit = omit, + detections_only: bool | Omit = omit, + domain: str | Omit = omit, + end: Union[str, datetime] | Omit = omit, + final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit, + message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"] | Omit = omit, + message_id: str | Omit = omit, + metric: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + query: str | Omit = omit, + recipient: str | Omit = omit, + sender: str | Omit = omit, + start: Union[str, datetime] | Omit = omit, + subject: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[InvestigateListResponse, AsyncV4PagePaginationArray[InvestigateListResponse]]: """ Returns information for each email that matches the search parameter(s). @@ -452,6 +455,7 @@ def list( "recipient": recipient, "sender": sender, "start": start, + "subject": subject, }, investigate_list_params.InvestigateListParams, ), @@ -469,7 +473,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InvestigateGetResponse: """ Get message details diff --git a/src/cloudflare/resources/email_security/investigate/move.py b/src/cloudflare/resources/email_security/investigate/move.py index 4081ee6e193..6089f6a6139 100644 --- a/src/cloudflare/resources/email_security/investigate/move.py +++ b/src/cloudflare/resources/email_security/investigate/move.py @@ -2,12 +2,11 @@ from __future__ import annotations -from typing import List from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ...._utils import maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -59,7 +58,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[MoveCreateResponse]: """ Move a message @@ -99,13 +98,13 @@ def bulk( destination: Literal[ "Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges" ], - postfix_ids: List[str], + postfix_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[MoveBulkResponse]: """ Move multiple messages @@ -174,7 +173,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[MoveCreateResponse, AsyncSinglePage[MoveCreateResponse]]: """ Move a message @@ -214,13 +213,13 @@ def bulk( destination: Literal[ "Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges" ], - postfix_ids: List[str], + postfix_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[MoveBulkResponse, AsyncSinglePage[MoveBulkResponse]]: """ Move multiple messages diff --git a/src/cloudflare/resources/email_security/investigate/preview.py b/src/cloudflare/resources/email_security/investigate/preview.py index f78a6a9bc38..eb256fad862 100644 --- a/src/cloudflare/resources/email_security/investigate/preview.py +++ b/src/cloudflare/resources/email_security/investigate/preview.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,7 +55,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewCreateResponse: """ Preview for non-detection messages @@ -98,7 +98,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewGetResponse: """ Returns a preview of the message body as a base64 encoded PNG image for @@ -164,7 +164,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewCreateResponse: """ Preview for non-detection messages @@ -207,7 +207,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewGetResponse: """ Returns a preview of the message body as a base64 encoded PNG image for diff --git a/src/cloudflare/resources/email_security/investigate/raw.py b/src/cloudflare/resources/email_security/investigate/raw.py index 87b1ad9423a..473f6a6330e 100644 --- a/src/cloudflare/resources/email_security/investigate/raw.py +++ b/src/cloudflare/resources/email_security/investigate/raw.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RawGetResponse: """ Returns the raw eml of any non-benign message. @@ -117,7 +117,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RawGetResponse: """ Returns the raw eml of any non-benign message. diff --git a/src/cloudflare/resources/email_security/investigate/reclassify.py b/src/cloudflare/resources/email_security/investigate/reclassify.py index 617bdec7939..61efd16b622 100644 --- a/src/cloudflare/resources/email_security/investigate/reclassify.py +++ b/src/cloudflare/resources/email_security/investigate/reclassify.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,13 +50,14 @@ def create( *, account_id: str, expected_disposition: Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"], - eml_content: Optional[str] | NotGiven = NOT_GIVEN, + eml_content: str | Omit = omit, + escalated_submission_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Change email classfication @@ -86,6 +87,7 @@ def create( { "expected_disposition": expected_disposition, "eml_content": eml_content, + "escalated_submission_id": escalated_submission_id, }, reclassify_create_params.ReclassifyCreateParams, ), @@ -126,13 +128,14 @@ async def create( *, account_id: str, expected_disposition: Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"], - eml_content: Optional[str] | NotGiven = NOT_GIVEN, + eml_content: str | Omit = omit, + escalated_submission_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Change email classfication @@ -162,6 +165,7 @@ async def create( { "expected_disposition": expected_disposition, "eml_content": eml_content, + "escalated_submission_id": escalated_submission_id, }, reclassify_create_params.ReclassifyCreateParams, ), diff --git a/src/cloudflare/resources/email_security/investigate/release.py b/src/cloudflare/resources/email_security/investigate/release.py index 2777dfaea86..12789ed5119 100644 --- a/src/cloudflare/resources/email_security/investigate/release.py +++ b/src/cloudflare/resources/email_security/investigate/release.py @@ -2,11 +2,9 @@ from __future__ import annotations -from typing import List - import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ...._utils import maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -47,13 +45,13 @@ def bulk( self, *, account_id: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ReleaseBulkResponse]: """ Release messages from quarantine @@ -76,7 +74,7 @@ def bulk( return self._get_api_list( f"/accounts/{account_id}/email-security/investigate/release", page=SyncSinglePage[ReleaseBulkResponse], - body=maybe_transform(body, List[str]), + body=maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -109,13 +107,13 @@ def bulk( self, *, account_id: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ReleaseBulkResponse, AsyncSinglePage[ReleaseBulkResponse]]: """ Release messages from quarantine @@ -138,7 +136,7 @@ def bulk( return self._get_api_list( f"/accounts/{account_id}/email-security/investigate/release", page=AsyncSinglePage[ReleaseBulkResponse], - body=maybe_transform(body, List[str]), + body=maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/cloudflare/resources/email_security/investigate/trace.py b/src/cloudflare/resources/email_security/investigate/trace.py index 10fd2ace6d3..6ca1601d587 100644 --- a/src/cloudflare/resources/email_security/investigate/trace.py +++ b/src/cloudflare/resources/email_security/investigate/trace.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TraceGetResponse: """ Get email trace @@ -117,7 +117,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TraceGetResponse: """ Get email trace diff --git a/src/cloudflare/resources/email_security/settings/allow_policies.py b/src/cloudflare/resources/email_security/settings/allow_policies.py index 2b89d18d014..a2b0da56230 100644 --- a/src/cloudflare/resources/email_security/settings/allow_policies.py +++ b/src/cloudflare/resources/email_security/settings/allow_policies.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -65,16 +65,16 @@ def create( pattern: str, pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"], verify_sender: bool, - comments: Optional[str] | NotGiven = NOT_GIVEN, - is_recipient: bool | NotGiven = NOT_GIVEN, - is_sender: bool | NotGiven = NOT_GIVEN, - is_spoof: bool | NotGiven = NOT_GIVEN, + comments: Optional[str] | Omit = omit, + is_recipient: bool | Omit = omit, + is_sender: bool | Omit = omit, + is_spoof: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyCreateResponse: """ Create an email allow policy @@ -135,25 +135,26 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - is_acceptable_sender: bool | NotGiven = NOT_GIVEN, - is_exempt_recipient: bool | NotGiven = NOT_GIVEN, - is_recipient: bool | NotGiven = NOT_GIVEN, - is_sender: bool | NotGiven = NOT_GIVEN, - is_spoof: bool | NotGiven = NOT_GIVEN, - is_trusted_sender: bool | NotGiven = NOT_GIVEN, - order: Literal["pattern", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - verify_sender: bool | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + is_acceptable_sender: bool | Omit = omit, + is_exempt_recipient: bool | Omit = omit, + is_recipient: bool | Omit = omit, + is_sender: bool | Omit = omit, + is_spoof: bool | Omit = omit, + is_trusted_sender: bool | Omit = omit, + order: Literal["pattern", "created_at"] | Omit = omit, + page: int | Omit = omit, + pattern: str | Omit = omit, + pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit, + per_page: int | Omit = omit, + search: str | Omit = omit, + verify_sender: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[AllowPolicyListResponse]: """ Lists, searches, and sorts an account’s email allow policies. @@ -202,6 +203,7 @@ def list( "is_trusted_sender": is_trusted_sender, "order": order, "page": page, + "pattern": pattern, "pattern_type": pattern_type, "per_page": per_page, "search": search, @@ -223,7 +225,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyDeleteResponse: """ Delete an email allow policy @@ -260,20 +262,20 @@ def edit( policy_id: int, *, account_id: str, - comments: Optional[str] | NotGiven = NOT_GIVEN, - is_acceptable_sender: Optional[bool] | NotGiven = NOT_GIVEN, - is_exempt_recipient: Optional[bool] | NotGiven = NOT_GIVEN, - is_regex: Optional[bool] | NotGiven = NOT_GIVEN, - is_trusted_sender: Optional[bool] | NotGiven = NOT_GIVEN, - pattern: Optional[str] | NotGiven = NOT_GIVEN, - pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | NotGiven = NOT_GIVEN, - verify_sender: Optional[bool] | NotGiven = NOT_GIVEN, + comments: Optional[str] | Omit = omit, + is_acceptable_sender: Optional[bool] | Omit = omit, + is_exempt_recipient: Optional[bool] | Omit = omit, + is_regex: Optional[bool] | Omit = omit, + is_trusted_sender: Optional[bool] | Omit = omit, + pattern: Optional[str] | Omit = omit, + pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit, + verify_sender: Optional[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyEditResponse: """ Update an email allow policy @@ -339,7 +341,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyGetResponse: """ Get an email allow policy @@ -403,16 +405,16 @@ async def create( pattern: str, pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"], verify_sender: bool, - comments: Optional[str] | NotGiven = NOT_GIVEN, - is_recipient: bool | NotGiven = NOT_GIVEN, - is_sender: bool | NotGiven = NOT_GIVEN, - is_spoof: bool | NotGiven = NOT_GIVEN, + comments: Optional[str] | Omit = omit, + is_recipient: bool | Omit = omit, + is_sender: bool | Omit = omit, + is_spoof: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyCreateResponse: """ Create an email allow policy @@ -473,25 +475,26 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - is_acceptable_sender: bool | NotGiven = NOT_GIVEN, - is_exempt_recipient: bool | NotGiven = NOT_GIVEN, - is_recipient: bool | NotGiven = NOT_GIVEN, - is_sender: bool | NotGiven = NOT_GIVEN, - is_spoof: bool | NotGiven = NOT_GIVEN, - is_trusted_sender: bool | NotGiven = NOT_GIVEN, - order: Literal["pattern", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - verify_sender: bool | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + is_acceptable_sender: bool | Omit = omit, + is_exempt_recipient: bool | Omit = omit, + is_recipient: bool | Omit = omit, + is_sender: bool | Omit = omit, + is_spoof: bool | Omit = omit, + is_trusted_sender: bool | Omit = omit, + order: Literal["pattern", "created_at"] | Omit = omit, + page: int | Omit = omit, + pattern: str | Omit = omit, + pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit, + per_page: int | Omit = omit, + search: str | Omit = omit, + verify_sender: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AllowPolicyListResponse, AsyncV4PagePaginationArray[AllowPolicyListResponse]]: """ Lists, searches, and sorts an account’s email allow policies. @@ -540,6 +543,7 @@ def list( "is_trusted_sender": is_trusted_sender, "order": order, "page": page, + "pattern": pattern, "pattern_type": pattern_type, "per_page": per_page, "search": search, @@ -561,7 +565,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyDeleteResponse: """ Delete an email allow policy @@ -598,20 +602,20 @@ async def edit( policy_id: int, *, account_id: str, - comments: Optional[str] | NotGiven = NOT_GIVEN, - is_acceptable_sender: Optional[bool] | NotGiven = NOT_GIVEN, - is_exempt_recipient: Optional[bool] | NotGiven = NOT_GIVEN, - is_regex: Optional[bool] | NotGiven = NOT_GIVEN, - is_trusted_sender: Optional[bool] | NotGiven = NOT_GIVEN, - pattern: Optional[str] | NotGiven = NOT_GIVEN, - pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | NotGiven = NOT_GIVEN, - verify_sender: Optional[bool] | NotGiven = NOT_GIVEN, + comments: Optional[str] | Omit = omit, + is_acceptable_sender: Optional[bool] | Omit = omit, + is_exempt_recipient: Optional[bool] | Omit = omit, + is_regex: Optional[bool] | Omit = omit, + is_trusted_sender: Optional[bool] | Omit = omit, + pattern: Optional[str] | Omit = omit, + pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit, + verify_sender: Optional[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyEditResponse: """ Update an email allow policy @@ -677,7 +681,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyGetResponse: """ Get an email allow policy diff --git a/src/cloudflare/resources/email_security/settings/block_senders.py b/src/cloudflare/resources/email_security/settings/block_senders.py index 3bc10baf9d2..350053cb5b4 100644 --- a/src/cloudflare/resources/email_security/settings/block_senders.py +++ b/src/cloudflare/resources/email_security/settings/block_senders.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -61,13 +61,13 @@ def create( is_regex: bool, pattern: str, pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"], - comments: Optional[str] | NotGiven = NOT_GIVEN, + comments: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderCreateResponse: """ Create a blocked email sender @@ -110,18 +110,19 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["pattern", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["pattern", "created_at"] | Omit = omit, + page: int | Omit = omit, + pattern: str | Omit = omit, + pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit, + per_page: int | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[BlockSenderListResponse]: """ List blocked email senders @@ -164,6 +165,7 @@ def list( "direction": direction, "order": order, "page": page, + "pattern": pattern, "pattern_type": pattern_type, "per_page": per_page, "search": search, @@ -184,7 +186,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderDeleteResponse: """ Delete a blocked email sender @@ -221,16 +223,16 @@ def edit( pattern_id: int, *, account_id: str, - comments: Optional[str] | NotGiven = NOT_GIVEN, - is_regex: Optional[bool] | NotGiven = NOT_GIVEN, - pattern: Optional[str] | NotGiven = NOT_GIVEN, - pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | NotGiven = NOT_GIVEN, + comments: Optional[str] | Omit = omit, + is_regex: Optional[bool] | Omit = omit, + pattern: Optional[str] | Omit = omit, + pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderEditResponse: """ Update a blocked email sender @@ -281,7 +283,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderGetResponse: """ Get a blocked email sender @@ -341,13 +343,13 @@ async def create( is_regex: bool, pattern: str, pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"], - comments: Optional[str] | NotGiven = NOT_GIVEN, + comments: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderCreateResponse: """ Create a blocked email sender @@ -390,18 +392,19 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["pattern", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["pattern", "created_at"] | Omit = omit, + page: int | Omit = omit, + pattern: str | Omit = omit, + pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit, + per_page: int | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[BlockSenderListResponse, AsyncV4PagePaginationArray[BlockSenderListResponse]]: """ List blocked email senders @@ -444,6 +447,7 @@ def list( "direction": direction, "order": order, "page": page, + "pattern": pattern, "pattern_type": pattern_type, "per_page": per_page, "search": search, @@ -464,7 +468,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderDeleteResponse: """ Delete a blocked email sender @@ -501,16 +505,16 @@ async def edit( pattern_id: int, *, account_id: str, - comments: Optional[str] | NotGiven = NOT_GIVEN, - is_regex: Optional[bool] | NotGiven = NOT_GIVEN, - pattern: Optional[str] | NotGiven = NOT_GIVEN, - pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | NotGiven = NOT_GIVEN, + comments: Optional[str] | Omit = omit, + is_regex: Optional[bool] | Omit = omit, + pattern: Optional[str] | Omit = omit, + pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderEditResponse: """ Update a blocked email sender @@ -561,7 +565,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderGetResponse: """ Get a blocked email sender diff --git a/src/cloudflare/resources/email_security/settings/domains.py b/src/cloudflare/resources/email_security/settings/domains.py index 2166d0607cd..07e63ac3dad 100644 --- a/src/cloudflare/resources/email_security/settings/domains.py +++ b/src/cloudflare/resources/email_security/settings/domains.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import List, Type, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,20 +54,20 @@ def list( self, *, account_id: str, - active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | NotGiven = NOT_GIVEN, - allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - domain: List[str] | NotGiven = NOT_GIVEN, - order: Literal["domain", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + 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, + domain: SequenceNotStr[str] | Omit = omit, + order: Literal["domain", "created_at"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[DomainListResponse]: """ Lists, searches, and sorts an account’s email domains. @@ -138,7 +138,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainDeleteResponse: """ Unprotect an email domain @@ -179,7 +179,7 @@ def bulk_delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DomainBulkDeleteResponse]: """ Unprotect multiple email domains @@ -212,9 +212,9 @@ def edit( domain_id: int, *, account_id: str, - ip_restrictions: List[str], - allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]] | NotGiven = NOT_GIVEN, - domain: Optional[str] | NotGiven = NOT_GIVEN, + ip_restrictions: SequenceNotStr[str], + allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]] | Omit = omit, + domain: str | Omit = omit, drop_dispositions: List[ Literal[ "MALICIOUS", @@ -229,19 +229,20 @@ def edit( "NONE", ] ] - | NotGiven = NOT_GIVEN, - folder: Literal["AllItems", "Inbox"] | NotGiven = NOT_GIVEN, - integration_id: Optional[str] | NotGiven = NOT_GIVEN, - lookback_hops: Optional[int] | NotGiven = NOT_GIVEN, - require_tls_inbound: bool | NotGiven = NOT_GIVEN, - require_tls_outbound: bool | NotGiven = NOT_GIVEN, - transport: str | NotGiven = NOT_GIVEN, + | Omit = omit, + folder: Literal["AllItems", "Inbox"] | Omit = omit, + integration_id: str | Omit = omit, + lookback_hops: int | Omit = omit, + regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]] | Omit = omit, + require_tls_inbound: bool | Omit = omit, + require_tls_outbound: bool | Omit = omit, + transport: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainEditResponse: """ Update an email domain @@ -272,6 +273,7 @@ def edit( "folder": folder, "integration_id": integration_id, "lookback_hops": lookback_hops, + "regions": regions, "require_tls_inbound": require_tls_inbound, "require_tls_outbound": require_tls_outbound, "transport": transport, @@ -298,7 +300,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainGetResponse: """ Get an email domain @@ -355,20 +357,20 @@ def list( self, *, account_id: str, - active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | NotGiven = NOT_GIVEN, - allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - domain: List[str] | NotGiven = NOT_GIVEN, - order: Literal["domain", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + 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, + domain: SequenceNotStr[str] | Omit = omit, + order: Literal["domain", "created_at"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DomainListResponse, AsyncV4PagePaginationArray[DomainListResponse]]: """ Lists, searches, and sorts an account’s email domains. @@ -439,7 +441,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainDeleteResponse: """ Unprotect an email domain @@ -480,7 +482,7 @@ def bulk_delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DomainBulkDeleteResponse, AsyncSinglePage[DomainBulkDeleteResponse]]: """ Unprotect multiple email domains @@ -513,9 +515,9 @@ async def edit( domain_id: int, *, account_id: str, - ip_restrictions: List[str], - allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]] | NotGiven = NOT_GIVEN, - domain: Optional[str] | NotGiven = NOT_GIVEN, + ip_restrictions: SequenceNotStr[str], + allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]] | Omit = omit, + domain: str | Omit = omit, drop_dispositions: List[ Literal[ "MALICIOUS", @@ -530,19 +532,20 @@ async def edit( "NONE", ] ] - | NotGiven = NOT_GIVEN, - folder: Literal["AllItems", "Inbox"] | NotGiven = NOT_GIVEN, - integration_id: Optional[str] | NotGiven = NOT_GIVEN, - lookback_hops: Optional[int] | NotGiven = NOT_GIVEN, - require_tls_inbound: bool | NotGiven = NOT_GIVEN, - require_tls_outbound: bool | NotGiven = NOT_GIVEN, - transport: str | NotGiven = NOT_GIVEN, + | Omit = omit, + folder: Literal["AllItems", "Inbox"] | Omit = omit, + integration_id: str | Omit = omit, + lookback_hops: int | Omit = omit, + regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]] | Omit = omit, + require_tls_inbound: bool | Omit = omit, + require_tls_outbound: bool | Omit = omit, + transport: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainEditResponse: """ Update an email domain @@ -573,6 +576,7 @@ async def edit( "folder": folder, "integration_id": integration_id, "lookback_hops": lookback_hops, + "regions": regions, "require_tls_inbound": require_tls_inbound, "require_tls_outbound": require_tls_outbound, "transport": transport, @@ -599,7 +603,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainGetResponse: """ Get an email domain diff --git a/src/cloudflare/resources/email_security/settings/impersonation_registry.py b/src/cloudflare/resources/email_security/settings/impersonation_registry.py index 3c1866482fc..e5dcaae2429 100644 --- a/src/cloudflare/resources/email_security/settings/impersonation_registry.py +++ b/src/cloudflare/resources/email_security/settings/impersonation_registry.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -66,7 +66,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryCreateResponse: """ Create an entry in impersonation registry @@ -108,19 +108,19 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["name", "email", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["name", "email", "created_at"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"] - | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[ImpersonationRegistryListResponse]: """ Lists, searches, and sorts entries in the impersonation registry. @@ -183,7 +183,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryDeleteResponse: """ Delete an entry from impersonation registry @@ -218,15 +218,15 @@ def edit( display_name_id: int, *, account_id: str, - email: Optional[str] | NotGiven = NOT_GIVEN, - is_email_regex: Optional[bool] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + email: Optional[str] | Omit = omit, + is_email_regex: Optional[bool] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryEditResponse: """ Update an entry in impersonation registry @@ -274,7 +274,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryGetResponse: """ Get an entry in impersonation registry @@ -337,7 +337,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryCreateResponse: """ Create an entry in impersonation registry @@ -379,19 +379,19 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["name", "email", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["name", "email", "created_at"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"] - | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ ImpersonationRegistryListResponse, AsyncV4PagePaginationArray[ImpersonationRegistryListResponse] ]: @@ -456,7 +456,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryDeleteResponse: """ Delete an entry from impersonation registry @@ -491,15 +491,15 @@ async def edit( display_name_id: int, *, account_id: str, - email: Optional[str] | NotGiven = NOT_GIVEN, - is_email_regex: Optional[bool] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + email: Optional[str] | Omit = omit, + is_email_regex: Optional[bool] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryEditResponse: """ Update an entry in impersonation registry @@ -547,7 +547,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryGetResponse: """ Get an entry in impersonation registry diff --git a/src/cloudflare/resources/email_security/settings/trusted_domains.py b/src/cloudflare/resources/email_security/settings/trusted_domains.py index 1f318a5ba1b..184b212d2ee 100644 --- a/src/cloudflare/resources/email_security/settings/trusted_domains.py +++ b/src/cloudflare/resources/email_security/settings/trusted_domains.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -63,13 +63,13 @@ def create( is_regex: bool, is_similarity: bool, pattern: str, - comments: Optional[str] | NotGiven = NOT_GIVEN, + comments: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: """ Create a trusted email domain @@ -104,7 +104,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: """ Create a trusted email domain @@ -127,18 +127,18 @@ def create( self, *, account_id: str, - is_recent: bool | NotGiven = NOT_GIVEN, - is_regex: bool | NotGiven = NOT_GIVEN, - is_similarity: bool | NotGiven = NOT_GIVEN, - pattern: str | NotGiven = NOT_GIVEN, - comments: Optional[str] | NotGiven = NOT_GIVEN, - body: Iterable[trusted_domain_create_params.Variant1Body] | NotGiven = NOT_GIVEN, + is_recent: bool | Omit = omit, + is_regex: bool | Omit = omit, + is_similarity: bool | Omit = omit, + pattern: str | Omit = omit, + comments: Optional[str] | Omit = omit, + body: Iterable[trusted_domain_create_params.Variant1Body] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -174,19 +174,20 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - is_recent: bool | NotGiven = NOT_GIVEN, - is_similarity: bool | NotGiven = NOT_GIVEN, - order: Literal["pattern", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + is_recent: bool | Omit = omit, + is_similarity: bool | Omit = omit, + order: Literal["pattern", "created_at"] | Omit = omit, + page: int | Omit = omit, + pattern: str | Omit = omit, + per_page: int | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[TrustedDomainListResponse]: """ Lists, searches, and sorts an account’s trusted email domains. @@ -231,6 +232,7 @@ def list( "is_similarity": is_similarity, "order": order, "page": page, + "pattern": pattern, "per_page": per_page, "search": search, }, @@ -250,7 +252,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainDeleteResponse: """ Delete a trusted email domain @@ -287,17 +289,17 @@ def edit( trusted_domain_id: int, *, account_id: str, - comments: Optional[str] | NotGiven = NOT_GIVEN, - is_recent: Optional[bool] | NotGiven = NOT_GIVEN, - is_regex: Optional[bool] | NotGiven = NOT_GIVEN, - is_similarity: Optional[bool] | NotGiven = NOT_GIVEN, - pattern: Optional[str] | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + is_recent: bool | Omit = omit, + is_regex: bool | Omit = omit, + is_similarity: bool | Omit = omit, + pattern: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainEditResponse: """ Update a trusted email domain @@ -355,7 +357,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainGetResponse: """ Get a trusted email domain @@ -417,13 +419,13 @@ async def create( is_regex: bool, is_similarity: bool, pattern: str, - comments: Optional[str] | NotGiven = NOT_GIVEN, + comments: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: """ Create a trusted email domain @@ -458,7 +460,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: """ Create a trusted email domain @@ -481,18 +483,18 @@ async def create( self, *, account_id: str, - is_recent: bool | NotGiven = NOT_GIVEN, - is_regex: bool | NotGiven = NOT_GIVEN, - is_similarity: bool | NotGiven = NOT_GIVEN, - pattern: str | NotGiven = NOT_GIVEN, - comments: Optional[str] | NotGiven = NOT_GIVEN, - body: Iterable[trusted_domain_create_params.Variant1Body] | NotGiven = NOT_GIVEN, + is_recent: bool | Omit = omit, + is_regex: bool | Omit = omit, + is_similarity: bool | Omit = omit, + pattern: str | Omit = omit, + comments: Optional[str] | Omit = omit, + body: Iterable[trusted_domain_create_params.Variant1Body] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -528,19 +530,20 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - is_recent: bool | NotGiven = NOT_GIVEN, - is_similarity: bool | NotGiven = NOT_GIVEN, - order: Literal["pattern", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + is_recent: bool | Omit = omit, + is_similarity: bool | Omit = omit, + order: Literal["pattern", "created_at"] | Omit = omit, + page: int | Omit = omit, + pattern: str | Omit = omit, + per_page: int | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TrustedDomainListResponse, AsyncV4PagePaginationArray[TrustedDomainListResponse]]: """ Lists, searches, and sorts an account’s trusted email domains. @@ -585,6 +588,7 @@ def list( "is_similarity": is_similarity, "order": order, "page": page, + "pattern": pattern, "per_page": per_page, "search": search, }, @@ -604,7 +608,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainDeleteResponse: """ Delete a trusted email domain @@ -641,17 +645,17 @@ async def edit( trusted_domain_id: int, *, account_id: str, - comments: Optional[str] | NotGiven = NOT_GIVEN, - is_recent: Optional[bool] | NotGiven = NOT_GIVEN, - is_regex: Optional[bool] | NotGiven = NOT_GIVEN, - is_similarity: Optional[bool] | NotGiven = NOT_GIVEN, - pattern: Optional[str] | NotGiven = NOT_GIVEN, + comments: str | Omit = omit, + is_recent: bool | Omit = omit, + is_regex: bool | Omit = omit, + is_similarity: bool | Omit = omit, + pattern: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainEditResponse: """ Update a trusted email domain @@ -709,7 +713,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainGetResponse: """ Get a trusted email domain diff --git a/src/cloudflare/resources/email_security/submissions.py b/src/cloudflare/resources/email_security/submissions.py index 1af86640ec5..4e8ff7ee97b 100644 --- a/src/cloudflare/resources/email_security/submissions.py +++ b/src/cloudflare/resources/email_security/submissions.py @@ -8,7 +8,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,24 +50,23 @@ def list( self, *, account_id: str, - end: Union[str, datetime] | NotGiven = NOT_GIVEN, - original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] - | NotGiven = NOT_GIVEN, - outcome_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - query: Optional[str] | NotGiven = NOT_GIVEN, - requested_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] - | NotGiven = NOT_GIVEN, - start: Union[str, datetime] | NotGiven = NOT_GIVEN, - submission_id: str | NotGiven = NOT_GIVEN, - type: Literal["TEAM", "USER"] | NotGiven = NOT_GIVEN, + end: Union[str, datetime] | Omit = omit, + original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit, + outcome_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + query: Optional[str] | Omit = omit, + requested_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit, + start: Union[str, datetime] | Omit = omit, + status: str | Omit = omit, + submission_id: str | Omit = omit, + type: Literal["TEAM", "USER"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[SubmissionListResponse]: """ This endpoint returns information for submissions to made to reclassify emails. @@ -111,6 +110,7 @@ def list( "query": query, "requested_disposition": requested_disposition, "start": start, + "status": status, "submission_id": submission_id, "type": type, }, @@ -145,24 +145,23 @@ def list( self, *, account_id: str, - end: Union[str, datetime] | NotGiven = NOT_GIVEN, - original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] - | NotGiven = NOT_GIVEN, - outcome_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - query: Optional[str] | NotGiven = NOT_GIVEN, - requested_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] - | NotGiven = NOT_GIVEN, - start: Union[str, datetime] | NotGiven = NOT_GIVEN, - submission_id: str | NotGiven = NOT_GIVEN, - type: Literal["TEAM", "USER"] | NotGiven = NOT_GIVEN, + end: Union[str, datetime] | Omit = omit, + original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit, + outcome_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + query: Optional[str] | Omit = omit, + requested_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit, + start: Union[str, datetime] | Omit = omit, + status: str | Omit = omit, + submission_id: str | Omit = omit, + type: Literal["TEAM", "USER"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SubmissionListResponse, AsyncV4PagePaginationArray[SubmissionListResponse]]: """ This endpoint returns information for submissions to made to reclassify emails. @@ -206,6 +205,7 @@ def list( "query": query, "requested_disposition": requested_disposition, "start": start, + "status": status, "submission_id": submission_id, "type": type, }, diff --git a/src/cloudflare/resources/filters.py b/src/cloudflare/resources/filters.py index d8a71ad3955..9ecfd9dc3ab 100644 --- a/src/cloudflare/resources/filters.py +++ b/src/cloudflare/resources/filters.py @@ -3,11 +3,11 @@ from __future__ import annotations import typing_extensions -from typing import Type, cast +from typing import Type, Iterable, Optional, cast import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -20,8 +20,16 @@ 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_create_params, filter_update_params +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"] @@ -53,13 +61,13 @@ def create( self, *, zone_id: str, - expression: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FirewallFilter]: """ Creates one or more filters. @@ -67,9 +75,6 @@ def create( Args: zone_id: Defines an identifier. - expression: The filter expression. For more information, refer to - [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -83,7 +88,7 @@ def create( return self._get_api_list( f"/zones/{zone_id}/filters", page=SyncSinglePage[FirewallFilter], - body=maybe_transform({"expression": expression}, filter_create_params.FilterCreateParams), + body=maybe_transform(body, Iterable[FirewallFilterParam]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -99,13 +104,16 @@ def update( filter_id: str, *, zone_id: str, - body: object, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallFilter: """ Updates an existing filter. @@ -115,6 +123,15 @@ def update( 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 @@ -129,7 +146,15 @@ def update( 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(body, filter_update_params.FilterUpdateParams), + 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, @@ -147,19 +172,19 @@ def list( self, *, zone_id: str, - id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - paused: bool | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[FirewallFilter]: """Fetches filters in a zone. @@ -230,8 +255,8 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FirewallFilter: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> FilterDeleteResponse: """ Deletes an existing filter. @@ -259,9 +284,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FirewallFilter]._unwrapper, + post_parser=ResultWrapper[FilterDeleteResponse]._unwrapper, ), - cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]), + cast_to=cast(Type[FilterDeleteResponse], ResultWrapper[FilterDeleteResponse]), ) @typing_extensions.deprecated( @@ -271,13 +296,14 @@ 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, - ) -> SyncSinglePage[FirewallFilter]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[FilterBulkDeleteResponse]: """ Deletes one or more existing filters. @@ -294,14 +320,17 @@ def bulk_delete( """ 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( + return self._delete( f"/zones/{zone_id}/filters", - page=SyncSinglePage[FirewallFilter], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + 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, ), - model=FirewallFilter, - method="delete", + cast_to=cast(Type[Optional[FilterBulkDeleteResponse]], ResultWrapper[FilterBulkDeleteResponse]), ) @typing_extensions.deprecated( @@ -311,12 +340,13 @@ 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FirewallFilter]: """ Updates one or more existing filters. @@ -337,6 +367,7 @@ def bulk_update( 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 ), @@ -357,7 +388,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallFilter: """ Fetches the details of a filter. @@ -419,13 +450,13 @@ def create( self, *, zone_id: str, - expression: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FirewallFilter, AsyncSinglePage[FirewallFilter]]: """ Creates one or more filters. @@ -433,9 +464,6 @@ def create( Args: zone_id: Defines an identifier. - expression: The filter expression. For more information, refer to - [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -449,7 +477,7 @@ def create( return self._get_api_list( f"/zones/{zone_id}/filters", page=AsyncSinglePage[FirewallFilter], - body=maybe_transform({"expression": expression}, filter_create_params.FilterCreateParams), + body=maybe_transform(body, Iterable[FirewallFilterParam]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -465,13 +493,16 @@ async def update( filter_id: str, *, zone_id: str, - body: object, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallFilter: """ Updates an existing filter. @@ -481,6 +512,15 @@ async def update( 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 @@ -495,7 +535,15 @@ async def update( 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(body, filter_update_params.FilterUpdateParams), + 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, @@ -513,19 +561,19 @@ def list( self, *, zone_id: str, - id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - paused: bool | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FirewallFilter, AsyncV4PagePaginationArray[FirewallFilter]]: """Fetches filters in a zone. @@ -596,8 +644,8 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FirewallFilter: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> FilterDeleteResponse: """ Deletes an existing filter. @@ -625,25 +673,26 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FirewallFilter]._unwrapper, + post_parser=ResultWrapper[FilterDeleteResponse]._unwrapper, ), - cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]), + 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( + 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, - ) -> AsyncPaginator[FirewallFilter, AsyncSinglePage[FirewallFilter]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[FilterBulkDeleteResponse]: """ Deletes one or more existing filters. @@ -660,14 +709,17 @@ def bulk_delete( """ 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( + return await self._delete( f"/zones/{zone_id}/filters", - page=AsyncSinglePage[FirewallFilter], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + 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, ), - model=FirewallFilter, - method="delete", + cast_to=cast(Type[Optional[FilterBulkDeleteResponse]], ResultWrapper[FilterBulkDeleteResponse]), ) @typing_extensions.deprecated( @@ -677,12 +729,13 @@ 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FirewallFilter, AsyncSinglePage[FirewallFilter]]: """ Updates one or more existing filters. @@ -703,6 +756,7 @@ def bulk_update( 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 ), @@ -723,7 +777,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallFilter: """ Fetches the details of a filter. @@ -764,37 +818,37 @@ def __init__(self, filters: FiltersResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - filters.create # pyright: ignore[reportDeprecated], + filters.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - filters.update # pyright: ignore[reportDeprecated], + filters.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - filters.list # pyright: ignore[reportDeprecated], + filters.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - filters.delete # pyright: ignore[reportDeprecated], + filters.delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - filters.bulk_delete # pyright: ignore[reportDeprecated], + filters.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - filters.bulk_update # pyright: ignore[reportDeprecated], + filters.bulk_update, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - filters.get # pyright: ignore[reportDeprecated], + filters.get, # pyright: ignore[reportDeprecated], ) ) @@ -805,37 +859,37 @@ def __init__(self, filters: AsyncFiltersResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - filters.create # pyright: ignore[reportDeprecated], + filters.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - filters.update # pyright: ignore[reportDeprecated], + filters.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - filters.list # pyright: ignore[reportDeprecated], + filters.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - filters.delete # pyright: ignore[reportDeprecated], + filters.delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - filters.bulk_delete # pyright: ignore[reportDeprecated], + filters.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - filters.bulk_update # pyright: ignore[reportDeprecated], + filters.bulk_update, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - filters.get # pyright: ignore[reportDeprecated], + filters.get, # pyright: ignore[reportDeprecated], ) ) @@ -846,37 +900,37 @@ def __init__(self, filters: FiltersResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - filters.create # pyright: ignore[reportDeprecated], + filters.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - filters.update # pyright: ignore[reportDeprecated], + filters.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - filters.list # pyright: ignore[reportDeprecated], + filters.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - filters.delete # pyright: ignore[reportDeprecated], + filters.delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - filters.bulk_delete # pyright: ignore[reportDeprecated], + filters.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - filters.bulk_update # pyright: ignore[reportDeprecated], + filters.bulk_update, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - filters.get # pyright: ignore[reportDeprecated], + filters.get, # pyright: ignore[reportDeprecated], ) ) @@ -887,36 +941,36 @@ def __init__(self, filters: AsyncFiltersResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - filters.create # pyright: ignore[reportDeprecated], + filters.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - filters.update # pyright: ignore[reportDeprecated], + filters.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - filters.list # pyright: ignore[reportDeprecated], + filters.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - filters.delete # pyright: ignore[reportDeprecated], + filters.delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - filters.bulk_delete # pyright: ignore[reportDeprecated], + filters.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - filters.bulk_update # pyright: ignore[reportDeprecated], + filters.bulk_update, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - filters.get # pyright: ignore[reportDeprecated], + filters.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/firewall/access_rules.py b/src/cloudflare/resources/firewall/access_rules.py index 2017e8d7ab6..ed893e5a5b3 100644 --- a/src/cloudflare/resources/firewall/access_rules.py +++ b/src/cloudflare/resources/firewall/access_rules.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,15 +55,15 @@ def create( *, configuration: access_rule_create_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - notes: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccessRuleCreateResponse: """Creates a new IP Access rule for an account or zone. @@ -127,22 +127,22 @@ def create( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - configuration: access_rule_list_params.Configuration | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"] | NotGiven = NOT_GIVEN, - notes: str | NotGiven = NOT_GIVEN, - order: Literal["configuration.target", "configuration.value", "mode"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"] | Omit = omit, + notes: str | Omit = omit, + order: Literal["configuration.target", "configuration.value", "mode"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[AccessRuleListResponse]: """Fetches IP Access rules of an account or zone. @@ -221,14 +221,14 @@ def delete( self, rule_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccessRuleDeleteResponse]: """ Deletes an existing IP Access rule defined. @@ -282,15 +282,15 @@ def edit( *, configuration: access_rule_edit_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - notes: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccessRuleEditResponse: """ Updates an IP Access rule defined. @@ -356,14 +356,14 @@ def get( self, rule_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccessRuleGetResponse: """ Fetches the details of an IP Access rule defined. @@ -435,15 +435,15 @@ async def create( *, configuration: access_rule_create_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - notes: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccessRuleCreateResponse: """Creates a new IP Access rule for an account or zone. @@ -507,22 +507,22 @@ async def create( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - configuration: access_rule_list_params.Configuration | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"] | NotGiven = NOT_GIVEN, - notes: str | NotGiven = NOT_GIVEN, - order: Literal["configuration.target", "configuration.value", "mode"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"] | Omit = omit, + notes: str | Omit = omit, + order: Literal["configuration.target", "configuration.value", "mode"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AccessRuleListResponse, AsyncV4PagePaginationArray[AccessRuleListResponse]]: """Fetches IP Access rules of an account or zone. @@ -601,14 +601,14 @@ async def delete( self, rule_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccessRuleDeleteResponse]: """ Deletes an existing IP Access rule defined. @@ -662,15 +662,15 @@ async def edit( *, configuration: access_rule_edit_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - notes: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccessRuleEditResponse: """ Updates an IP Access rule defined. @@ -736,14 +736,14 @@ async def get( self, rule_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccessRuleGetResponse: """ Fetches the details of an IP Access rule defined. diff --git a/src/cloudflare/resources/firewall/lockdowns.py b/src/cloudflare/resources/firewall/lockdowns.py index 1081d553f48..5204a546420 100644 --- a/src/cloudflare/resources/firewall/lockdowns.py +++ b/src/cloudflare/resources/firewall/lockdowns.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +from typing import Type, Union, Optional, cast from datetime import datetime import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,16 +54,16 @@ def create( *, zone_id: str, configurations: ConfigurationParam, - urls: List[OverrideURL], - description: str | NotGiven = NOT_GIVEN, - paused: bool | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + urls: SequenceNotStr[OverrideURL], + description: str | Omit = omit, + paused: bool | Omit = omit, + priority: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Lockdown: """ Creates a new Zone Lockdown rule. @@ -79,8 +79,8 @@ def create( entered URL will be escaped before use, which means you can only use simple wildcard patterns. - description: An informative summary of the rate limit. This value is sanitized and any tags - will be removed. + description: An informative summary of the rule. This value is sanitized and any tags will be + removed. paused: When true, indicates that the rule is currently paused. @@ -126,13 +126,13 @@ def update( *, zone_id: str, configurations: ConfigurationParam, - urls: List[OverrideURL], + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Lockdown: """ Updates an existing Zone Lockdown rule. @@ -185,23 +185,23 @@ def list( self, *, zone_id: str, - created_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - description_search: str | NotGiven = NOT_GIVEN, - ip: str | NotGiven = NOT_GIVEN, - ip_range_search: str | NotGiven = NOT_GIVEN, - ip_search: str | NotGiven = NOT_GIVEN, - modified_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - uri_search: str | NotGiven = NOT_GIVEN, + created_on: Union[str, datetime] | Omit = omit, + description: str | Omit = omit, + description_search: str | Omit = omit, + ip: str | Omit = omit, + ip_range_search: str | Omit = omit, + ip_search: str | Omit = omit, + modified_on: Union[str, datetime] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + priority: float | Omit = omit, + uri_search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Lockdown]: """Fetches Zone Lockdown rules. @@ -284,7 +284,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LockdownDeleteResponse]: """ Deletes an existing Zone Lockdown rule. @@ -328,7 +328,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Lockdown: """ Fetches the details of a Zone Lockdown rule. @@ -388,16 +388,16 @@ async def create( *, zone_id: str, configurations: ConfigurationParam, - urls: List[OverrideURL], - description: str | NotGiven = NOT_GIVEN, - paused: bool | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, + urls: SequenceNotStr[OverrideURL], + description: str | Omit = omit, + paused: bool | Omit = omit, + priority: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Lockdown: """ Creates a new Zone Lockdown rule. @@ -413,8 +413,8 @@ async def create( entered URL will be escaped before use, which means you can only use simple wildcard patterns. - description: An informative summary of the rate limit. This value is sanitized and any tags - will be removed. + description: An informative summary of the rule. This value is sanitized and any tags will be + removed. paused: When true, indicates that the rule is currently paused. @@ -460,13 +460,13 @@ async def update( *, zone_id: str, configurations: ConfigurationParam, - urls: List[OverrideURL], + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Lockdown: """ Updates an existing Zone Lockdown rule. @@ -519,23 +519,23 @@ def list( self, *, zone_id: str, - created_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - description_search: str | NotGiven = NOT_GIVEN, - ip: str | NotGiven = NOT_GIVEN, - ip_range_search: str | NotGiven = NOT_GIVEN, - ip_search: str | NotGiven = NOT_GIVEN, - modified_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - uri_search: str | NotGiven = NOT_GIVEN, + created_on: Union[str, datetime] | Omit = omit, + description: str | Omit = omit, + description_search: str | Omit = omit, + ip: str | Omit = omit, + ip_range_search: str | Omit = omit, + ip_search: str | Omit = omit, + modified_on: Union[str, datetime] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + priority: float | Omit = omit, + uri_search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Lockdown, AsyncV4PagePaginationArray[Lockdown]]: """Fetches Zone Lockdown rules. @@ -618,7 +618,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LockdownDeleteResponse]: """ Deletes an existing Zone Lockdown rule. @@ -662,7 +662,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Lockdown: """ Fetches the details of a Zone Lockdown rule. diff --git a/src/cloudflare/resources/firewall/rules.py b/src/cloudflare/resources/firewall/rules.py index 52561b605ee..cfa893c5cc1 100644 --- a/src/cloudflare/resources/firewall/rules.py +++ b/src/cloudflare/resources/firewall/rules.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -67,7 +67,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FirewallRule]: """ Create one or more firewall rules. @@ -120,7 +120,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallRule: """ Updates an existing firewall rule. @@ -171,18 +171,18 @@ def list( self, *, zone_id: str, - id: str | NotGiven = NOT_GIVEN, - action: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - paused: bool | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + action: str | Omit = omit, + description: str | Omit = omit, + page: float | Omit = omit, + paused: bool | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[FirewallRule]: """Fetches firewall rules in a zone. @@ -250,7 +250,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallRule: """ Deletes an existing firewall rule. @@ -296,7 +296,7 @@ def bulk_delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FirewallRule]: """ Deletes existing firewall rules. @@ -337,7 +337,7 @@ def bulk_edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FirewallRule]: """ Updates the priority of existing firewall rules. @@ -379,7 +379,7 @@ def bulk_update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FirewallRule]: """ Updates one or more existing firewall rules. @@ -421,7 +421,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FirewallRule]: """ Updates the priority of an existing firewall rule. @@ -466,7 +466,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallRule: """ Fetches the details of a firewall rule. @@ -535,7 +535,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FirewallRule, AsyncSinglePage[FirewallRule]]: """ Create one or more firewall rules. @@ -588,7 +588,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallRule: """ Updates an existing firewall rule. @@ -639,18 +639,18 @@ def list( self, *, zone_id: str, - id: str | NotGiven = NOT_GIVEN, - action: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - paused: bool | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + action: str | Omit = omit, + description: str | Omit = omit, + page: float | Omit = omit, + paused: bool | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FirewallRule, AsyncV4PagePaginationArray[FirewallRule]]: """Fetches firewall rules in a zone. @@ -718,7 +718,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallRule: """ Deletes an existing firewall rule. @@ -764,7 +764,7 @@ def bulk_delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FirewallRule, AsyncSinglePage[FirewallRule]]: """ Deletes existing firewall rules. @@ -805,7 +805,7 @@ def bulk_edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FirewallRule, AsyncSinglePage[FirewallRule]]: """ Updates the priority of existing firewall rules. @@ -847,7 +847,7 @@ def bulk_update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FirewallRule, AsyncSinglePage[FirewallRule]]: """ Updates one or more existing firewall rules. @@ -889,7 +889,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FirewallRule, AsyncSinglePage[FirewallRule]]: """ Updates the priority of an existing firewall rule. @@ -934,7 +934,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallRule: """ Fetches the details of a firewall rule. @@ -975,47 +975,47 @@ def __init__(self, rules: RulesResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.create # pyright: ignore[reportDeprecated], + rules.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.update # pyright: ignore[reportDeprecated], + rules.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.list # pyright: ignore[reportDeprecated], + rules.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.delete # pyright: ignore[reportDeprecated], + rules.delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.bulk_delete # pyright: ignore[reportDeprecated], + rules.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_edit = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.bulk_edit # pyright: ignore[reportDeprecated], + rules.bulk_edit, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.bulk_update # pyright: ignore[reportDeprecated], + rules.bulk_update, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.edit # pyright: ignore[reportDeprecated], + rules.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.get # pyright: ignore[reportDeprecated], + rules.get, # pyright: ignore[reportDeprecated], ) ) @@ -1026,47 +1026,47 @@ def __init__(self, rules: AsyncRulesResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.create # pyright: ignore[reportDeprecated], + rules.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.update # pyright: ignore[reportDeprecated], + rules.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.list # pyright: ignore[reportDeprecated], + rules.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.delete # pyright: ignore[reportDeprecated], + rules.delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.bulk_delete # pyright: ignore[reportDeprecated], + rules.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_edit = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.bulk_edit # pyright: ignore[reportDeprecated], + rules.bulk_edit, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.bulk_update # pyright: ignore[reportDeprecated], + rules.bulk_update, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.edit # pyright: ignore[reportDeprecated], + rules.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.get # pyright: ignore[reportDeprecated], + rules.get, # pyright: ignore[reportDeprecated], ) ) @@ -1077,47 +1077,47 @@ def __init__(self, rules: RulesResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.create # pyright: ignore[reportDeprecated], + rules.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.update # pyright: ignore[reportDeprecated], + rules.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.list # pyright: ignore[reportDeprecated], + rules.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.delete # pyright: ignore[reportDeprecated], + rules.delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.bulk_delete # pyright: ignore[reportDeprecated], + rules.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_edit = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.bulk_edit # pyright: ignore[reportDeprecated], + rules.bulk_edit, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.bulk_update # pyright: ignore[reportDeprecated], + rules.bulk_update, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.edit # pyright: ignore[reportDeprecated], + rules.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.get # pyright: ignore[reportDeprecated], + rules.get, # pyright: ignore[reportDeprecated], ) ) @@ -1128,46 +1128,46 @@ def __init__(self, rules: AsyncRulesResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.create # pyright: ignore[reportDeprecated], + rules.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.update # pyright: ignore[reportDeprecated], + rules.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.list # pyright: ignore[reportDeprecated], + rules.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.delete # pyright: ignore[reportDeprecated], + rules.delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.bulk_delete # pyright: ignore[reportDeprecated], + rules.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_edit = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.bulk_edit # pyright: ignore[reportDeprecated], + rules.bulk_edit, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.bulk_update # pyright: ignore[reportDeprecated], + rules.bulk_update, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.edit # pyright: ignore[reportDeprecated], + rules.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.get # pyright: ignore[reportDeprecated], + rules.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/firewall/ua_rules.py b/src/cloudflare/resources/firewall/ua_rules.py index 5de9246f2c3..d9e987a57c2 100644 --- a/src/cloudflare/resources/firewall/ua_rules.py +++ b/src/cloudflare/resources/firewall/ua_rules.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Any, Type, cast +from typing import Type, cast from typing_extensions import Literal import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,12 +56,14 @@ def create( zone_id: str, configuration: ua_rule_create_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], + description: str | Omit = omit, + paused: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UARuleCreateResponse: """ Creates a new User Agent Blocking rule in a zone. @@ -71,6 +73,11 @@ def create( mode: The action to apply to a matched request. + description: An informative summary of the rule. This value is sanitized and any tags will be + removed. + + paused: When true, indicates that the rule is currently paused. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -81,28 +88,25 @@ def create( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - UARuleCreateResponse, - self._post( - f"/zones/{zone_id}/firewall/ua_rules", - body=maybe_transform( - { - "configuration": configuration, - "mode": mode, - }, - ua_rule_create_params.UARuleCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[UARuleCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[UARuleCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._post( + f"/zones/{zone_id}/firewall/ua_rules", + body=maybe_transform( + { + "configuration": configuration, + "mode": mode, + "description": description, + "paused": paused, + }, + ua_rule_create_params.UARuleCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[UARuleCreateResponse]._unwrapper, ), + cast_to=cast(Type[UARuleCreateResponse], ResultWrapper[UARuleCreateResponse]), ) def update( @@ -112,12 +116,14 @@ def update( zone_id: str, configuration: ua_rule_update_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], + description: str | Omit = omit, + paused: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UARuleUpdateResponse: """ Updates an existing User Agent Blocking rule. @@ -131,6 +137,11 @@ def update( mode: The action to apply to a matched request. + description: An informative summary of the rule. This value is sanitized and any tags will be + removed. + + paused: When true, indicates that the rule is currently paused. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -143,45 +154,42 @@ def update( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not ua_rule_id: raise ValueError(f"Expected a non-empty value for `ua_rule_id` but received {ua_rule_id!r}") - return cast( - UARuleUpdateResponse, - self._put( - f"/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", - body=maybe_transform( - { - "configuration": configuration, - "mode": mode, - }, - ua_rule_update_params.UARuleUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[UARuleUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[UARuleUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._put( + f"/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", + body=maybe_transform( + { + "configuration": configuration, + "mode": mode, + "description": description, + "paused": paused, + }, + ua_rule_update_params.UARuleUpdateParams, ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[UARuleUpdateResponse]._unwrapper, + ), + cast_to=cast(Type[UARuleUpdateResponse], ResultWrapper[UARuleUpdateResponse]), ) def list( self, *, zone_id: str, - description: str | NotGiven = NOT_GIVEN, - description_search: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - ua_search: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + page: float | Omit = omit, + paused: bool | Omit = omit, + per_page: float | Omit = omit, + user_agent: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[UARuleListResponse]: """Fetches User Agent Blocking rules in a zone. @@ -193,14 +201,14 @@ def list( description: A string to search for in the description of existing rules. - description_search: A string to search for in the description of existing rules. - page: Page number of paginated results. + paused: When true, indicates that the rule is currently paused. + per_page: 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`. - ua_search: A string to search for in the user agent values of existing rules. + user_agent: A string to search for in the user agent values of existing rules. extra_headers: Send extra headers @@ -223,10 +231,10 @@ def list( query=maybe_transform( { "description": description, - "description_search": description_search, "page": page, + "paused": paused, "per_page": per_page, - "ua_search": ua_search, + "user_agent": user_agent, }, ua_rule_list_params.UARuleListParams, ), @@ -244,7 +252,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UARuleDeleteResponse: """ Deletes an existing User Agent Blocking rule. @@ -288,7 +296,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UARuleGetResponse: """ Fetches the details of a User Agent Blocking rule. @@ -310,21 +318,16 @@ def get( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not ua_rule_id: raise ValueError(f"Expected a non-empty value for `ua_rule_id` but received {ua_rule_id!r}") - return cast( - UARuleGetResponse, - self._get( - f"/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[UARuleGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[UARuleGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get( + f"/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[UARuleGetResponse]._unwrapper, ), + cast_to=cast(Type[UARuleGetResponse], ResultWrapper[UARuleGetResponse]), ) @@ -354,12 +357,14 @@ async def create( zone_id: str, configuration: ua_rule_create_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], + description: str | Omit = omit, + paused: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UARuleCreateResponse: """ Creates a new User Agent Blocking rule in a zone. @@ -369,6 +374,11 @@ async def create( mode: The action to apply to a matched request. + description: An informative summary of the rule. This value is sanitized and any tags will be + removed. + + paused: When true, indicates that the rule is currently paused. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -379,28 +389,25 @@ async def create( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - UARuleCreateResponse, - await self._post( - f"/zones/{zone_id}/firewall/ua_rules", - body=await async_maybe_transform( - { - "configuration": configuration, - "mode": mode, - }, - ua_rule_create_params.UARuleCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[UARuleCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[UARuleCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._post( + f"/zones/{zone_id}/firewall/ua_rules", + body=await async_maybe_transform( + { + "configuration": configuration, + "mode": mode, + "description": description, + "paused": paused, + }, + ua_rule_create_params.UARuleCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[UARuleCreateResponse]._unwrapper, ), + cast_to=cast(Type[UARuleCreateResponse], ResultWrapper[UARuleCreateResponse]), ) async def update( @@ -410,12 +417,14 @@ async def update( zone_id: str, configuration: ua_rule_update_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], + description: str | Omit = omit, + paused: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UARuleUpdateResponse: """ Updates an existing User Agent Blocking rule. @@ -429,6 +438,11 @@ async def update( mode: The action to apply to a matched request. + description: An informative summary of the rule. This value is sanitized and any tags will be + removed. + + paused: When true, indicates that the rule is currently paused. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -441,45 +455,42 @@ async def update( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not ua_rule_id: raise ValueError(f"Expected a non-empty value for `ua_rule_id` but received {ua_rule_id!r}") - return cast( - UARuleUpdateResponse, - await self._put( - f"/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", - body=await async_maybe_transform( - { - "configuration": configuration, - "mode": mode, - }, - ua_rule_update_params.UARuleUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[UARuleUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[UARuleUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._put( + f"/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", + body=await async_maybe_transform( + { + "configuration": configuration, + "mode": mode, + "description": description, + "paused": paused, + }, + ua_rule_update_params.UARuleUpdateParams, ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[UARuleUpdateResponse]._unwrapper, + ), + cast_to=cast(Type[UARuleUpdateResponse], ResultWrapper[UARuleUpdateResponse]), ) def list( self, *, zone_id: str, - description: str | NotGiven = NOT_GIVEN, - description_search: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - ua_search: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + page: float | Omit = omit, + paused: bool | Omit = omit, + per_page: float | Omit = omit, + user_agent: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[UARuleListResponse, AsyncV4PagePaginationArray[UARuleListResponse]]: """Fetches User Agent Blocking rules in a zone. @@ -491,14 +502,14 @@ def list( description: A string to search for in the description of existing rules. - description_search: A string to search for in the description of existing rules. - page: Page number of paginated results. + paused: When true, indicates that the rule is currently paused. + per_page: 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`. - ua_search: A string to search for in the user agent values of existing rules. + user_agent: A string to search for in the user agent values of existing rules. extra_headers: Send extra headers @@ -521,10 +532,10 @@ def list( query=maybe_transform( { "description": description, - "description_search": description_search, "page": page, + "paused": paused, "per_page": per_page, - "ua_search": ua_search, + "user_agent": user_agent, }, ua_rule_list_params.UARuleListParams, ), @@ -542,7 +553,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UARuleDeleteResponse: """ Deletes an existing User Agent Blocking rule. @@ -586,7 +597,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UARuleGetResponse: """ Fetches the details of a User Agent Blocking rule. @@ -608,21 +619,16 @@ async def get( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not ua_rule_id: raise ValueError(f"Expected a non-empty value for `ua_rule_id` but received {ua_rule_id!r}") - return cast( - UARuleGetResponse, - await self._get( - f"/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[UARuleGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[UARuleGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._get( + f"/zones/{zone_id}/firewall/ua_rules/{ua_rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[UARuleGetResponse]._unwrapper, ), + cast_to=cast(Type[UARuleGetResponse], ResultWrapper[UARuleGetResponse]), ) diff --git a/src/cloudflare/resources/firewall/waf/overrides.py b/src/cloudflare/resources/firewall/waf/overrides.py index be591ce129f..b6a07f1ca89 100644 --- a/src/cloudflare/resources/firewall/waf/overrides.py +++ b/src/cloudflare/resources/firewall/waf/overrides.py @@ -3,11 +3,11 @@ from __future__ import annotations import typing_extensions -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -59,13 +59,13 @@ def create( self, *, zone_id: str, - urls: List[OverrideURL], + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Override: """ Creates a URI-based WAF override for a zone. @@ -112,13 +112,13 @@ def update( id: str, rewrite_action: RewriteActionParam, rules: WAFRuleParam, - urls: List[OverrideURL], + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Override: """ Updates an existing URI-based WAF override. @@ -184,14 +184,14 @@ def list( self, *, zone_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Override]: """ Fetches the URI-based WAF overrides in a zone. @@ -246,7 +246,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OverrideDeleteResponse]: """ Deletes an existing URI-based WAF override. @@ -294,7 +294,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Override: """ Fetches the details of a URI-based WAF override. @@ -357,13 +357,13 @@ async def create( self, *, zone_id: str, - urls: List[OverrideURL], + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Override: """ Creates a URI-based WAF override for a zone. @@ -410,13 +410,13 @@ async def update( id: str, rewrite_action: RewriteActionParam, rules: WAFRuleParam, - urls: List[OverrideURL], + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Override: """ Updates an existing URI-based WAF override. @@ -482,14 +482,14 @@ def list( self, *, zone_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Override, AsyncV4PagePaginationArray[Override]]: """ Fetches the URI-based WAF overrides in a zone. @@ -544,7 +544,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OverrideDeleteResponse]: """ Deletes an existing URI-based WAF override. @@ -592,7 +592,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Override: """ Fetches the details of a URI-based WAF override. @@ -636,27 +636,27 @@ def __init__(self, overrides: OverridesResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - overrides.create # pyright: ignore[reportDeprecated], + overrides.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - overrides.update # pyright: ignore[reportDeprecated], + overrides.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - overrides.list # pyright: ignore[reportDeprecated], + overrides.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - overrides.delete # pyright: ignore[reportDeprecated], + overrides.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - overrides.get # pyright: ignore[reportDeprecated], + overrides.get, # pyright: ignore[reportDeprecated], ) ) @@ -667,27 +667,27 @@ def __init__(self, overrides: AsyncOverridesResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - overrides.create # pyright: ignore[reportDeprecated], + overrides.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - overrides.update # pyright: ignore[reportDeprecated], + overrides.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - overrides.list # pyright: ignore[reportDeprecated], + overrides.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - overrides.delete # pyright: ignore[reportDeprecated], + overrides.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - overrides.get # pyright: ignore[reportDeprecated], + overrides.get, # pyright: ignore[reportDeprecated], ) ) @@ -698,27 +698,27 @@ def __init__(self, overrides: OverridesResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - overrides.create # pyright: ignore[reportDeprecated], + overrides.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - overrides.update # pyright: ignore[reportDeprecated], + overrides.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - overrides.list # pyright: ignore[reportDeprecated], + overrides.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - overrides.delete # pyright: ignore[reportDeprecated], + overrides.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - overrides.get # pyright: ignore[reportDeprecated], + overrides.get, # pyright: ignore[reportDeprecated], ) ) @@ -729,26 +729,26 @@ def __init__(self, overrides: AsyncOverridesResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - overrides.create # pyright: ignore[reportDeprecated], + overrides.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - overrides.update # pyright: ignore[reportDeprecated], + overrides.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - overrides.list # pyright: ignore[reportDeprecated], + overrides.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - overrides.delete # pyright: ignore[reportDeprecated], + overrides.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - overrides.get # pyright: ignore[reportDeprecated], + overrides.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/firewall/waf/packages/groups.py b/src/cloudflare/resources/firewall/waf/packages/groups.py index 53f71816ac1..e6c16052876 100644 --- a/src/cloudflare/resources/firewall/waf/packages/groups.py +++ b/src/cloudflare/resources/firewall/waf/packages/groups.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,20 +55,20 @@ def list( package_id: str, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - mode: Literal["on", "off"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["mode", "rules_count"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - rules_count: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + mode: Literal["on", "off"] | Omit = omit, + name: str | Omit = omit, + order: Literal["mode", "rules_count"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + rules_count: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Group]: """ Fetches the WAF rule groups in a WAF package. @@ -144,13 +144,13 @@ def edit( *, zone_id: str, package_id: str, - mode: Literal["on", "off"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GroupEditResponse: """Updates a WAF rule group. @@ -214,7 +214,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GroupGetResponse: """ Fetches the details of a WAF rule group. @@ -287,20 +287,20 @@ def list( package_id: str, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - mode: Literal["on", "off"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["mode", "rules_count"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - rules_count: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + mode: Literal["on", "off"] | Omit = omit, + name: str | Omit = omit, + order: Literal["mode", "rules_count"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + rules_count: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Group, AsyncV4PagePaginationArray[Group]]: """ Fetches the WAF rule groups in a WAF package. @@ -376,13 +376,13 @@ async def edit( *, zone_id: str, package_id: str, - mode: Literal["on", "off"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GroupEditResponse: """Updates a WAF rule group. @@ -446,7 +446,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GroupGetResponse: """ Fetches the details of a WAF rule group. @@ -499,17 +499,17 @@ def __init__(self, groups: GroupsResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - groups.list # pyright: ignore[reportDeprecated], + groups.list, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - groups.edit # pyright: ignore[reportDeprecated], + groups.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - groups.get # pyright: ignore[reportDeprecated], + groups.get, # pyright: ignore[reportDeprecated], ) ) @@ -520,17 +520,17 @@ def __init__(self, groups: AsyncGroupsResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - groups.list # pyright: ignore[reportDeprecated], + groups.list, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - groups.edit # pyright: ignore[reportDeprecated], + groups.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - groups.get # pyright: ignore[reportDeprecated], + groups.get, # pyright: ignore[reportDeprecated], ) ) @@ -541,17 +541,17 @@ def __init__(self, groups: GroupsResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - groups.list # pyright: ignore[reportDeprecated], + groups.list, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - groups.edit # pyright: ignore[reportDeprecated], + groups.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - groups.get # pyright: ignore[reportDeprecated], + groups.get, # pyright: ignore[reportDeprecated], ) ) @@ -562,16 +562,16 @@ def __init__(self, groups: AsyncGroupsResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - groups.list # pyright: ignore[reportDeprecated], + groups.list, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - groups.edit # pyright: ignore[reportDeprecated], + groups.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - groups.get # pyright: ignore[reportDeprecated], + groups.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/firewall/waf/packages/packages.py b/src/cloudflare/resources/firewall/waf/packages/packages.py index a671e95e6fc..97a9afe75a4 100644 --- a/src/cloudflare/resources/firewall/waf/packages/packages.py +++ b/src/cloudflare/resources/firewall/waf/packages/packages.py @@ -24,7 +24,7 @@ GroupsResourceWithStreamingResponse, AsyncGroupsResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -75,18 +75,18 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["name"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + name: str | Omit = omit, + order: Literal["name"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[object]: """ Fetches WAF packages for a zone. @@ -154,7 +154,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PackageGetResponse: """ Fetches the details of a WAF package. @@ -226,18 +226,18 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["name"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + name: str | Omit = omit, + order: Literal["name"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[object, AsyncV4PagePaginationArray[object]]: """ Fetches WAF packages for a zone. @@ -305,7 +305,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PackageGetResponse: """ Fetches the details of a WAF package. @@ -350,12 +350,12 @@ def __init__(self, packages: PackagesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - packages.list # pyright: ignore[reportDeprecated], + packages.list, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - packages.get # pyright: ignore[reportDeprecated], + packages.get, # pyright: ignore[reportDeprecated], ) ) @@ -374,12 +374,12 @@ def __init__(self, packages: AsyncPackagesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - packages.list # pyright: ignore[reportDeprecated], + packages.list, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - packages.get # pyright: ignore[reportDeprecated], + packages.get, # pyright: ignore[reportDeprecated], ) ) @@ -398,12 +398,12 @@ def __init__(self, packages: PackagesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - packages.list # pyright: ignore[reportDeprecated], + packages.list, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - packages.get # pyright: ignore[reportDeprecated], + packages.get, # pyright: ignore[reportDeprecated], ) ) @@ -422,12 +422,12 @@ def __init__(self, packages: AsyncPackagesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - packages.list # pyright: ignore[reportDeprecated], + packages.list, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - packages.get # pyright: ignore[reportDeprecated], + packages.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/firewall/waf/packages/rules.py b/src/cloudflare/resources/firewall/waf/packages/rules.py index cd48cc7c1ba..c59f9780c36 100644 --- a/src/cloudflare/resources/firewall/waf/packages/rules.py +++ b/src/cloudflare/resources/firewall/waf/packages/rules.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,21 +55,21 @@ def list( package_id: str, *, zone_id: str, - description: str | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - group_id: str | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - mode: Literal["DIS", "CHL", "BLK", "SIM"] | NotGiven = NOT_GIVEN, - order: Literal["priority", "group_id", "description"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - priority: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + group_id: str | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + mode: Literal["DIS", "CHL", "BLK", "SIM"] | Omit = omit, + order: Literal["priority", "group_id", "description"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + priority: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[RuleListResponse]: """ Fetches WAF rules in a WAF package. @@ -147,13 +147,13 @@ def edit( *, zone_id: str, package_id: str, - mode: Literal["default", "disable", "simulate", "block", "challenge", "on", "off"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """Updates a WAF rule. @@ -216,7 +216,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleGetResponse: """ Fetches the details of a WAF rule in a WAF package. @@ -289,21 +289,21 @@ def list( package_id: str, *, zone_id: str, - description: str | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - group_id: str | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - mode: Literal["DIS", "CHL", "BLK", "SIM"] | NotGiven = NOT_GIVEN, - order: Literal["priority", "group_id", "description"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - priority: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + group_id: str | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + mode: Literal["DIS", "CHL", "BLK", "SIM"] | Omit = omit, + order: Literal["priority", "group_id", "description"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + priority: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RuleListResponse, AsyncV4PagePaginationArray[RuleListResponse]]: """ Fetches WAF rules in a WAF package. @@ -381,13 +381,13 @@ async def edit( *, zone_id: str, package_id: str, - mode: Literal["default", "disable", "simulate", "block", "challenge", "on", "off"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """Updates a WAF rule. @@ -450,7 +450,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleGetResponse: """ Fetches the details of a WAF rule in a WAF package. @@ -503,17 +503,17 @@ def __init__(self, rules: RulesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.list # pyright: ignore[reportDeprecated], + rules.list, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.edit # pyright: ignore[reportDeprecated], + rules.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rules.get # pyright: ignore[reportDeprecated], + rules.get, # pyright: ignore[reportDeprecated], ) ) @@ -524,17 +524,17 @@ def __init__(self, rules: AsyncRulesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.list # pyright: ignore[reportDeprecated], + rules.list, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.edit # pyright: ignore[reportDeprecated], + rules.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rules.get # pyright: ignore[reportDeprecated], + rules.get, # pyright: ignore[reportDeprecated], ) ) @@ -545,17 +545,17 @@ def __init__(self, rules: RulesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.list # pyright: ignore[reportDeprecated], + rules.list, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.edit # pyright: ignore[reportDeprecated], + rules.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rules.get # pyright: ignore[reportDeprecated], + rules.get, # pyright: ignore[reportDeprecated], ) ) @@ -566,16 +566,16 @@ def __init__(self, rules: AsyncRulesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.list # pyright: ignore[reportDeprecated], + rules.list, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.edit # pyright: ignore[reportDeprecated], + rules.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rules.get # pyright: ignore[reportDeprecated], + rules.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/healthchecks/healthchecks.py b/src/cloudflare/resources/healthchecks/healthchecks.py index 185be0c7b37..0b4d04b4036 100644 --- a/src/cloudflare/resources/healthchecks/healthchecks.py +++ b/src/cloudflare/resources/healthchecks/healthchecks.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .previews import ( PreviewsResource, @@ -72,23 +72,23 @@ def create( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - consecutive_fails: int | NotGiven = NOT_GIVEN, - consecutive_successes: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, - healthcheck_timeout: int | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + consecutive_fails: int | Omit = omit, + consecutive_successes: int | Omit = omit, + description: str | Omit = omit, + http_config: Optional[HTTPConfigurationParam] | Omit = omit, + interval: int | Omit = omit, + retries: int | Omit = omit, + suspended: bool | Omit = omit, + tcp_config: Optional[TCPConfigurationParam] | Omit = omit, + healthcheck_timeout: int | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Create a new health check. @@ -177,23 +177,23 @@ def update( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - consecutive_fails: int | NotGiven = NOT_GIVEN, - consecutive_successes: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, - healthcheck_timeout: int | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + consecutive_fails: int | Omit = omit, + consecutive_successes: int | Omit = omit, + description: str | Omit = omit, + http_config: Optional[HTTPConfigurationParam] | Omit = omit, + interval: int | Omit = omit, + retries: int | Omit = omit, + suspended: bool | Omit = omit, + tcp_config: Optional[TCPConfigurationParam] | Omit = omit, + healthcheck_timeout: int | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Update a configured health check. @@ -283,14 +283,14 @@ def list( self, *, zone_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Healthcheck]: """ List configured health checks. @@ -341,7 +341,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HealthcheckDeleteResponse: """ Delete a health check. @@ -382,23 +382,23 @@ def edit( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - consecutive_fails: int | NotGiven = NOT_GIVEN, - consecutive_successes: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, - healthcheck_timeout: int | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + consecutive_fails: int | Omit = omit, + consecutive_successes: int | Omit = omit, + description: str | Omit = omit, + http_config: Optional[HTTPConfigurationParam] | Omit = omit, + interval: int | Omit = omit, + retries: int | Omit = omit, + suspended: bool | Omit = omit, + tcp_config: Optional[TCPConfigurationParam] | Omit = omit, + healthcheck_timeout: int | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Patch a configured health check. @@ -494,7 +494,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Fetch a single configured health check. @@ -559,23 +559,23 @@ async def create( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - consecutive_fails: int | NotGiven = NOT_GIVEN, - consecutive_successes: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, - healthcheck_timeout: int | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + consecutive_fails: int | Omit = omit, + consecutive_successes: int | Omit = omit, + description: str | Omit = omit, + http_config: Optional[HTTPConfigurationParam] | Omit = omit, + interval: int | Omit = omit, + retries: int | Omit = omit, + suspended: bool | Omit = omit, + tcp_config: Optional[TCPConfigurationParam] | Omit = omit, + healthcheck_timeout: int | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Create a new health check. @@ -664,23 +664,23 @@ async def update( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - consecutive_fails: int | NotGiven = NOT_GIVEN, - consecutive_successes: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, - healthcheck_timeout: int | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + consecutive_fails: int | Omit = omit, + consecutive_successes: int | Omit = omit, + description: str | Omit = omit, + http_config: Optional[HTTPConfigurationParam] | Omit = omit, + interval: int | Omit = omit, + retries: int | Omit = omit, + suspended: bool | Omit = omit, + tcp_config: Optional[TCPConfigurationParam] | Omit = omit, + healthcheck_timeout: int | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Update a configured health check. @@ -770,14 +770,14 @@ def list( self, *, zone_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Healthcheck, AsyncV4PagePaginationArray[Healthcheck]]: """ List configured health checks. @@ -828,7 +828,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HealthcheckDeleteResponse: """ Delete a health check. @@ -869,23 +869,23 @@ async def edit( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - consecutive_fails: int | NotGiven = NOT_GIVEN, - consecutive_successes: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, - healthcheck_timeout: int | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + consecutive_fails: int | Omit = omit, + consecutive_successes: int | Omit = omit, + description: str | Omit = omit, + http_config: Optional[HTTPConfigurationParam] | Omit = omit, + interval: int | Omit = omit, + retries: int | Omit = omit, + suspended: bool | Omit = omit, + tcp_config: Optional[TCPConfigurationParam] | Omit = omit, + healthcheck_timeout: int | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Patch a configured health check. @@ -981,7 +981,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Fetch a single configured health check. diff --git a/src/cloudflare/resources/healthchecks/previews.py b/src/cloudflare/resources/healthchecks/previews.py index 638b38385f0..a5e5c0cb278 100644 --- a/src/cloudflare/resources/healthchecks/previews.py +++ b/src/cloudflare/resources/healthchecks/previews.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,23 +54,23 @@ def create( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - consecutive_fails: int | NotGiven = NOT_GIVEN, - consecutive_successes: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, - healthcheck_timeout: int | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + consecutive_fails: int | Omit = omit, + consecutive_successes: int | Omit = omit, + description: str | Omit = omit, + http_config: Optional[HTTPConfigurationParam] | Omit = omit, + interval: int | Omit = omit, + retries: int | Omit = omit, + suspended: bool | Omit = omit, + tcp_config: Optional[TCPConfigurationParam] | Omit = omit, + healthcheck_timeout: int | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Create a new preview health check. @@ -162,7 +162,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewDeleteResponse: """ Delete a health check. @@ -206,7 +206,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Fetch a single configured health check preview. @@ -267,23 +267,23 @@ async def create( zone_id: str, address: str, name: str, - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - consecutive_fails: int | NotGiven = NOT_GIVEN, - consecutive_successes: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - http_config: Optional[HTTPConfigurationParam] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - tcp_config: Optional[TCPConfigurationParam] | NotGiven = NOT_GIVEN, - healthcheck_timeout: int | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + consecutive_fails: int | Omit = omit, + consecutive_successes: int | Omit = omit, + description: str | Omit = omit, + http_config: Optional[HTTPConfigurationParam] | Omit = omit, + interval: int | Omit = omit, + retries: int | Omit = omit, + suspended: bool | Omit = omit, + tcp_config: Optional[TCPConfigurationParam] | Omit = omit, + healthcheck_timeout: int | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Create a new preview health check. @@ -375,7 +375,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewDeleteResponse: """ Delete a health check. @@ -419,7 +419,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Healthcheck: """ Fetch a single configured health check preview. diff --git a/src/cloudflare/resources/hostnames/settings/tls.py b/src/cloudflare/resources/hostnames/settings/tls.py index 9e6d8d918ee..1444a94a19a 100644 --- a/src/cloudflare/resources/hostnames/settings/tls.py +++ b/src/cloudflare/resources/hostnames/settings/tls.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -61,7 +61,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Setting]: """ Update the tls setting value for the hostname. @@ -113,7 +113,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TLSDeleteResponse]: """ Delete the tls setting value for the hostname. @@ -161,7 +161,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[TLSGetResponse]: """ List the requested TLS setting for the hostnames under this zone. @@ -225,7 +225,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Setting]: """ Update the tls setting value for the hostname. @@ -277,7 +277,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TLSDeleteResponse]: """ Delete the tls setting value for the hostname. @@ -325,7 +325,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TLSGetResponse, AsyncSinglePage[TLSGetResponse]]: """ List the requested TLS setting for the hostnames under this zone. diff --git a/src/cloudflare/resources/hyperdrive/configs.py b/src/cloudflare/resources/hyperdrive/configs.py index ba977432b3c..eaf5bc560ff 100644 --- a/src/cloudflare/resources/hyperdrive/configs.py +++ b/src/cloudflare/resources/hyperdrive/configs.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,14 +51,15 @@ def create( account_id: str, name: str, origin: config_create_params.Origin, - caching: config_create_params.Caching | NotGiven = NOT_GIVEN, - mtls: config_create_params.MTLS | NotGiven = NOT_GIVEN, + caching: config_create_params.Caching | Omit = omit, + mtls: config_create_params.MTLS | Omit = omit, + origin_connection_limit: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hyperdrive: """ Creates and returns a new Hyperdrive configuration. @@ -66,6 +67,9 @@ def create( Args: account_id: Define configurations using a unique string identifier. + origin_connection_limit: The (soft) maximum number of connections the Hyperdrive is allowed to make to + the origin database. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -84,6 +88,7 @@ def create( "origin": origin, "caching": caching, "mtls": mtls, + "origin_connection_limit": origin_connection_limit, }, config_create_params.ConfigCreateParams, ), @@ -104,14 +109,15 @@ def update( account_id: str, name: str, origin: config_update_params.Origin, - caching: config_update_params.Caching | NotGiven = NOT_GIVEN, - mtls: config_update_params.MTLS | NotGiven = NOT_GIVEN, + caching: config_update_params.Caching | Omit = omit, + mtls: config_update_params.MTLS | Omit = omit, + origin_connection_limit: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hyperdrive: """ Updates and returns the specified Hyperdrive configuration. @@ -121,6 +127,9 @@ def update( hyperdrive_id: Define configurations using a unique string identifier. + origin_connection_limit: The (soft) maximum number of connections the Hyperdrive is allowed to make to + the origin database. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -141,6 +150,7 @@ def update( "origin": origin, "caching": caching, "mtls": mtls, + "origin_connection_limit": origin_connection_limit, }, config_update_params.ConfigUpdateParams, ), @@ -163,7 +173,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Hyperdrive]: """ Returns a list of Hyperdrives. @@ -200,7 +210,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes the specified Hyperdrive. @@ -239,16 +249,17 @@ def edit( hyperdrive_id: str, *, account_id: str, - caching: config_edit_params.Caching | NotGiven = NOT_GIVEN, - mtls: config_edit_params.MTLS | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - origin: config_edit_params.Origin | NotGiven = NOT_GIVEN, + caching: config_edit_params.Caching | Omit = omit, + mtls: config_edit_params.MTLS | Omit = omit, + name: str | Omit = omit, + origin: config_edit_params.Origin | Omit = omit, + origin_connection_limit: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hyperdrive: """Patches and returns the specified Hyperdrive configuration. @@ -260,6 +271,9 @@ def edit( hyperdrive_id: Define configurations using a unique string identifier. + origin_connection_limit: The (soft) maximum number of connections the Hyperdrive is allowed to make to + the origin database. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -280,6 +294,7 @@ def edit( "mtls": mtls, "name": name, "origin": origin, + "origin_connection_limit": origin_connection_limit, }, config_edit_params.ConfigEditParams, ), @@ -303,7 +318,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hyperdrive: """ Returns the specified Hyperdrive configuration. @@ -364,14 +379,15 @@ async def create( account_id: str, name: str, origin: config_create_params.Origin, - caching: config_create_params.Caching | NotGiven = NOT_GIVEN, - mtls: config_create_params.MTLS | NotGiven = NOT_GIVEN, + caching: config_create_params.Caching | Omit = omit, + mtls: config_create_params.MTLS | Omit = omit, + origin_connection_limit: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hyperdrive: """ Creates and returns a new Hyperdrive configuration. @@ -379,6 +395,9 @@ async def create( Args: account_id: Define configurations using a unique string identifier. + origin_connection_limit: The (soft) maximum number of connections the Hyperdrive is allowed to make to + the origin database. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -397,6 +416,7 @@ async def create( "origin": origin, "caching": caching, "mtls": mtls, + "origin_connection_limit": origin_connection_limit, }, config_create_params.ConfigCreateParams, ), @@ -417,14 +437,15 @@ async def update( account_id: str, name: str, origin: config_update_params.Origin, - caching: config_update_params.Caching | NotGiven = NOT_GIVEN, - mtls: config_update_params.MTLS | NotGiven = NOT_GIVEN, + caching: config_update_params.Caching | Omit = omit, + mtls: config_update_params.MTLS | Omit = omit, + origin_connection_limit: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hyperdrive: """ Updates and returns the specified Hyperdrive configuration. @@ -434,6 +455,9 @@ async def update( hyperdrive_id: Define configurations using a unique string identifier. + origin_connection_limit: The (soft) maximum number of connections the Hyperdrive is allowed to make to + the origin database. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -454,6 +478,7 @@ async def update( "origin": origin, "caching": caching, "mtls": mtls, + "origin_connection_limit": origin_connection_limit, }, config_update_params.ConfigUpdateParams, ), @@ -476,7 +501,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Hyperdrive, AsyncSinglePage[Hyperdrive]]: """ Returns a list of Hyperdrives. @@ -513,7 +538,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes the specified Hyperdrive. @@ -552,16 +577,17 @@ async def edit( hyperdrive_id: str, *, account_id: str, - caching: config_edit_params.Caching | NotGiven = NOT_GIVEN, - mtls: config_edit_params.MTLS | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - origin: config_edit_params.Origin | NotGiven = NOT_GIVEN, + caching: config_edit_params.Caching | Omit = omit, + mtls: config_edit_params.MTLS | Omit = omit, + name: str | Omit = omit, + origin: config_edit_params.Origin | Omit = omit, + origin_connection_limit: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hyperdrive: """Patches and returns the specified Hyperdrive configuration. @@ -573,6 +599,9 @@ async def edit( hyperdrive_id: Define configurations using a unique string identifier. + origin_connection_limit: The (soft) maximum number of connections the Hyperdrive is allowed to make to + the origin database. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -593,6 +622,7 @@ async def edit( "mtls": mtls, "name": name, "origin": origin, + "origin_connection_limit": origin_connection_limit, }, config_edit_params.ConfigEditParams, ), @@ -616,7 +646,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hyperdrive: """ Returns the specified Hyperdrive configuration. diff --git a/src/cloudflare/resources/iam/permission_groups.py b/src/cloudflare/resources/iam/permission_groups.py index e91be564f38..6a258791602 100644 --- a/src/cloudflare/resources/iam/permission_groups.py +++ b/src/cloudflare/resources/iam/permission_groups.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -47,17 +47,17 @@ def list( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - label: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + label: str | Omit = omit, + name: 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[PermissionGroupListResponse]: """ List all the permissions groups for an account. @@ -117,7 +117,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PermissionGroupGetResponse: """ Get information about a specific permission group in an account. @@ -174,17 +174,17 @@ def list( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - label: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + label: str | Omit = omit, + name: 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PermissionGroupListResponse, AsyncV4PagePaginationArray[PermissionGroupListResponse]]: """ List all the permissions groups for an account. @@ -244,7 +244,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PermissionGroupGetResponse: """ Get information about a specific permission group in an account. diff --git a/src/cloudflare/resources/iam/resource_groups.py b/src/cloudflare/resources/iam/resource_groups.py index b4e45a5b5c1..dad5eef9c7e 100644 --- a/src/cloudflare/resources/iam/resource_groups.py +++ b/src/cloudflare/resources/iam/resource_groups.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -18,7 +18,7 @@ ) from ..._wrappers import ResultWrapper from ...types.iam import resource_group_list_params, resource_group_create_params, resource_group_update_params -from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.iam.resource_group_get_response import ResourceGroupGetResponse from ...types.iam.resource_group_list_response import ResourceGroupListResponse @@ -60,7 +60,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ResourceGroupCreateResponse: """ Create a new Resource Group under the specified account. @@ -102,14 +102,14 @@ def update( resource_group_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - scope: resource_group_update_params.Scope | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ResourceGroupUpdateResponse: """ Modify an existing resource group. @@ -154,17 +154,15 @@ def list( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[ResourceGroupListResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncSinglePage[ResourceGroupListResponse]: """ List all the resource groups for an account. @@ -175,10 +173,6 @@ def list( name: Name of the resource group to be fetched. - page: Page number of paginated results. - - per_page: Maximum number of results per page. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -191,7 +185,7 @@ def list( 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}/iam/resource_groups", - page=SyncV4PagePaginationArray[ResourceGroupListResponse], + page=SyncSinglePage[ResourceGroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -201,8 +195,6 @@ def list( { "id": id, "name": name, - "page": page, - "per_page": per_page, }, resource_group_list_params.ResourceGroupListParams, ), @@ -220,7 +212,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceGroupDeleteResponse]: """ Remove a resource group from an account. @@ -264,7 +256,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ResourceGroupGetResponse: """ Get information about a specific resource group in an account. @@ -326,7 +318,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ResourceGroupCreateResponse: """ Create a new Resource Group under the specified account. @@ -368,14 +360,14 @@ async def update( resource_group_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - scope: resource_group_update_params.Scope | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ResourceGroupUpdateResponse: """ Modify an existing resource group. @@ -420,17 +412,15 @@ def list( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ResourceGroupListResponse, AsyncV4PagePaginationArray[ResourceGroupListResponse]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ResourceGroupListResponse, AsyncSinglePage[ResourceGroupListResponse]]: """ List all the resource groups for an account. @@ -441,10 +431,6 @@ def list( name: Name of the resource group to be fetched. - page: Page number of paginated results. - - per_page: Maximum number of results per page. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -457,7 +443,7 @@ def list( 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}/iam/resource_groups", - page=AsyncV4PagePaginationArray[ResourceGroupListResponse], + page=AsyncSinglePage[ResourceGroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -467,8 +453,6 @@ def list( { "id": id, "name": name, - "page": page, - "per_page": per_page, }, resource_group_list_params.ResourceGroupListParams, ), @@ -486,7 +470,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceGroupDeleteResponse]: """ Remove a resource group from an account. @@ -530,7 +514,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ResourceGroupGetResponse: """ Get information about a specific resource group in an account. diff --git a/src/cloudflare/resources/iam/user_groups/members.py b/src/cloudflare/resources/iam/user_groups/members.py index 2767acd3b45..b7241b5c2c9 100644 --- a/src/cloudflare/resources/iam/user_groups/members.py +++ b/src/cloudflare/resources/iam/user_groups/members.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -59,7 +59,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MemberCreateResponse]: """ Add members to a User Group. @@ -105,7 +105,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[MemberUpdateResponse]: """ Replace the set of members attached to a User Group. @@ -145,14 +145,14 @@ def list( user_group_id: str, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[MemberListResponse]: """ List all the members attached to a user group. @@ -208,7 +208,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MemberDeleteResponse]: """ Remove a member from User Group @@ -278,7 +278,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MemberCreateResponse]: """ Add members to a User Group. @@ -324,7 +324,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[MemberUpdateResponse, AsyncSinglePage[MemberUpdateResponse]]: """ Replace the set of members attached to a User Group. @@ -364,14 +364,14 @@ def list( user_group_id: str, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[MemberListResponse, AsyncV4PagePaginationArray[MemberListResponse]]: """ List all the members attached to a user group. @@ -427,7 +427,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MemberDeleteResponse]: """ Remove a member from User Group diff --git a/src/cloudflare/resources/iam/user_groups/user_groups.py b/src/cloudflare/resources/iam/user_groups/user_groups.py index 3926c47b4e2..d42f7d28b55 100644 --- a/src/cloudflare/resources/iam/user_groups/user_groups.py +++ b/src/cloudflare/resources/iam/user_groups/user_groups.py @@ -14,7 +14,7 @@ MembersResourceWithStreamingResponse, AsyncMembersResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -72,7 +72,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserGroupCreateResponse]: """ Create a new user group under the specified account. @@ -118,14 +118,14 @@ def update( user_group_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - policies: Iterable[user_group_update_params.Policy] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserGroupUpdateResponse]: """ Modify an existing user group. @@ -174,18 +174,18 @@ def list( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - direction: str | NotGiven = NOT_GIVEN, - fuzzy_name: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + direction: str | Omit = omit, + fuzzy_name: str | Omit = omit, + name: 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[UserGroupListResponse]: """ List all the user groups for an account. @@ -249,7 +249,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserGroupDeleteResponse]: """ Remove a user group from an account. @@ -293,7 +293,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserGroupGetResponse]: """ Get information about a specific user group in an account. @@ -363,7 +363,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserGroupCreateResponse]: """ Create a new user group under the specified account. @@ -409,14 +409,14 @@ async def update( user_group_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - policies: Iterable[user_group_update_params.Policy] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserGroupUpdateResponse]: """ Modify an existing user group. @@ -465,18 +465,18 @@ def list( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - direction: str | NotGiven = NOT_GIVEN, - fuzzy_name: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + direction: str | Omit = omit, + fuzzy_name: str | Omit = omit, + name: 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[UserGroupListResponse, AsyncV4PagePaginationArray[UserGroupListResponse]]: """ List all the user groups for an account. @@ -540,7 +540,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserGroupDeleteResponse]: """ Remove a user group from an account. @@ -584,7 +584,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserGroupGetResponse]: """ Get information about a specific user group in an account. diff --git a/src/cloudflare/resources/images/v1/blobs.py b/src/cloudflare/resources/images/v1/blobs.py index 8eb95cd7a1a..31ce1c36469 100644 --- a/src/cloudflare/resources/images/v1/blobs.py +++ b/src/cloudflare/resources/images/v1/blobs.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """Fetch base image. @@ -116,7 +116,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """Fetch base image. diff --git a/src/cloudflare/resources/images/v1/keys.py b/src/cloudflare/resources/images/v1/keys.py index 058413ade7d..e90c7efde18 100644 --- a/src/cloudflare/resources/images/v1/keys.py +++ b/src/cloudflare/resources/images/v1/keys.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -54,7 +54,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> KeyUpdateResponse: """Create a new signing key with specified name. @@ -96,7 +96,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> KeyListResponse: """Lists your signing keys. @@ -137,7 +137,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> KeyDeleteResponse: """Delete signing key with specified name. @@ -202,7 +202,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> KeyUpdateResponse: """Create a new signing key with specified name. @@ -244,7 +244,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> KeyListResponse: """Lists your signing keys. @@ -285,7 +285,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> KeyDeleteResponse: """Delete signing key with specified name. diff --git a/src/cloudflare/resources/images/v1/stats.py b/src/cloudflare/resources/images/v1/stats.py index 544d3ff9188..48a656e33fa 100644 --- a/src/cloudflare/resources/images/v1/stats.py +++ b/src/cloudflare/resources/images/v1/stats.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,10 +51,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Stat: - """ - Fetch usage statistics details for Cloudflare Images. + """Fetch image statistics details for Cloudflare Images. + + The returned statistics + detail storage usage, including the current image count vs this account's + allowance. Args: account_id: Account identifier tag. @@ -111,10 +114,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Stat: - """ - Fetch usage statistics details for Cloudflare Images. + """Fetch image statistics details for Cloudflare Images. + + The returned statistics + detail storage usage, including the current image count vs this account's + allowance. Args: account_id: Account identifier tag. diff --git a/src/cloudflare/resources/images/v1/v1.py b/src/cloudflare/resources/images/v1/v1.py index dda2c2061d3..a1f22cb3caf 100644 --- a/src/cloudflare/resources/images/v1/v1.py +++ b/src/cloudflare/resources/images/v1/v1.py @@ -3,7 +3,7 @@ from __future__ import annotations import typing_extensions -from typing import Any, Type, cast +from typing import Any, Type, Mapping, Optional, cast import httpx @@ -39,8 +39,8 @@ VariantsResourceWithStreamingResponse, AsyncVariantsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform, async_maybe_transform +from ...._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given +from ...._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -100,16 +100,18 @@ def create( self, *, account_id: str, - file: object | NotGiven = NOT_GIVEN, - metadata: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + creator: str | Omit = omit, + file: FileTypes | Omit = omit, + metadata: object | Omit = omit, + require_signed_urls: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Image: """ Upload an image with up to 10 Megabytes using a single HTTP POST @@ -119,6 +121,10 @@ def create( Args: account_id: Account identifier tag. + id: An optional custom unique identifier for your image. + + creator: Can set the creator field with an internal user ID. + file: An image binary data. Only needed when type is uploading a file. metadata: User modifiable key-value store. Can use used for keeping references to another @@ -139,21 +145,25 @@ def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + body = deepcopy_minimal( + { + "id": id, + "creator": creator, + "file": file, + "metadata": metadata, + "require_signed_urls": require_signed_urls, + "url": url, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._post( f"/accounts/{account_id}/images/v1", - body=maybe_transform( - { - "file": file, - "metadata": metadata, - "require_signed_urls": require_signed_urls, - "url": url, - }, - v1_create_params.V1CreateParams, - ), + body=maybe_transform(body, v1_create_params.V1CreateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -169,14 +179,15 @@ def list( self, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + creator: Optional[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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[V1ListResponse]: """List up to 100 images with one request. @@ -186,6 +197,9 @@ def list( Args: account_id: Account identifier tag. + creator: Internal user ID set within the creator field. Setting to empty string "" will + return images where creator field is not set + page: Page number of paginated results. per_page: Number of items per page. @@ -210,6 +224,7 @@ def list( timeout=timeout, query=maybe_transform( { + "creator": creator, "page": page, "per_page": per_page, }, @@ -229,7 +244,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> V1DeleteResponse: """Delete an image on Cloudflare Images. @@ -275,14 +290,15 @@ def edit( image_id: str, *, account_id: str, - metadata: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, + creator: str | Omit = omit, + metadata: object | Omit = omit, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Image: """Update image access control. @@ -294,6 +310,8 @@ def edit( image_id: Image unique identifier. + creator: Can set the creator field with an internal user ID. + metadata: User modifiable key-value store. Can be used for keeping references to another system of record for managing images. No change if not specified. @@ -317,6 +335,7 @@ def edit( f"/accounts/{account_id}/images/v1/{image_id}", body=maybe_transform( { + "creator": creator, "metadata": metadata, "require_signed_urls": require_signed_urls, }, @@ -342,7 +361,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Image: """ Fetch details for a single image. @@ -417,16 +436,18 @@ async def create( self, *, account_id: str, - file: object | NotGiven = NOT_GIVEN, - metadata: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + creator: str | Omit = omit, + file: FileTypes | Omit = omit, + metadata: object | Omit = omit, + require_signed_urls: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Image: """ Upload an image with up to 10 Megabytes using a single HTTP POST @@ -436,6 +457,10 @@ async def create( Args: account_id: Account identifier tag. + id: An optional custom unique identifier for your image. + + creator: Can set the creator field with an internal user ID. + file: An image binary data. Only needed when type is uploading a file. metadata: User modifiable key-value store. Can use used for keeping references to another @@ -456,21 +481,25 @@ async def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + body = deepcopy_minimal( + { + "id": id, + "creator": creator, + "file": file, + "metadata": metadata, + "require_signed_urls": require_signed_urls, + "url": url, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._post( f"/accounts/{account_id}/images/v1", - body=await async_maybe_transform( - { - "file": file, - "metadata": metadata, - "require_signed_urls": require_signed_urls, - "url": url, - }, - v1_create_params.V1CreateParams, - ), + body=await async_maybe_transform(body, v1_create_params.V1CreateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -486,14 +515,15 @@ def list( self, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + creator: Optional[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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[V1ListResponse, AsyncV4PagePagination[V1ListResponse]]: """List up to 100 images with one request. @@ -503,6 +533,9 @@ def list( Args: account_id: Account identifier tag. + creator: Internal user ID set within the creator field. Setting to empty string "" will + return images where creator field is not set + page: Page number of paginated results. per_page: Number of items per page. @@ -527,6 +560,7 @@ def list( timeout=timeout, query=maybe_transform( { + "creator": creator, "page": page, "per_page": per_page, }, @@ -546,7 +580,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> V1DeleteResponse: """Delete an image on Cloudflare Images. @@ -592,14 +626,15 @@ async def edit( image_id: str, *, account_id: str, - metadata: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, + creator: str | Omit = omit, + metadata: object | Omit = omit, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Image: """Update image access control. @@ -611,6 +646,8 @@ async def edit( image_id: Image unique identifier. + creator: Can set the creator field with an internal user ID. + metadata: User modifiable key-value store. Can be used for keeping references to another system of record for managing images. No change if not specified. @@ -634,6 +671,7 @@ async def edit( f"/accounts/{account_id}/images/v1/{image_id}", body=await async_maybe_transform( { + "creator": creator, "metadata": metadata, "require_signed_urls": require_signed_urls, }, @@ -659,7 +697,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Image: """ Fetch details for a single image. @@ -703,7 +741,7 @@ def __init__(self, v1: V1Resource) -> None: ) self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - v1.list # pyright: ignore[reportDeprecated], + v1.list, # pyright: ignore[reportDeprecated], ) ) self.delete = to_raw_response_wrapper( @@ -742,7 +780,7 @@ def __init__(self, v1: AsyncV1Resource) -> None: ) self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - v1.list # pyright: ignore[reportDeprecated], + v1.list, # pyright: ignore[reportDeprecated], ) ) self.delete = async_to_raw_response_wrapper( @@ -781,7 +819,7 @@ def __init__(self, v1: V1Resource) -> None: ) self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - v1.list # pyright: ignore[reportDeprecated], + v1.list, # pyright: ignore[reportDeprecated], ) ) self.delete = to_streamed_response_wrapper( @@ -820,7 +858,7 @@ def __init__(self, v1: AsyncV1Resource) -> None: ) self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - v1.list # pyright: ignore[reportDeprecated], + v1.list, # pyright: ignore[reportDeprecated], ) ) self.delete = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/images/v1/variants.py b/src/cloudflare/resources/images/v1/variants.py index 703f81f3b6a..b681a359f93 100644 --- a/src/cloudflare/resources/images/v1/variants.py +++ b/src/cloudflare/resources/images/v1/variants.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,13 +54,13 @@ def create( account_id: str, id: str, options: variant_create_params.Options, - never_require_signed_urls: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VariantCreateResponse: """ Specify variants that allow you to resize images for different use cases. @@ -112,7 +112,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Variant: """ Lists existing variants. @@ -152,7 +152,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VariantDeleteResponse: """ Deleting a variant purges the cache for all images associated with the variant. @@ -195,13 +195,13 @@ def edit( *, account_id: str, options: variant_edit_params.Options, - never_require_signed_urls: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VariantEditResponse: """ Updating a variant purges the cache for all images associated with the variant. @@ -255,7 +255,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VariantGetResponse: """ Fetch details for a single variant. @@ -314,13 +314,13 @@ async def create( account_id: str, id: str, options: variant_create_params.Options, - never_require_signed_urls: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VariantCreateResponse: """ Specify variants that allow you to resize images for different use cases. @@ -372,7 +372,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Variant: """ Lists existing variants. @@ -412,7 +412,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VariantDeleteResponse: """ Deleting a variant purges the cache for all images associated with the variant. @@ -455,13 +455,13 @@ async def edit( *, account_id: str, options: variant_edit_params.Options, - never_require_signed_urls: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VariantEditResponse: """ Updating a variant purges the cache for all images associated with the variant. @@ -515,7 +515,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VariantGetResponse: """ Fetch details for a single variant. diff --git a/src/cloudflare/resources/images/v2/direct_uploads.py b/src/cloudflare/resources/images/v2/direct_uploads.py index cd30c813f89..0ad7b440335 100644 --- a/src/cloudflare/resources/images/v2/direct_uploads.py +++ b/src/cloudflare/resources/images/v2/direct_uploads.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,16 +49,17 @@ def create( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - expiry: Union[str, datetime] | NotGiven = NOT_GIVEN, - metadata: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + creator: str | Omit = omit, + expiry: Union[str, datetime] | Omit = omit, + metadata: object | Omit = omit, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DirectUploadCreateResponse: """Direct uploads allow users to upload images without API keys. @@ -77,6 +78,8 @@ def create( and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID. + creator: Can set the creator field with an internal user ID. + expiry: The date after which the upload will not be accepted. Minimum: Now + 2 minutes. Maximum: Now + 6 hours. @@ -104,6 +107,7 @@ def create( body=maybe_transform( { "id": id, + "creator": creator, "expiry": expiry, "metadata": metadata, "require_signed_urls": require_signed_urls, @@ -145,16 +149,17 @@ async def create( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - expiry: Union[str, datetime] | NotGiven = NOT_GIVEN, - metadata: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + creator: str | Omit = omit, + expiry: Union[str, datetime] | Omit = omit, + metadata: object | Omit = omit, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DirectUploadCreateResponse: """Direct uploads allow users to upload images without API keys. @@ -173,6 +178,8 @@ async def create( and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID. + creator: Can set the creator field with an internal user ID. + expiry: The date after which the upload will not be accepted. Minimum: Now + 2 minutes. Maximum: Now + 6 hours. @@ -200,6 +207,7 @@ async def create( body=await async_maybe_transform( { "id": id, + "creator": creator, "expiry": expiry, "metadata": metadata, "require_signed_urls": require_signed_urls, diff --git a/src/cloudflare/resources/images/v2/v2.py b/src/cloudflare/resources/images/v2/v2.py index 0e821133e77..5a8bb399a6b 100644 --- a/src/cloudflare/resources/images/v2/v2.py +++ b/src/cloudflare/resources/images/v2/v2.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -61,15 +61,16 @@ def list( self, *, account_id: str, - continuation_token: Optional[str] | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + continuation_token: Optional[str] | Omit = omit, + creator: Optional[str] | Omit = omit, + per_page: float | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> V2ListResponse: """List up to 10000 images with one request. @@ -82,6 +83,9 @@ def list( continuation_token: Continuation token for a next page. List images V2 returns continuation_token + creator: Internal user ID set within the creator field. Setting to empty string "" will + return images where creator field is not set + per_page: Number of items per page. sort_order: Sorting order by upload time. @@ -106,6 +110,7 @@ def list( query=maybe_transform( { "continuation_token": continuation_token, + "creator": creator, "per_page": per_page, "sort_order": sort_order, }, @@ -145,15 +150,16 @@ async def list( self, *, account_id: str, - continuation_token: Optional[str] | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + continuation_token: Optional[str] | Omit = omit, + creator: Optional[str] | Omit = omit, + per_page: float | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> V2ListResponse: """List up to 10000 images with one request. @@ -166,6 +172,9 @@ async def list( continuation_token: Continuation token for a next page. List images V2 returns continuation_token + creator: Internal user ID set within the creator field. Setting to empty string "" will + return images where creator field is not set + per_page: Number of items per page. sort_order: Sorting order by upload time. @@ -190,6 +199,7 @@ async def list( query=await async_maybe_transform( { "continuation_token": continuation_token, + "creator": creator, "per_page": per_page, "sort_order": sort_order, }, diff --git a/src/cloudflare/resources/intel/asn/asn.py b/src/cloudflare/resources/intel/asn/asn.py index bdc8ea750d9..7cd66848da8 100644 --- a/src/cloudflare/resources/intel/asn/asn.py +++ b/src/cloudflare/resources/intel/asn/asn.py @@ -14,7 +14,7 @@ SubnetsResourceWithStreamingResponse, AsyncSubnetsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -64,7 +64,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ASN]: """ Gets an overview of the Autonomous System Number (ASN) and a list of subnets for @@ -130,7 +130,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ASN]: """ Gets an overview of the Autonomous System Number (ASN) and a list of subnets for diff --git a/src/cloudflare/resources/intel/asn/subnets.py b/src/cloudflare/resources/intel/asn/subnets.py index 1968d64fe03..e1643a47223 100644 --- a/src/cloudflare/resources/intel/asn/subnets.py +++ b/src/cloudflare/resources/intel/asn/subnets.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -50,7 +50,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubnetGetResponse: """ Get ASN Subnets. @@ -107,7 +107,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubnetGetResponse: """ Get ASN Subnets. 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 bd438c13cee..cdc13e05fb0 100644 --- a/src/cloudflare/resources/intel/attack_surface_report/issue_types.py +++ b/src/cloudflare/resources/intel/attack_surface_report/issue_types.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -49,7 +49,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[IssueTypeGetResponse]: """ Get Security Center Issues Types @@ -106,7 +106,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[IssueTypeGetResponse, AsyncSinglePage[IssueTypeGetResponse]]: """ Get Security Center Issues Types diff --git a/src/cloudflare/resources/intel/attack_surface_report/issues.py b/src/cloudflare/resources/intel/attack_surface_report/issues.py index b1054cd0427..4f79f5de148 100644 --- a/src/cloudflare/resources/intel/attack_surface_report/issues.py +++ b/src/cloudflare/resources/intel/attack_surface_report/issues.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -63,25 +63,25 @@ def list( self, *, account_id: str, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + dismissed: bool | Omit = omit, + issue_class: SequenceNotStr[str] | Omit = omit, + issue_class_neq: SequenceNotStr[str] | Omit = omit, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[Optional[IssueListResponse]]: """ Get Security Center Issues @@ -138,23 +138,23 @@ def class_( self, *, account_id: str, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + dismissed: bool | Omit = omit, + issue_class: SequenceNotStr[str] | Omit = omit, + issue_class_neq: SequenceNotStr[str] | Omit = omit, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IssueClassResponse]: """ Get Security Center Issue Counts by Class @@ -206,13 +206,13 @@ def dismiss( issue_id: str, *, account_id: str, - dismiss: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IssueDismissResponse: """ Archive Security Center Insight @@ -246,23 +246,23 @@ def severity( self, *, account_id: str, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + dismissed: bool | Omit = omit, + issue_class: SequenceNotStr[str] | Omit = omit, + issue_class_neq: SequenceNotStr[str] | Omit = omit, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IssueSeverityResponse]: """ Get Security Center Issue Counts by Severity @@ -313,23 +313,23 @@ def type( self, *, account_id: str, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + dismissed: bool | Omit = omit, + issue_class: SequenceNotStr[str] | Omit = omit, + issue_class_neq: SequenceNotStr[str] | Omit = omit, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IssueTypeResponse]: """ Get Security Center Issue Counts by Type @@ -401,25 +401,25 @@ def list( self, *, account_id: str, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + dismissed: bool | Omit = omit, + issue_class: SequenceNotStr[str] | Omit = omit, + issue_class_neq: SequenceNotStr[str] | Omit = omit, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[IssueListResponse], AsyncV4PagePagination[Optional[IssueListResponse]]]: """ Get Security Center Issues @@ -476,23 +476,23 @@ async def class_( self, *, account_id: str, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + dismissed: bool | Omit = omit, + issue_class: SequenceNotStr[str] | Omit = omit, + issue_class_neq: SequenceNotStr[str] | Omit = omit, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IssueClassResponse]: """ Get Security Center Issue Counts by Class @@ -544,13 +544,13 @@ async def dismiss( issue_id: str, *, account_id: str, - dismiss: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IssueDismissResponse: """ Archive Security Center Insight @@ -584,23 +584,23 @@ async def severity( self, *, account_id: str, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + dismissed: bool | Omit = omit, + issue_class: SequenceNotStr[str] | Omit = omit, + issue_class_neq: SequenceNotStr[str] | Omit = omit, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IssueSeverityResponse]: """ Get Security Center Issue Counts by Severity @@ -651,23 +651,23 @@ async def type( self, *, account_id: str, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + dismissed: bool | Omit = omit, + issue_class: SequenceNotStr[str] | Omit = omit, + issue_class_neq: SequenceNotStr[str] | Omit = omit, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IssueTypeResponse]: """ Get Security Center Issue Counts by Type @@ -720,27 +720,27 @@ def __init__(self, issues: IssuesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - issues.list # pyright: ignore[reportDeprecated], + issues.list, # pyright: ignore[reportDeprecated], ) ) self.class_ = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - issues.class_ # pyright: ignore[reportDeprecated], + issues.class_, # pyright: ignore[reportDeprecated], ) ) self.dismiss = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - issues.dismiss # pyright: ignore[reportDeprecated], + issues.dismiss, # pyright: ignore[reportDeprecated], ) ) self.severity = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - issues.severity # pyright: ignore[reportDeprecated], + issues.severity, # pyright: ignore[reportDeprecated], ) ) self.type = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - issues.type # pyright: ignore[reportDeprecated], + issues.type, # pyright: ignore[reportDeprecated], ) ) @@ -751,27 +751,27 @@ def __init__(self, issues: AsyncIssuesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - issues.list # pyright: ignore[reportDeprecated], + issues.list, # pyright: ignore[reportDeprecated], ) ) self.class_ = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - issues.class_ # pyright: ignore[reportDeprecated], + issues.class_, # pyright: ignore[reportDeprecated], ) ) self.dismiss = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - issues.dismiss # pyright: ignore[reportDeprecated], + issues.dismiss, # pyright: ignore[reportDeprecated], ) ) self.severity = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - issues.severity # pyright: ignore[reportDeprecated], + issues.severity, # pyright: ignore[reportDeprecated], ) ) self.type = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - issues.type # pyright: ignore[reportDeprecated], + issues.type, # pyright: ignore[reportDeprecated], ) ) @@ -782,27 +782,27 @@ def __init__(self, issues: IssuesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - issues.list # pyright: ignore[reportDeprecated], + issues.list, # pyright: ignore[reportDeprecated], ) ) self.class_ = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - issues.class_ # pyright: ignore[reportDeprecated], + issues.class_, # pyright: ignore[reportDeprecated], ) ) self.dismiss = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - issues.dismiss # pyright: ignore[reportDeprecated], + issues.dismiss, # pyright: ignore[reportDeprecated], ) ) self.severity = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - issues.severity # pyright: ignore[reportDeprecated], + issues.severity, # pyright: ignore[reportDeprecated], ) ) self.type = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - issues.type # pyright: ignore[reportDeprecated], + issues.type, # pyright: ignore[reportDeprecated], ) ) @@ -813,26 +813,26 @@ def __init__(self, issues: AsyncIssuesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - issues.list # pyright: ignore[reportDeprecated], + issues.list, # pyright: ignore[reportDeprecated], ) ) self.class_ = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - issues.class_ # pyright: ignore[reportDeprecated], + issues.class_, # pyright: ignore[reportDeprecated], ) ) self.dismiss = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - issues.dismiss # pyright: ignore[reportDeprecated], + issues.dismiss, # pyright: ignore[reportDeprecated], ) ) self.severity = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - issues.severity # pyright: ignore[reportDeprecated], + issues.severity, # pyright: ignore[reportDeprecated], ) ) self.type = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - issues.type # pyright: ignore[reportDeprecated], + issues.type, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/intel/dns.py b/src/cloudflare/resources/intel/dns.py index 066483df77b..9ce121c3c4d 100644 --- a/src/cloudflare/resources/intel/dns.py +++ b/src/cloudflare/resources/intel/dns.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,16 +48,16 @@ def list( self, *, account_id: str, - ipv4: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - start_end_params: dns_list_params.StartEndParams | NotGiven = NOT_GIVEN, + ipv4: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + start_end_params: dns_list_params.StartEndParams | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[Optional[DNS]]: """ Gets a list of all the domains that have resolved to a specific IP address. @@ -125,16 +125,16 @@ def list( self, *, account_id: str, - ipv4: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - start_end_params: dns_list_params.StartEndParams | NotGiven = NOT_GIVEN, + ipv4: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + start_end_params: dns_list_params.StartEndParams | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[DNS], AsyncV4PagePagination[Optional[DNS]]]: """ Gets a list of all the domains that have resolved to a specific IP address. diff --git a/src/cloudflare/resources/intel/domain_history.py b/src/cloudflare/resources/intel/domain_history.py index 702b6346ea5..7822bba7881 100644 --- a/src/cloudflare/resources/intel/domain_history.py +++ b/src/cloudflare/resources/intel/domain_history.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,13 +48,13 @@ def get( self, *, account_id: str, - domain: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DomainHistoryGetResponse]: """ Gets historical security threat and content categories currently and previously @@ -111,13 +111,13 @@ async def get( self, *, account_id: str, - domain: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DomainHistoryGetResponse]: """ Gets historical security threat and content categories currently and previously diff --git a/src/cloudflare/resources/intel/domains/bulks.py b/src/cloudflare/resources/intel/domains/bulks.py index c0c7214b6f3..009c7e1ee66 100644 --- a/src/cloudflare/resources/intel/domains/bulks.py +++ b/src/cloudflare/resources/intel/domains/bulks.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,13 +48,13 @@ def get( self, *, account_id: str, - domain: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BulkGetResponse]: """ Same as summary. @@ -112,13 +112,13 @@ async def get( self, *, account_id: str, - domain: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BulkGetResponse]: """ Same as summary. diff --git a/src/cloudflare/resources/intel/domains/domains.py b/src/cloudflare/resources/intel/domains/domains.py index 70c5cd628ef..9856f1af26b 100644 --- a/src/cloudflare/resources/intel/domains/domains.py +++ b/src/cloudflare/resources/intel/domains/domains.py @@ -14,7 +14,7 @@ BulksResourceWithStreamingResponse, AsyncBulksResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -60,13 +60,13 @@ def get( self, *, account_id: str, - domain: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Domain]: """ Gets security details and statistics about a domain. @@ -126,13 +126,13 @@ async def get( self, *, account_id: str, - domain: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Domain]: """ Gets security details and statistics about a domain. diff --git a/src/cloudflare/resources/intel/indicator_feeds/__init__.py b/src/cloudflare/resources/intel/indicator_feeds/__init__.py index edfb059c6c1..3e67dcae5bc 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/__init__.py +++ b/src/cloudflare/resources/intel/indicator_feeds/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .downloads import ( - DownloadsResource, - AsyncDownloadsResource, - DownloadsResourceWithRawResponse, - AsyncDownloadsResourceWithRawResponse, - DownloadsResourceWithStreamingResponse, - AsyncDownloadsResourceWithStreamingResponse, -) from .snapshots import ( SnapshotsResource, AsyncSnapshotsResource, @@ -46,12 +38,6 @@ "AsyncPermissionsResourceWithRawResponse", "PermissionsResourceWithStreamingResponse", "AsyncPermissionsResourceWithStreamingResponse", - "DownloadsResource", - "AsyncDownloadsResource", - "DownloadsResourceWithRawResponse", - "AsyncDownloadsResourceWithRawResponse", - "DownloadsResourceWithStreamingResponse", - "AsyncDownloadsResourceWithStreamingResponse", "IndicatorFeedsResource", "AsyncIndicatorFeedsResource", "IndicatorFeedsResourceWithRawResponse", diff --git a/src/cloudflare/resources/intel/indicator_feeds/downloads.py b/src/cloudflare/resources/intel/indicator_feeds/downloads.py deleted file mode 100644 index 404782b0df3..00000000000 --- a/src/cloudflare/resources/intel/indicator_feeds/downloads.py +++ /dev/null @@ -1,184 +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 NOT_GIVEN, Body, Query, Headers, NotGiven -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.intel.indicator_feeds.download_get_response import DownloadGetResponse - -__all__ = ["DownloadsResource", "AsyncDownloadsResource"] - - -class DownloadsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> DownloadsResourceWithRawResponse: - """ - 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 DownloadsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> DownloadsResourceWithStreamingResponse: - """ - 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 DownloadsResourceWithStreamingResponse(self) - - def get( - self, - feed_id: int, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[DownloadGetResponse]: - """ - Download indicator feed data - - Args: - account_id: Identifier - - feed_id: Indicator feed ID - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return self._get( - f"/accounts/{account_id}/intel/indicator_feeds/{feed_id}/download", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[DownloadGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[DownloadGetResponse]], ResultWrapper[DownloadGetResponse]), - ) - - -class AsyncDownloadsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncDownloadsResourceWithRawResponse: - """ - 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 AsyncDownloadsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncDownloadsResourceWithStreamingResponse: - """ - 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 AsyncDownloadsResourceWithStreamingResponse(self) - - async def get( - self, - feed_id: int, - *, - account_id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[DownloadGetResponse]: - """ - Download indicator feed data - - Args: - account_id: Identifier - - feed_id: Indicator feed ID - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return await self._get( - f"/accounts/{account_id}/intel/indicator_feeds/{feed_id}/download", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[DownloadGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[DownloadGetResponse]], ResultWrapper[DownloadGetResponse]), - ) - - -class DownloadsResourceWithRawResponse: - def __init__(self, downloads: DownloadsResource) -> None: - self._downloads = downloads - - self.get = to_raw_response_wrapper( - downloads.get, - ) - - -class AsyncDownloadsResourceWithRawResponse: - def __init__(self, downloads: AsyncDownloadsResource) -> None: - self._downloads = downloads - - self.get = async_to_raw_response_wrapper( - downloads.get, - ) - - -class DownloadsResourceWithStreamingResponse: - def __init__(self, downloads: DownloadsResource) -> None: - self._downloads = downloads - - self.get = to_streamed_response_wrapper( - downloads.get, - ) - - -class AsyncDownloadsResourceWithStreamingResponse: - def __init__(self, downloads: AsyncDownloadsResource) -> None: - self._downloads = downloads - - self.get = async_to_streamed_response_wrapper( - downloads.get, - ) diff --git a/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py b/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py index d161a70f4c2..4123cc30790 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py +++ b/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py @@ -6,16 +6,8 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform -from .downloads import ( - DownloadsResource, - AsyncDownloadsResource, - DownloadsResourceWithRawResponse, - AsyncDownloadsResourceWithRawResponse, - DownloadsResourceWithStreamingResponse, - AsyncDownloadsResourceWithStreamingResponse, -) from .snapshots import ( SnapshotsResource, AsyncSnapshotsResource, @@ -61,10 +53,6 @@ def snapshots(self) -> SnapshotsResource: def permissions(self) -> PermissionsResource: return PermissionsResource(self._client) - @cached_property - def downloads(self) -> DownloadsResource: - return DownloadsResource(self._client) - @cached_property def with_raw_response(self) -> IndicatorFeedsResourceWithRawResponse: """ @@ -88,14 +76,14 @@ def create( self, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedCreateResponse]: """ Create new indicator feed @@ -141,17 +129,17 @@ def update( feed_id: int, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, - is_attributable: bool | NotGiven = NOT_GIVEN, - is_downloadable: bool | NotGiven = NOT_GIVEN, - is_public: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + is_attributable: bool | Omit = omit, + is_downloadable: bool | Omit = omit, + is_public: bool | 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedUpdateResponse]: """ Update indicator feed metadata @@ -212,7 +200,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[IndicatorFeedListResponse]: """ Get indicator feeds owned by this account @@ -249,7 +237,7 @@ def data( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Get indicator feed data @@ -288,7 +276,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedGetResponse]: """ Get indicator feed metadata @@ -330,10 +318,6 @@ def snapshots(self) -> AsyncSnapshotsResource: def permissions(self) -> AsyncPermissionsResource: return AsyncPermissionsResource(self._client) - @cached_property - def downloads(self) -> AsyncDownloadsResource: - return AsyncDownloadsResource(self._client) - @cached_property def with_raw_response(self) -> AsyncIndicatorFeedsResourceWithRawResponse: """ @@ -357,14 +341,14 @@ async def create( self, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedCreateResponse]: """ Create new indicator feed @@ -410,17 +394,17 @@ async def update( feed_id: int, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, - is_attributable: bool | NotGiven = NOT_GIVEN, - is_downloadable: bool | NotGiven = NOT_GIVEN, - is_public: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + is_attributable: bool | Omit = omit, + is_downloadable: bool | Omit = omit, + is_public: bool | 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedUpdateResponse]: """ Update indicator feed metadata @@ -481,7 +465,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[IndicatorFeedListResponse, AsyncSinglePage[IndicatorFeedListResponse]]: """ Get indicator feeds owned by this account @@ -518,7 +502,7 @@ async def data( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Get indicator feed data @@ -557,7 +541,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedGetResponse]: """ Get indicator feed metadata @@ -618,10 +602,6 @@ def snapshots(self) -> SnapshotsResourceWithRawResponse: def permissions(self) -> PermissionsResourceWithRawResponse: return PermissionsResourceWithRawResponse(self._indicator_feeds.permissions) - @cached_property - def downloads(self) -> DownloadsResourceWithRawResponse: - return DownloadsResourceWithRawResponse(self._indicator_feeds.downloads) - class AsyncIndicatorFeedsResourceWithRawResponse: def __init__(self, indicator_feeds: AsyncIndicatorFeedsResource) -> None: @@ -651,10 +631,6 @@ def snapshots(self) -> AsyncSnapshotsResourceWithRawResponse: def permissions(self) -> AsyncPermissionsResourceWithRawResponse: return AsyncPermissionsResourceWithRawResponse(self._indicator_feeds.permissions) - @cached_property - def downloads(self) -> AsyncDownloadsResourceWithRawResponse: - return AsyncDownloadsResourceWithRawResponse(self._indicator_feeds.downloads) - class IndicatorFeedsResourceWithStreamingResponse: def __init__(self, indicator_feeds: IndicatorFeedsResource) -> None: @@ -684,10 +660,6 @@ def snapshots(self) -> SnapshotsResourceWithStreamingResponse: def permissions(self) -> PermissionsResourceWithStreamingResponse: return PermissionsResourceWithStreamingResponse(self._indicator_feeds.permissions) - @cached_property - def downloads(self) -> DownloadsResourceWithStreamingResponse: - return DownloadsResourceWithStreamingResponse(self._indicator_feeds.downloads) - class AsyncIndicatorFeedsResourceWithStreamingResponse: def __init__(self, indicator_feeds: AsyncIndicatorFeedsResource) -> None: @@ -716,7 +688,3 @@ def snapshots(self) -> AsyncSnapshotsResourceWithStreamingResponse: @cached_property def permissions(self) -> AsyncPermissionsResourceWithStreamingResponse: return AsyncPermissionsResourceWithStreamingResponse(self._indicator_feeds.permissions) - - @cached_property - def downloads(self) -> AsyncDownloadsResourceWithStreamingResponse: - return AsyncDownloadsResourceWithStreamingResponse(self._indicator_feeds.downloads) diff --git a/src/cloudflare/resources/intel/indicator_feeds/permissions.py b/src/cloudflare/resources/intel/indicator_feeds/permissions.py index 3fc452584aa..fc98e15a3a9 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/permissions.py +++ b/src/cloudflare/resources/intel/indicator_feeds/permissions.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,14 +50,14 @@ def create( self, *, account_id: str, - account_tag: str | NotGiven = NOT_GIVEN, - feed_id: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionCreateResponse]: """ Grant permission to indicator feed @@ -107,7 +107,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionListResponse]: """ List indicator feed permissions @@ -141,14 +141,14 @@ def delete( self, *, account_id: str, - account_tag: str | NotGiven = NOT_GIVEN, - feed_id: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionDeleteResponse]: """ Revoke permission to indicator feed @@ -214,14 +214,14 @@ async def create( self, *, account_id: str, - account_tag: str | NotGiven = NOT_GIVEN, - feed_id: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionCreateResponse]: """ Grant permission to indicator feed @@ -271,7 +271,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionListResponse]: """ List indicator feed permissions @@ -305,14 +305,14 @@ async def delete( self, *, account_id: str, - account_tag: str | NotGiven = NOT_GIVEN, - feed_id: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionDeleteResponse]: """ Revoke permission to indicator feed diff --git a/src/cloudflare/resources/intel/indicator_feeds/snapshots.py b/src/cloudflare/resources/intel/indicator_feeds/snapshots.py index c9b1f526564..0dc19ac33f9 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/snapshots.py +++ b/src/cloudflare/resources/intel/indicator_feeds/snapshots.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,13 +49,13 @@ def update( feed_id: int, *, account_id: str, - source: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SnapshotUpdateResponse]: """ Update indicator feed data @@ -120,13 +120,13 @@ async def update( feed_id: int, *, account_id: str, - source: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SnapshotUpdateResponse]: """ Update indicator feed data diff --git a/src/cloudflare/resources/intel/ip_lists.py b/src/cloudflare/resources/intel/ip_lists.py index 0cda3744ca4..342f5e2e11b 100644 --- a/src/cloudflare/resources/intel/ip_lists.py +++ b/src/cloudflare/resources/intel/ip_lists.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -49,7 +49,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[IPList]: """ Get IP Lists. @@ -106,7 +106,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[IPList, AsyncSinglePage[IPList]]: """ Get IP Lists. diff --git a/src/cloudflare/resources/intel/ips.py b/src/cloudflare/resources/intel/ips.py index b23a3e39c8a..4ac92b3f687 100644 --- a/src/cloudflare/resources/intel/ips.py +++ b/src/cloudflare/resources/intel/ips.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,14 +48,14 @@ def get( self, *, account_id: str, - ipv4: str | NotGiven = NOT_GIVEN, - ipv6: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IPGetResponse]: """ Gets the geolocation, ASN, infrastructure type of the ASN, and any security @@ -119,14 +119,14 @@ async def get( self, *, account_id: str, - ipv4: str | NotGiven = NOT_GIVEN, - ipv6: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IPGetResponse]: """ Gets the geolocation, ASN, infrastructure type of the ASN, and any security diff --git a/src/cloudflare/resources/intel/miscategorizations.py b/src/cloudflare/resources/intel/miscategorizations.py index f7ea8454497..c4590330302 100644 --- a/src/cloudflare/resources/intel/miscategorizations.py +++ b/src/cloudflare/resources/intel/miscategorizations.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,19 +48,19 @@ def create( self, *, account_id: str, - content_adds: Iterable[int] | NotGiven = NOT_GIVEN, - content_removes: Iterable[int] | NotGiven = NOT_GIVEN, - indicator_type: Literal["domain", "ipv4", "ipv6", "url"] | NotGiven = NOT_GIVEN, - ip: Optional[str] | NotGiven = NOT_GIVEN, - security_adds: Iterable[int] | NotGiven = NOT_GIVEN, - security_removes: Iterable[int] | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, + content_adds: Iterable[int] | Omit = omit, + content_removes: Iterable[int] | Omit = omit, + indicator_type: Literal["domain", "ipv4", "ipv6", "url"] | Omit = omit, + ip: Optional[str] | Omit = omit, + security_adds: Iterable[int] | Omit = omit, + security_removes: Iterable[int] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MiscategorizationCreateResponse: """ Allows you to submit requests to change a domain’s category. @@ -137,19 +137,19 @@ async def create( self, *, account_id: str, - content_adds: Iterable[int] | NotGiven = NOT_GIVEN, - content_removes: Iterable[int] | NotGiven = NOT_GIVEN, - indicator_type: Literal["domain", "ipv4", "ipv6", "url"] | NotGiven = NOT_GIVEN, - ip: Optional[str] | NotGiven = NOT_GIVEN, - security_adds: Iterable[int] | NotGiven = NOT_GIVEN, - security_removes: Iterable[int] | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, + content_adds: Iterable[int] | Omit = omit, + content_removes: Iterable[int] | Omit = omit, + indicator_type: Literal["domain", "ipv4", "ipv6", "url"] | Omit = omit, + ip: Optional[str] | Omit = omit, + security_adds: Iterable[int] | Omit = omit, + security_removes: Iterable[int] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MiscategorizationCreateResponse: """ Allows you to submit requests to change a domain’s category. diff --git a/src/cloudflare/resources/intel/sinkholes.py b/src/cloudflare/resources/intel/sinkholes.py index eed9502dec3..e9cce87bbd0 100644 --- a/src/cloudflare/resources/intel/sinkholes.py +++ b/src/cloudflare/resources/intel/sinkholes.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -49,7 +49,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Sinkhole]: """ List sinkholes owned by this account @@ -106,7 +106,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Sinkhole, AsyncSinglePage[Sinkhole]]: """ List sinkholes owned by this account diff --git a/src/cloudflare/resources/intel/whois.py b/src/cloudflare/resources/intel/whois.py index 64bd8a2ce62..852e7142c0d 100644 --- a/src/cloudflare/resources/intel/whois.py +++ b/src/cloudflare/resources/intel/whois.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,13 +48,13 @@ def get( self, *, account_id: str, - domain: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[WhoisGetResponse]: """ Get WHOIS Record @@ -110,13 +110,13 @@ async def get( self, *, account_id: str, - domain: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[WhoisGetResponse]: """ Get WHOIS Record diff --git a/src/cloudflare/resources/ips.py b/src/cloudflare/resources/ips.py index e26445bb767..29d43e4eaa5 100644 --- a/src/cloudflare/resources/ips.py +++ b/src/cloudflare/resources/ips.py @@ -6,7 +6,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -47,13 +47,13 @@ def with_streaming_response(self) -> IPsResourceWithStreamingResponse: def list( self, *, - networks: str | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IPListResponse]: """ Get IPs used on the Cloudflare/JD Cloud network, see @@ -114,13 +114,13 @@ def with_streaming_response(self) -> AsyncIPsResourceWithStreamingResponse: async def list( self, *, - networks: str | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IPListResponse]: """ Get IPs used on the Cloudflare/JD Cloud network, see diff --git a/src/cloudflare/resources/keyless_certificates.py b/src/cloudflare/resources/keyless_certificates.py index 6988a12aad0..e7406b9ad41 100644 --- a/src/cloudflare/resources/keyless_certificates.py +++ b/src/cloudflare/resources/keyless_certificates.py @@ -6,7 +6,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,15 +56,15 @@ def create( certificate: str, host: str, port: float, - bundle_method: BundleMethod | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - tunnel: TunnelParam | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificate]: """ Create Keyless SSL Configuration @@ -130,7 +130,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[KeylessCertificate]: """ List all Keyless SSL configurations for a given zone. @@ -167,7 +167,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificateDeleteResponse]: """ Delete Keyless SSL Configuration @@ -210,17 +210,17 @@ def edit( keyless_certificate_id: str, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, - host: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - port: float | NotGiven = NOT_GIVEN, - tunnel: TunnelParam | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificate]: """This will update attributes of a Keyless SSL. @@ -289,7 +289,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificate]: """ Get details for one Keyless SSL configuration. @@ -353,15 +353,15 @@ async def create( certificate: str, host: str, port: float, - bundle_method: BundleMethod | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - tunnel: TunnelParam | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificate]: """ Create Keyless SSL Configuration @@ -427,7 +427,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[KeylessCertificate, AsyncSinglePage[KeylessCertificate]]: """ List all Keyless SSL configurations for a given zone. @@ -464,7 +464,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificateDeleteResponse]: """ Delete Keyless SSL Configuration @@ -507,17 +507,17 @@ async def edit( keyless_certificate_id: str, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, - host: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - port: float | NotGiven = NOT_GIVEN, - tunnel: TunnelParam | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificate]: """This will update attributes of a Keyless SSL. @@ -586,7 +586,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificate]: """ Get details for one Keyless SSL configuration. diff --git a/src/cloudflare/resources/kv/namespaces/keys.py b/src/cloudflare/resources/kv/namespaces/keys.py index 6b5b71f0bb4..da37ef3eb63 100644 --- a/src/cloudflare/resources/kv/namespaces/keys.py +++ b/src/cloudflare/resources/kv/namespaces/keys.py @@ -3,12 +3,12 @@ from __future__ import annotations import typing_extensions -from typing import Any, List, Type, Iterable, Optional, cast +from typing import Any, Type, Iterable, Optional, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -19,7 +19,7 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncCursorLimitPagination, AsyncCursorLimitPagination +from ....pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter from ...._base_client import AsyncPaginator, make_request_options from ....types.kv.namespaces import key_list_params, key_bulk_get_params, key_bulk_update_params from ....types.kv.namespaces.key import Key @@ -55,21 +55,21 @@ def list( namespace_id: str, *, account_id: str, - cursor: str | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - prefix: str | NotGiven = NOT_GIVEN, + cursor: str | Omit = omit, + limit: float | Omit = omit, + prefix: 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, - ) -> SyncCursorLimitPagination[Key]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncCursorPaginationAfter[Key]: """ Lists a namespace's keys. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -78,11 +78,11 @@ def list( parameter. A valid value for the cursor can be obtained from the `cursors` object in the `result_info` structure. - limit: The number of keys to return. The cursor attribute may be used to iterate over - the next batch of keys if there are more than the limit. + limit: Limits the number of keys returned in the response. The cursor attribute may be + used to iterate over the next batch of keys if there are more than the limit. - prefix: A string prefix used to filter down which keys will be returned. Exact matches - and any key names that begin with the prefix will be returned. + prefix: Filters returned keys by a name prefix. Exact matches and any key names that + begin with the prefix will be returned. extra_headers: Send extra headers @@ -98,7 +98,7 @@ def list( raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") return self._get_api_list( f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys", - page=SyncCursorLimitPagination[Key], + page=SyncCursorPaginationAfter[Key], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -122,13 +122,13 @@ def bulk_delete( namespace_id: str, *, account_id: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyBulkDeleteResponse]: """Remove multiple KV pairs from the namespace. @@ -136,7 +136,7 @@ def bulk_delete( 10,000 keys to be removed. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -154,7 +154,7 @@ def bulk_delete( raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") return self._post( f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/delete", - body=maybe_transform(body, List[str]), + body=maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -171,33 +171,32 @@ def bulk_get( namespace_id: str, *, account_id: str, - keys: List[str], - type: Literal["text", "json"] | NotGiven = NOT_GIVEN, - with_metadata: bool | NotGiven = NOT_GIVEN, + keys: SequenceNotStr[str], + type: Literal["text", "json"] | Omit = omit, + with_metadata: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyBulkGetResponse]: - """Get multiple KV pairs from the namespace. + """Retrieve up to 100 KV pairs from the namespace. - Body should contain keys to retrieve - at most 100. Keys must contain text-based values. If value is json, it can be - requested to return in JSON, instead of string. Metadata can be return if - withMetadata is true. + Keys must contain text-based + values. JSON values can optionally be parsed instead of being returned as a + string value. Metadata can be included if `withMetadata` is true. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. - keys: Array of keys to retrieve (maximum 100) + keys: Array of keys to retrieve (maximum of 100). - type: Whether to parse JSON values in the response + type: Whether to parse JSON values in the response. - with_metadata: Whether to include metadata in the response + with_metadata: Whether to include metadata in the response. extra_headers: Send extra headers @@ -248,7 +247,7 @@ def bulk_update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyBulkUpdateResponse]: """Write multiple keys and values at once. @@ -260,7 +259,7 @@ def bulk_update( size must be 100 megabytes or less. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -315,21 +314,21 @@ def list( namespace_id: str, *, account_id: str, - cursor: str | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - prefix: str | NotGiven = NOT_GIVEN, + cursor: str | Omit = omit, + limit: float | Omit = omit, + prefix: 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[Key, AsyncCursorLimitPagination[Key]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Key, AsyncCursorPaginationAfter[Key]]: """ Lists a namespace's keys. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -338,11 +337,11 @@ def list( parameter. A valid value for the cursor can be obtained from the `cursors` object in the `result_info` structure. - limit: The number of keys to return. The cursor attribute may be used to iterate over - the next batch of keys if there are more than the limit. + limit: Limits the number of keys returned in the response. The cursor attribute may be + used to iterate over the next batch of keys if there are more than the limit. - prefix: A string prefix used to filter down which keys will be returned. Exact matches - and any key names that begin with the prefix will be returned. + prefix: Filters returned keys by a name prefix. Exact matches and any key names that + begin with the prefix will be returned. extra_headers: Send extra headers @@ -358,7 +357,7 @@ def list( raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") return self._get_api_list( f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys", - page=AsyncCursorLimitPagination[Key], + page=AsyncCursorPaginationAfter[Key], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -382,13 +381,13 @@ async def bulk_delete( namespace_id: str, *, account_id: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyBulkDeleteResponse]: """Remove multiple KV pairs from the namespace. @@ -396,7 +395,7 @@ async def bulk_delete( 10,000 keys to be removed. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -414,7 +413,7 @@ async def bulk_delete( raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") return await self._post( f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/delete", - body=await async_maybe_transform(body, List[str]), + body=await async_maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -431,33 +430,32 @@ async def bulk_get( namespace_id: str, *, account_id: str, - keys: List[str], - type: Literal["text", "json"] | NotGiven = NOT_GIVEN, - with_metadata: bool | NotGiven = NOT_GIVEN, + keys: SequenceNotStr[str], + type: Literal["text", "json"] | Omit = omit, + with_metadata: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyBulkGetResponse]: - """Get multiple KV pairs from the namespace. + """Retrieve up to 100 KV pairs from the namespace. - Body should contain keys to retrieve - at most 100. Keys must contain text-based values. If value is json, it can be - requested to return in JSON, instead of string. Metadata can be return if - withMetadata is true. + Keys must contain text-based + values. JSON values can optionally be parsed instead of being returned as a + string value. Metadata can be included if `withMetadata` is true. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. - keys: Array of keys to retrieve (maximum 100) + keys: Array of keys to retrieve (maximum of 100). - type: Whether to parse JSON values in the response + type: Whether to parse JSON values in the response. - with_metadata: Whether to include metadata in the response + with_metadata: Whether to include metadata in the response. extra_headers: Send extra headers @@ -508,7 +506,7 @@ async def bulk_update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyBulkUpdateResponse]: """Write multiple keys and values at once. @@ -520,7 +518,7 @@ async def bulk_update( size must be 100 megabytes or less. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -559,17 +557,17 @@ def __init__(self, keys: KeysResource) -> None: ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - keys.bulk_delete # pyright: ignore[reportDeprecated], + keys.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - keys.bulk_get # pyright: ignore[reportDeprecated], + keys.bulk_get, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - keys.bulk_update # pyright: ignore[reportDeprecated], + keys.bulk_update, # pyright: ignore[reportDeprecated], ) ) @@ -583,17 +581,17 @@ def __init__(self, keys: AsyncKeysResource) -> None: ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - keys.bulk_delete # pyright: ignore[reportDeprecated], + keys.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - keys.bulk_get # pyright: ignore[reportDeprecated], + keys.bulk_get, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - keys.bulk_update # pyright: ignore[reportDeprecated], + keys.bulk_update, # pyright: ignore[reportDeprecated], ) ) @@ -607,17 +605,17 @@ def __init__(self, keys: KeysResource) -> None: ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - keys.bulk_delete # pyright: ignore[reportDeprecated], + keys.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - keys.bulk_get # pyright: ignore[reportDeprecated], + keys.bulk_get, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - keys.bulk_update # pyright: ignore[reportDeprecated], + keys.bulk_update, # pyright: ignore[reportDeprecated], ) ) @@ -631,16 +629,16 @@ def __init__(self, keys: AsyncKeysResource) -> None: ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - keys.bulk_delete # pyright: ignore[reportDeprecated], + keys.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - keys.bulk_get # pyright: ignore[reportDeprecated], + keys.bulk_get, # pyright: ignore[reportDeprecated], ) ) self.bulk_update = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - keys.bulk_update # pyright: ignore[reportDeprecated], + keys.bulk_update, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/kv/namespaces/metadata.py b/src/cloudflare/resources/kv/namespaces/metadata.py index fd5a0d2dad7..9310c0f11d0 100644 --- a/src/cloudflare/resources/kv/namespaces/metadata.py +++ b/src/cloudflare/resources/kv/namespaces/metadata.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -17,7 +17,6 @@ ) from ...._wrappers import ResultWrapper from ...._base_client import make_request_options -from ....types.kv.namespaces.metadata_get_response import MetadataGetResponse __all__ = ["MetadataResource", "AsyncMetadataResource"] @@ -53,8 +52,8 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[MetadataGetResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: """Returns the metadata associated with the given key in the given namespace. Use @@ -62,7 +61,7 @@ def get( name. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -90,9 +89,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[MetadataGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[MetadataGetResponse]], ResultWrapper[MetadataGetResponse]), + cast_to=cast(Type[object], ResultWrapper[object]), ) @@ -127,8 +126,8 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[MetadataGetResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> object: """Returns the metadata associated with the given key in the given namespace. Use @@ -136,7 +135,7 @@ async def get( name. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -164,9 +163,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[MetadataGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[Optional[MetadataGetResponse]], ResultWrapper[MetadataGetResponse]), + cast_to=cast(Type[object], ResultWrapper[object]), ) diff --git a/src/cloudflare/resources/kv/namespaces/namespaces.py b/src/cloudflare/resources/kv/namespaces/namespaces.py index d033b2e28ab..211ee6fcb6f 100644 --- a/src/cloudflare/resources/kv/namespaces/namespaces.py +++ b/src/cloudflare/resources/kv/namespaces/namespaces.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Type, Iterable, Optional, cast +from typing import Any, Type, Iterable, Optional, cast from typing_extensions import Literal import httpx @@ -31,7 +31,7 @@ MetadataResourceWithStreamingResponse, AsyncMetadataResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 ....types.kv import ( @@ -102,7 +102,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Namespace]: """Creates a namespace under the given title. @@ -111,7 +111,7 @@ def create( to be replaced. Args: - account_id: Identifier + account_id: Identifier. title: A human-readable string name for a Namespace. @@ -149,13 +149,13 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Namespace: """ Modifies a namespace's title. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -190,22 +190,22 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["id", "title"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["id", "title"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Namespace]: """ Returns the namespaces owned by an account. Args: - account_id: Identifier + account_id: Identifier. direction: Direction to order namespaces. @@ -256,13 +256,13 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceDeleteResponse]: """ Deletes the namespace corresponding to the given ID. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -295,13 +295,13 @@ def bulk_delete( namespace_id: str, *, account_id: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceBulkDeleteResponse]: """Remove multiple KV pairs from the namespace. @@ -309,7 +309,7 @@ def bulk_delete( 10,000 keys to be removed. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -327,7 +327,7 @@ def bulk_delete( raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") return self._post( f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/delete", - body=maybe_transform(body, List[str]), + body=maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -343,33 +343,32 @@ def bulk_get( namespace_id: str, *, account_id: str, - keys: List[str], - type: Literal["text", "json"] | NotGiven = NOT_GIVEN, - with_metadata: bool | NotGiven = NOT_GIVEN, + keys: SequenceNotStr[str], + type: Literal["text", "json"] | Omit = omit, + with_metadata: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceBulkGetResponse]: - """Get multiple KV pairs from the namespace. + """Retrieve up to 100 KV pairs from the namespace. - Body should contain keys to retrieve - at most 100. Keys must contain text-based values. If value is json, it can be - requested to return in JSON, instead of string. Metadata can be return if - withMetadata is true. + Keys must contain text-based + values. JSON values can optionally be parsed instead of being returned as a + string value. Metadata can be included if `withMetadata` is true. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. - keys: Array of keys to retrieve (maximum 100) + keys: Array of keys to retrieve (maximum of 100). - type: Whether to parse JSON values in the response + type: Whether to parse JSON values in the response. - with_metadata: Whether to include metadata in the response + with_metadata: Whether to include metadata in the response. extra_headers: Send extra headers @@ -419,7 +418,7 @@ def bulk_update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceBulkUpdateResponse]: """Write multiple keys and values at once. @@ -431,7 +430,7 @@ def bulk_update( size must be 100 megabytes or less. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -470,13 +469,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Namespace]: """ Get the namespace corresponding to the given ID. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -547,7 +546,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Namespace]: """Creates a namespace under the given title. @@ -556,7 +555,7 @@ async def create( to be replaced. Args: - account_id: Identifier + account_id: Identifier. title: A human-readable string name for a Namespace. @@ -594,13 +593,13 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Namespace: """ Modifies a namespace's title. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -635,22 +634,22 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["id", "title"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["id", "title"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Namespace, AsyncV4PagePaginationArray[Namespace]]: """ Returns the namespaces owned by an account. Args: - account_id: Identifier + account_id: Identifier. direction: Direction to order namespaces. @@ -701,13 +700,13 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceDeleteResponse]: """ Deletes the namespace corresponding to the given ID. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -740,13 +739,13 @@ async def bulk_delete( namespace_id: str, *, account_id: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceBulkDeleteResponse]: """Remove multiple KV pairs from the namespace. @@ -754,7 +753,7 @@ async def bulk_delete( 10,000 keys to be removed. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -772,7 +771,7 @@ async def bulk_delete( raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") return await self._post( f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/delete", - body=await async_maybe_transform(body, List[str]), + body=await async_maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -788,33 +787,32 @@ async def bulk_get( namespace_id: str, *, account_id: str, - keys: List[str], - type: Literal["text", "json"] | NotGiven = NOT_GIVEN, - with_metadata: bool | NotGiven = NOT_GIVEN, + keys: SequenceNotStr[str], + type: Literal["text", "json"] | Omit = omit, + with_metadata: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceBulkGetResponse]: - """Get multiple KV pairs from the namespace. + """Retrieve up to 100 KV pairs from the namespace. - Body should contain keys to retrieve - at most 100. Keys must contain text-based values. If value is json, it can be - requested to return in JSON, instead of string. Metadata can be return if - withMetadata is true. + Keys must contain text-based + values. JSON values can optionally be parsed instead of being returned as a + string value. Metadata can be included if `withMetadata` is true. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. - keys: Array of keys to retrieve (maximum 100) + keys: Array of keys to retrieve (maximum of 100). - type: Whether to parse JSON values in the response + type: Whether to parse JSON values in the response. - with_metadata: Whether to include metadata in the response + with_metadata: Whether to include metadata in the response. extra_headers: Send extra headers @@ -864,7 +862,7 @@ async def bulk_update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceBulkUpdateResponse]: """Write multiple keys and values at once. @@ -876,7 +874,7 @@ async def bulk_update( size must be 100 megabytes or less. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -915,13 +913,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Namespace]: """ Get the namespace corresponding to the given ID. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. diff --git a/src/cloudflare/resources/kv/namespaces/values.py b/src/cloudflare/resources/kv/namespaces/values.py index 05e3e187510..dc3bffb8a13 100644 --- a/src/cloudflare/resources/kv/namespaces/values.py +++ b/src/cloudflare/resources/kv/namespaces/values.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -59,16 +59,16 @@ def update( *, account_id: str, namespace_id: str, - metadata: str, value: str, - expiration: float | NotGiven = NOT_GIVEN, - expiration_ttl: float | NotGiven = NOT_GIVEN, + expiration: float | Omit = omit, + expiration_ttl: float | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ValueUpdateResponse]: """Write a value identified by a key. @@ -82,22 +82,21 @@ def update( `expiration` is ignored. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. key_name: A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL. - metadata: Arbitrary JSON to be associated with a key/value pair. - value: A byte sequence to be stored, up to 25 MiB in length. - expiration: The time, measured in number of seconds since the UNIX epoch, at which the key - should expire. + expiration: Expires the key at a certain time, measured in number of seconds since the UNIX + epoch. + + expiration_ttl: Expires the key after a number of seconds. Must be at least 60. - expiration_ttl: The number of seconds for which the key should be visible before it expires. At - least 60. + metadata: Associates arbitrary JSON data with a key/value pair. extra_headers: Send extra headers @@ -113,12 +112,16 @@ def update( raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") if not key_name: raise ValueError(f"Expected a non-empty value for `key_name` but received {key_name!r}") + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._put( f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/values/{key_name}", body=maybe_transform( { - "metadata": metadata, "value": value, + "metadata": metadata, }, value_update_params.ValueUpdateParams, ), @@ -134,6 +137,7 @@ def update( }, value_update_params.ValueUpdateParams, ), + multipart_syntax="json", post_parser=ResultWrapper[Optional[ValueUpdateResponse]]._unwrapper, ), cast_to=cast(Type[Optional[ValueUpdateResponse]], ResultWrapper[ValueUpdateResponse]), @@ -150,7 +154,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ValueDeleteResponse]: """Remove a KV pair from the namespace. @@ -158,7 +162,7 @@ def delete( (for example, `:`, `!`, `%`) in the key name. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -202,7 +206,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """Returns the value associated with the given key in the given namespace. @@ -213,7 +217,7 @@ def get( response header. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -270,16 +274,16 @@ async def update( *, account_id: str, namespace_id: str, - metadata: str, value: str, - expiration: float | NotGiven = NOT_GIVEN, - expiration_ttl: float | NotGiven = NOT_GIVEN, + expiration: float | Omit = omit, + expiration_ttl: float | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ValueUpdateResponse]: """Write a value identified by a key. @@ -293,22 +297,21 @@ async def update( `expiration` is ignored. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. key_name: A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL. - metadata: Arbitrary JSON to be associated with a key/value pair. - value: A byte sequence to be stored, up to 25 MiB in length. - expiration: The time, measured in number of seconds since the UNIX epoch, at which the key - should expire. + expiration: Expires the key at a certain time, measured in number of seconds since the UNIX + epoch. + + expiration_ttl: Expires the key after a number of seconds. Must be at least 60. - expiration_ttl: The number of seconds for which the key should be visible before it expires. At - least 60. + metadata: Associates arbitrary JSON data with a key/value pair. extra_headers: Send extra headers @@ -324,12 +327,16 @@ async def update( raise ValueError(f"Expected a non-empty value for `namespace_id` but received {namespace_id!r}") if not key_name: raise ValueError(f"Expected a non-empty value for `key_name` but received {key_name!r}") + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._put( f"/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/values/{key_name}", body=await async_maybe_transform( { - "metadata": metadata, "value": value, + "metadata": metadata, }, value_update_params.ValueUpdateParams, ), @@ -345,6 +352,7 @@ async def update( }, value_update_params.ValueUpdateParams, ), + multipart_syntax="json", post_parser=ResultWrapper[Optional[ValueUpdateResponse]]._unwrapper, ), cast_to=cast(Type[Optional[ValueUpdateResponse]], ResultWrapper[ValueUpdateResponse]), @@ -361,7 +369,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ValueDeleteResponse]: """Remove a KV pair from the namespace. @@ -369,7 +377,7 @@ async def delete( (for example, `:`, `!`, `%`) in the key name. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. @@ -413,7 +421,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """Returns the value associated with the given key in the given namespace. @@ -424,7 +432,7 @@ async def get( response header. Args: - account_id: Identifier + account_id: Identifier. namespace_id: Namespace identifier tag. diff --git a/src/cloudflare/resources/leaked_credential_checks/detections.py b/src/cloudflare/resources/leaked_credential_checks/detections.py index bbeead7867b..fde825aa3ec 100644 --- a/src/cloudflare/resources/leaked_credential_checks/detections.py +++ b/src/cloudflare/resources/leaked_credential_checks/detections.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,14 +51,14 @@ def create( self, *, zone_id: str, - password: str | NotGiven = NOT_GIVEN, - username: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DetectionCreateResponse: """ Create user-defined detection pattern for Leaked Credential Checks. @@ -104,14 +104,14 @@ def update( detection_id: str, *, zone_id: str, - password: str | NotGiven = NOT_GIVEN, - username: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DetectionUpdateResponse: """ Update user-defined detection pattern for Leaked Credential Checks. @@ -165,7 +165,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DetectionListResponse]: """ List user-defined detection patterns for Leaked Credential Checks. @@ -202,7 +202,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Remove user-defined detection pattern for Leaked Credential Checks. @@ -261,14 +261,14 @@ async def create( self, *, zone_id: str, - password: str | NotGiven = NOT_GIVEN, - username: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DetectionCreateResponse: """ Create user-defined detection pattern for Leaked Credential Checks. @@ -314,14 +314,14 @@ async def update( detection_id: str, *, zone_id: str, - password: str | NotGiven = NOT_GIVEN, - username: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DetectionUpdateResponse: """ Update user-defined detection pattern for Leaked Credential Checks. @@ -375,7 +375,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DetectionListResponse, AsyncSinglePage[DetectionListResponse]]: """ List user-defined detection patterns for Leaked Credential Checks. @@ -412,7 +412,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Remove user-defined detection pattern for Leaked Credential Checks. 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 354be38565d..00e8ed4590d 100644 --- a/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py +++ b/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .detections import ( @@ -63,13 +63,13 @@ def create( self, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LeakedCredentialCheckCreateResponse: """ Updates the current status of Leaked Credential Checks. @@ -113,7 +113,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LeakedCredentialCheckGetResponse: """ Retrieves the current status of Leaked Credential Checks. @@ -172,13 +172,13 @@ async def create( self, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LeakedCredentialCheckCreateResponse: """ Updates the current status of Leaked Credential Checks. @@ -222,7 +222,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LeakedCredentialCheckGetResponse: """ Retrieves the current status of Leaked Credential Checks. diff --git a/src/cloudflare/resources/load_balancers/__init__.py b/src/cloudflare/resources/load_balancers/__init__.py index a6ca61a9b10..15be6ff96c2 100644 --- a/src/cloudflare/resources/load_balancers/__init__.py +++ b/src/cloudflare/resources/load_balancers/__init__.py @@ -48,6 +48,14 @@ LoadBalancersResourceWithStreamingResponse, AsyncLoadBalancersResourceWithStreamingResponse, ) +from .monitor_groups import ( + MonitorGroupsResource, + AsyncMonitorGroupsResource, + MonitorGroupsResourceWithRawResponse, + AsyncMonitorGroupsResourceWithRawResponse, + MonitorGroupsResourceWithStreamingResponse, + AsyncMonitorGroupsResourceWithStreamingResponse, +) __all__ = [ "MonitorsResource", @@ -56,6 +64,12 @@ "AsyncMonitorsResourceWithRawResponse", "MonitorsResourceWithStreamingResponse", "AsyncMonitorsResourceWithStreamingResponse", + "MonitorGroupsResource", + "AsyncMonitorGroupsResource", + "MonitorGroupsResourceWithRawResponse", + "AsyncMonitorGroupsResourceWithRawResponse", + "MonitorGroupsResourceWithStreamingResponse", + "AsyncMonitorGroupsResourceWithStreamingResponse", "PoolsResource", "AsyncPoolsResource", "PoolsResourceWithRawResponse", diff --git a/src/cloudflare/resources/load_balancers/load_balancers.py b/src/cloudflare/resources/load_balancers/load_balancers.py index 6c65a5e4ceb..228f48335be 100644 --- a/src/cloudflare/resources/load_balancers/load_balancers.py +++ b/src/cloudflare/resources/load_balancers/load_balancers.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Type, Iterable, cast +from typing import Dict, Type, Iterable, cast import httpx @@ -14,7 +14,7 @@ RegionsResourceWithStreamingResponse, AsyncRegionsResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .previews import ( PreviewsResource, @@ -51,6 +51,14 @@ ) from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options +from .monitor_groups import ( + MonitorGroupsResource, + AsyncMonitorGroupsResource, + MonitorGroupsResourceWithRawResponse, + AsyncMonitorGroupsResourceWithRawResponse, + MonitorGroupsResourceWithStreamingResponse, + AsyncMonitorGroupsResourceWithStreamingResponse, +) from .monitors.monitors import ( MonitorsResource, AsyncMonitorsResource, @@ -85,6 +93,10 @@ class LoadBalancersResource(SyncAPIResource): def monitors(self) -> MonitorsResource: return MonitorsResource(self._client) + @cached_property + def monitor_groups(self) -> MonitorGroupsResource: + return MonitorGroupsResource(self._client) + @cached_property def pools(self) -> PoolsResource: return PoolsResource(self._client) @@ -124,30 +136,30 @@ def create( self, *, zone_id: str, - default_pools: List[DefaultPools], + default_pools: SequenceNotStr[DefaultPools], fallback_pool: str, name: str, - adaptive_routing: AdaptiveRoutingParam | NotGiven = NOT_GIVEN, - country_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - location_strategy: LocationStrategyParam | NotGiven = NOT_GIVEN, - networks: List[str] | NotGiven = NOT_GIVEN, - pop_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN, - region_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN, - session_affinity: SessionAffinity | NotGiven = NOT_GIVEN, - session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN, - session_affinity_ttl: float | NotGiven = NOT_GIVEN, - steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN, - ttl: float | NotGiven = NOT_GIVEN, + adaptive_routing: AdaptiveRoutingParam | Omit = omit, + country_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + description: str | Omit = omit, + location_strategy: LocationStrategyParam | Omit = omit, + networks: SequenceNotStr[str] | Omit = omit, + pop_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + proxied: bool | Omit = omit, + random_steering: RandomSteeringParam | Omit = omit, + region_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + rules: Iterable[RulesParam] | Omit = omit, + session_affinity: SessionAffinity | Omit = omit, + session_affinity_attributes: SessionAffinityAttributesParam | Omit = omit, + session_affinity_ttl: float | Omit = omit, + steering_policy: SteeringPolicy | Omit = omit, + ttl: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LoadBalancer: """ Create a new load balancer. @@ -181,7 +193,7 @@ def create( networks: List of networks where Load Balancer or Pool is enabled. - pop_pools: (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs + pop_pools: Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. @@ -205,41 +217,37 @@ def create( execute. session_affinity: Specifies the type of session affinity the load balancer should use unless - specified as `"none"`. The supported types are: - - - `"cookie"`: On the first request to a proxied load balancer, a cookie is - generated, encoding information of which origin the request will be forwarded - to. Subsequent requests, by the same client to the same load balancer, will be - sent to the origin server the cookie encodes, for the duration of the cookie - and as long as the origin server remains healthy. If the cookie has expired or - the origin server is unhealthy, then a new origin server is calculated and - used. - - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - selection is stable and based on the client's ip address. - - `"header"`: On the first request to a proxied load balancer, a session key - based on the configured HTTP headers (see - `session_affinity_attributes.headers`) is generated, encoding the request - headers used for storing in the load balancer session state which origin the - request will be forwarded to. Subsequent requests to the load balancer with - the same headers will be sent to the same origin server, for the duration of - the session and as long as the origin server remains healthy. If the session - has been idle for the duration of `session_affinity_ttl` seconds or the origin - server is unhealthy, then a new origin server is calculated and used. See - `headers` in `session_affinity_attributes` for additional required - configuration. + specified as `"none"`. The supported types are: - `"cookie"`: On the first + request to a proxied load balancer, a cookie is generated, encoding information + of which origin the request will be forwarded to. Subsequent requests, by the + same client to the same load balancer, will be sent to the origin server the + cookie encodes, for the duration of the cookie and as long as the origin server + remains healthy. If the cookie has expired or the origin server is unhealthy, + then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + same as `"cookie"` except the initial origin selection is stable and based on + the client's ip address. - `"header"`: On the first request to a proxied load + balancer, a session key based on the configured HTTP headers (see + `session_affinity_attributes.headers`) is generated, encoding the request + headers used for storing in the load balancer session state which origin the + request will be forwarded to. Subsequent requests to the load balancer with the + same headers will be sent to the same origin server, for the duration of the + session and as long as the origin server remains healthy. If the session has + been idle for the duration of `session_affinity_ttl` seconds or the origin + server is unhealthy, then a new origin server is calculated and used. See + `headers` in `session_affinity_attributes` for additional required + configuration. session_affinity_attributes: Configures attributes for session affinity. session_affinity_ttl: Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different - origin server. The accepted ranges per `session_affinity` policy are: - - - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - unless explicitly set. The accepted range of values is between [1800, 604800]. - - `"header"`: The current default of 1800 seconds will be used unless explicitly - set. The accepted range of values is between [30, 3600]. Note: With session - affinity by header, sessions only expire after they haven't been used for the - number of seconds specified. + origin server. The accepted ranges per `session_affinity` policy are: - + `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless + explicitly set. The accepted range of values is between [1800, 604800]. - + `"header"`: The current default of 1800 seconds will be used unless explicitly + set. The accepted range of values is between [30, 3600]. Note: With session + affinity by header, sessions only expire after they haven't been used for the + number of seconds specified. steering_policy: Steering Policy for this load balancer. @@ -317,31 +325,31 @@ def update( load_balancer_id: str, *, zone_id: str, - default_pools: List[DefaultPools], + default_pools: SequenceNotStr[DefaultPools], fallback_pool: str, name: str, - adaptive_routing: AdaptiveRoutingParam | NotGiven = NOT_GIVEN, - country_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - location_strategy: LocationStrategyParam | NotGiven = NOT_GIVEN, - networks: List[str] | NotGiven = NOT_GIVEN, - pop_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN, - region_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN, - session_affinity: SessionAffinity | NotGiven = NOT_GIVEN, - session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN, - session_affinity_ttl: float | NotGiven = NOT_GIVEN, - steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN, - ttl: float | NotGiven = NOT_GIVEN, + adaptive_routing: AdaptiveRoutingParam | Omit = omit, + country_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + location_strategy: LocationStrategyParam | Omit = omit, + networks: SequenceNotStr[str] | Omit = omit, + pop_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + proxied: bool | Omit = omit, + random_steering: RandomSteeringParam | Omit = omit, + region_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + rules: Iterable[RulesParam] | Omit = omit, + session_affinity: SessionAffinity | Omit = omit, + session_affinity_attributes: SessionAffinityAttributesParam | Omit = omit, + session_affinity_ttl: float | Omit = omit, + steering_policy: SteeringPolicy | Omit = omit, + ttl: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LoadBalancer: """ Update a configured load balancer. @@ -377,7 +385,7 @@ def update( networks: List of networks where Load Balancer or Pool is enabled. - pop_pools: (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs + pop_pools: Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. @@ -401,41 +409,37 @@ def update( execute. session_affinity: Specifies the type of session affinity the load balancer should use unless - specified as `"none"`. The supported types are: - - - `"cookie"`: On the first request to a proxied load balancer, a cookie is - generated, encoding information of which origin the request will be forwarded - to. Subsequent requests, by the same client to the same load balancer, will be - sent to the origin server the cookie encodes, for the duration of the cookie - and as long as the origin server remains healthy. If the cookie has expired or - the origin server is unhealthy, then a new origin server is calculated and - used. - - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - selection is stable and based on the client's ip address. - - `"header"`: On the first request to a proxied load balancer, a session key - based on the configured HTTP headers (see - `session_affinity_attributes.headers`) is generated, encoding the request - headers used for storing in the load balancer session state which origin the - request will be forwarded to. Subsequent requests to the load balancer with - the same headers will be sent to the same origin server, for the duration of - the session and as long as the origin server remains healthy. If the session - has been idle for the duration of `session_affinity_ttl` seconds or the origin - server is unhealthy, then a new origin server is calculated and used. See - `headers` in `session_affinity_attributes` for additional required - configuration. + specified as `"none"`. The supported types are: - `"cookie"`: On the first + request to a proxied load balancer, a cookie is generated, encoding information + of which origin the request will be forwarded to. Subsequent requests, by the + same client to the same load balancer, will be sent to the origin server the + cookie encodes, for the duration of the cookie and as long as the origin server + remains healthy. If the cookie has expired or the origin server is unhealthy, + then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + same as `"cookie"` except the initial origin selection is stable and based on + the client's ip address. - `"header"`: On the first request to a proxied load + balancer, a session key based on the configured HTTP headers (see + `session_affinity_attributes.headers`) is generated, encoding the request + headers used for storing in the load balancer session state which origin the + request will be forwarded to. Subsequent requests to the load balancer with the + same headers will be sent to the same origin server, for the duration of the + session and as long as the origin server remains healthy. If the session has + been idle for the duration of `session_affinity_ttl` seconds or the origin + server is unhealthy, then a new origin server is calculated and used. See + `headers` in `session_affinity_attributes` for additional required + configuration. session_affinity_attributes: Configures attributes for session affinity. session_affinity_ttl: Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different - origin server. The accepted ranges per `session_affinity` policy are: - - - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - unless explicitly set. The accepted range of values is between [1800, 604800]. - - `"header"`: The current default of 1800 seconds will be used unless explicitly - set. The accepted range of values is between [30, 3600]. Note: With session - affinity by header, sessions only expire after they haven't been used for the - number of seconds specified. + origin server. The accepted ranges per `session_affinity` policy are: - + `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless + explicitly set. The accepted range of values is between [1800, 604800]. - + `"header"`: The current default of 1800 seconds will be used unless explicitly + set. The accepted range of values is between [30, 3600]. Note: With session + affinity by header, sessions only expire after they haven't been used for the + number of seconds specified. steering_policy: Steering Policy for this load balancer. @@ -520,7 +524,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[LoadBalancer]: """ List configured load balancers. @@ -555,7 +559,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LoadBalancerDeleteResponse: """ Delete a configured load balancer. @@ -590,30 +594,30 @@ def edit( load_balancer_id: str, *, zone_id: str, - adaptive_routing: AdaptiveRoutingParam | NotGiven = NOT_GIVEN, - country_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - default_pools: List[DefaultPools] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - fallback_pool: str | NotGiven = NOT_GIVEN, - location_strategy: LocationStrategyParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - pop_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN, - region_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN, - session_affinity: SessionAffinity | NotGiven = NOT_GIVEN, - session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN, - session_affinity_ttl: float | NotGiven = NOT_GIVEN, - steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN, - ttl: float | NotGiven = NOT_GIVEN, + adaptive_routing: AdaptiveRoutingParam | Omit = omit, + country_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + default_pools: SequenceNotStr[DefaultPools] | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + fallback_pool: str | Omit = omit, + location_strategy: LocationStrategyParam | Omit = omit, + name: str | Omit = omit, + pop_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + proxied: bool | Omit = omit, + random_steering: RandomSteeringParam | Omit = omit, + region_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + rules: Iterable[RulesParam] | Omit = omit, + session_affinity: SessionAffinity | Omit = omit, + session_affinity_attributes: SessionAffinityAttributesParam | Omit = omit, + session_affinity_ttl: float | Omit = omit, + steering_policy: SteeringPolicy | Omit = omit, + ttl: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LoadBalancer: """ Apply changes to an existing load balancer, overwriting the supplied properties. @@ -647,7 +651,7 @@ def edit( exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used. - pop_pools: (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs + pop_pools: Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. @@ -671,41 +675,37 @@ def edit( execute. session_affinity: Specifies the type of session affinity the load balancer should use unless - specified as `"none"`. The supported types are: - - - `"cookie"`: On the first request to a proxied load balancer, a cookie is - generated, encoding information of which origin the request will be forwarded - to. Subsequent requests, by the same client to the same load balancer, will be - sent to the origin server the cookie encodes, for the duration of the cookie - and as long as the origin server remains healthy. If the cookie has expired or - the origin server is unhealthy, then a new origin server is calculated and - used. - - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - selection is stable and based on the client's ip address. - - `"header"`: On the first request to a proxied load balancer, a session key - based on the configured HTTP headers (see - `session_affinity_attributes.headers`) is generated, encoding the request - headers used for storing in the load balancer session state which origin the - request will be forwarded to. Subsequent requests to the load balancer with - the same headers will be sent to the same origin server, for the duration of - the session and as long as the origin server remains healthy. If the session - has been idle for the duration of `session_affinity_ttl` seconds or the origin - server is unhealthy, then a new origin server is calculated and used. See - `headers` in `session_affinity_attributes` for additional required - configuration. + specified as `"none"`. The supported types are: - `"cookie"`: On the first + request to a proxied load balancer, a cookie is generated, encoding information + of which origin the request will be forwarded to. Subsequent requests, by the + same client to the same load balancer, will be sent to the origin server the + cookie encodes, for the duration of the cookie and as long as the origin server + remains healthy. If the cookie has expired or the origin server is unhealthy, + then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + same as `"cookie"` except the initial origin selection is stable and based on + the client's ip address. - `"header"`: On the first request to a proxied load + balancer, a session key based on the configured HTTP headers (see + `session_affinity_attributes.headers`) is generated, encoding the request + headers used for storing in the load balancer session state which origin the + request will be forwarded to. Subsequent requests to the load balancer with the + same headers will be sent to the same origin server, for the duration of the + session and as long as the origin server remains healthy. If the session has + been idle for the duration of `session_affinity_ttl` seconds or the origin + server is unhealthy, then a new origin server is calculated and used. See + `headers` in `session_affinity_attributes` for additional required + configuration. session_affinity_attributes: Configures attributes for session affinity. session_affinity_ttl: Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different - origin server. The accepted ranges per `session_affinity` policy are: - - - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - unless explicitly set. The accepted range of values is between [1800, 604800]. - - `"header"`: The current default of 1800 seconds will be used unless explicitly - set. The accepted range of values is between [30, 3600]. Note: With session - affinity by header, sessions only expire after they haven't been used for the - number of seconds specified. + origin server. The accepted ranges per `session_affinity` policy are: - + `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless + explicitly set. The accepted range of values is between [1800, 604800]. - + `"header"`: The current default of 1800 seconds will be used unless explicitly + set. The accepted range of values is between [30, 3600]. Note: With session + affinity by header, sessions only expire after they haven't been used for the + number of seconds specified. steering_policy: Steering Policy for this load balancer. @@ -790,7 +790,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LoadBalancer: """ Fetch a single configured load balancer. @@ -826,6 +826,10 @@ class AsyncLoadBalancersResource(AsyncAPIResource): def monitors(self) -> AsyncMonitorsResource: return AsyncMonitorsResource(self._client) + @cached_property + def monitor_groups(self) -> AsyncMonitorGroupsResource: + return AsyncMonitorGroupsResource(self._client) + @cached_property def pools(self) -> AsyncPoolsResource: return AsyncPoolsResource(self._client) @@ -865,30 +869,30 @@ async def create( self, *, zone_id: str, - default_pools: List[DefaultPools], + default_pools: SequenceNotStr[DefaultPools], fallback_pool: str, name: str, - adaptive_routing: AdaptiveRoutingParam | NotGiven = NOT_GIVEN, - country_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - location_strategy: LocationStrategyParam | NotGiven = NOT_GIVEN, - networks: List[str] | NotGiven = NOT_GIVEN, - pop_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN, - region_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN, - session_affinity: SessionAffinity | NotGiven = NOT_GIVEN, - session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN, - session_affinity_ttl: float | NotGiven = NOT_GIVEN, - steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN, - ttl: float | NotGiven = NOT_GIVEN, + adaptive_routing: AdaptiveRoutingParam | Omit = omit, + country_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + description: str | Omit = omit, + location_strategy: LocationStrategyParam | Omit = omit, + networks: SequenceNotStr[str] | Omit = omit, + pop_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + proxied: bool | Omit = omit, + random_steering: RandomSteeringParam | Omit = omit, + region_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + rules: Iterable[RulesParam] | Omit = omit, + session_affinity: SessionAffinity | Omit = omit, + session_affinity_attributes: SessionAffinityAttributesParam | Omit = omit, + session_affinity_ttl: float | Omit = omit, + steering_policy: SteeringPolicy | Omit = omit, + ttl: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LoadBalancer: """ Create a new load balancer. @@ -922,7 +926,7 @@ async def create( networks: List of networks where Load Balancer or Pool is enabled. - pop_pools: (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs + pop_pools: Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. @@ -946,41 +950,37 @@ async def create( execute. session_affinity: Specifies the type of session affinity the load balancer should use unless - specified as `"none"`. The supported types are: - - - `"cookie"`: On the first request to a proxied load balancer, a cookie is - generated, encoding information of which origin the request will be forwarded - to. Subsequent requests, by the same client to the same load balancer, will be - sent to the origin server the cookie encodes, for the duration of the cookie - and as long as the origin server remains healthy. If the cookie has expired or - the origin server is unhealthy, then a new origin server is calculated and - used. - - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - selection is stable and based on the client's ip address. - - `"header"`: On the first request to a proxied load balancer, a session key - based on the configured HTTP headers (see - `session_affinity_attributes.headers`) is generated, encoding the request - headers used for storing in the load balancer session state which origin the - request will be forwarded to. Subsequent requests to the load balancer with - the same headers will be sent to the same origin server, for the duration of - the session and as long as the origin server remains healthy. If the session - has been idle for the duration of `session_affinity_ttl` seconds or the origin - server is unhealthy, then a new origin server is calculated and used. See - `headers` in `session_affinity_attributes` for additional required - configuration. + specified as `"none"`. The supported types are: - `"cookie"`: On the first + request to a proxied load balancer, a cookie is generated, encoding information + of which origin the request will be forwarded to. Subsequent requests, by the + same client to the same load balancer, will be sent to the origin server the + cookie encodes, for the duration of the cookie and as long as the origin server + remains healthy. If the cookie has expired or the origin server is unhealthy, + then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + same as `"cookie"` except the initial origin selection is stable and based on + the client's ip address. - `"header"`: On the first request to a proxied load + balancer, a session key based on the configured HTTP headers (see + `session_affinity_attributes.headers`) is generated, encoding the request + headers used for storing in the load balancer session state which origin the + request will be forwarded to. Subsequent requests to the load balancer with the + same headers will be sent to the same origin server, for the duration of the + session and as long as the origin server remains healthy. If the session has + been idle for the duration of `session_affinity_ttl` seconds or the origin + server is unhealthy, then a new origin server is calculated and used. See + `headers` in `session_affinity_attributes` for additional required + configuration. session_affinity_attributes: Configures attributes for session affinity. session_affinity_ttl: Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different - origin server. The accepted ranges per `session_affinity` policy are: - - - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - unless explicitly set. The accepted range of values is between [1800, 604800]. - - `"header"`: The current default of 1800 seconds will be used unless explicitly - set. The accepted range of values is between [30, 3600]. Note: With session - affinity by header, sessions only expire after they haven't been used for the - number of seconds specified. + origin server. The accepted ranges per `session_affinity` policy are: - + `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless + explicitly set. The accepted range of values is between [1800, 604800]. - + `"header"`: The current default of 1800 seconds will be used unless explicitly + set. The accepted range of values is between [30, 3600]. Note: With session + affinity by header, sessions only expire after they haven't been used for the + number of seconds specified. steering_policy: Steering Policy for this load balancer. @@ -1058,31 +1058,31 @@ async def update( load_balancer_id: str, *, zone_id: str, - default_pools: List[DefaultPools], + default_pools: SequenceNotStr[DefaultPools], fallback_pool: str, name: str, - adaptive_routing: AdaptiveRoutingParam | NotGiven = NOT_GIVEN, - country_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - location_strategy: LocationStrategyParam | NotGiven = NOT_GIVEN, - networks: List[str] | NotGiven = NOT_GIVEN, - pop_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN, - region_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN, - session_affinity: SessionAffinity | NotGiven = NOT_GIVEN, - session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN, - session_affinity_ttl: float | NotGiven = NOT_GIVEN, - steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN, - ttl: float | NotGiven = NOT_GIVEN, + adaptive_routing: AdaptiveRoutingParam | Omit = omit, + country_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + location_strategy: LocationStrategyParam | Omit = omit, + networks: SequenceNotStr[str] | Omit = omit, + pop_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + proxied: bool | Omit = omit, + random_steering: RandomSteeringParam | Omit = omit, + region_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + rules: Iterable[RulesParam] | Omit = omit, + session_affinity: SessionAffinity | Omit = omit, + session_affinity_attributes: SessionAffinityAttributesParam | Omit = omit, + session_affinity_ttl: float | Omit = omit, + steering_policy: SteeringPolicy | Omit = omit, + ttl: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LoadBalancer: """ Update a configured load balancer. @@ -1118,7 +1118,7 @@ async def update( networks: List of networks where Load Balancer or Pool is enabled. - pop_pools: (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs + pop_pools: Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. @@ -1142,41 +1142,37 @@ async def update( execute. session_affinity: Specifies the type of session affinity the load balancer should use unless - specified as `"none"`. The supported types are: - - - `"cookie"`: On the first request to a proxied load balancer, a cookie is - generated, encoding information of which origin the request will be forwarded - to. Subsequent requests, by the same client to the same load balancer, will be - sent to the origin server the cookie encodes, for the duration of the cookie - and as long as the origin server remains healthy. If the cookie has expired or - the origin server is unhealthy, then a new origin server is calculated and - used. - - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - selection is stable and based on the client's ip address. - - `"header"`: On the first request to a proxied load balancer, a session key - based on the configured HTTP headers (see - `session_affinity_attributes.headers`) is generated, encoding the request - headers used for storing in the load balancer session state which origin the - request will be forwarded to. Subsequent requests to the load balancer with - the same headers will be sent to the same origin server, for the duration of - the session and as long as the origin server remains healthy. If the session - has been idle for the duration of `session_affinity_ttl` seconds or the origin - server is unhealthy, then a new origin server is calculated and used. See - `headers` in `session_affinity_attributes` for additional required - configuration. + specified as `"none"`. The supported types are: - `"cookie"`: On the first + request to a proxied load balancer, a cookie is generated, encoding information + of which origin the request will be forwarded to. Subsequent requests, by the + same client to the same load balancer, will be sent to the origin server the + cookie encodes, for the duration of the cookie and as long as the origin server + remains healthy. If the cookie has expired or the origin server is unhealthy, + then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + same as `"cookie"` except the initial origin selection is stable and based on + the client's ip address. - `"header"`: On the first request to a proxied load + balancer, a session key based on the configured HTTP headers (see + `session_affinity_attributes.headers`) is generated, encoding the request + headers used for storing in the load balancer session state which origin the + request will be forwarded to. Subsequent requests to the load balancer with the + same headers will be sent to the same origin server, for the duration of the + session and as long as the origin server remains healthy. If the session has + been idle for the duration of `session_affinity_ttl` seconds or the origin + server is unhealthy, then a new origin server is calculated and used. See + `headers` in `session_affinity_attributes` for additional required + configuration. session_affinity_attributes: Configures attributes for session affinity. session_affinity_ttl: Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different - origin server. The accepted ranges per `session_affinity` policy are: - - - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - unless explicitly set. The accepted range of values is between [1800, 604800]. - - `"header"`: The current default of 1800 seconds will be used unless explicitly - set. The accepted range of values is between [30, 3600]. Note: With session - affinity by header, sessions only expire after they haven't been used for the - number of seconds specified. + origin server. The accepted ranges per `session_affinity` policy are: - + `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless + explicitly set. The accepted range of values is between [1800, 604800]. - + `"header"`: The current default of 1800 seconds will be used unless explicitly + set. The accepted range of values is between [30, 3600]. Note: With session + affinity by header, sessions only expire after they haven't been used for the + number of seconds specified. steering_policy: Steering Policy for this load balancer. @@ -1261,7 +1257,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[LoadBalancer, AsyncSinglePage[LoadBalancer]]: """ List configured load balancers. @@ -1296,7 +1292,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LoadBalancerDeleteResponse: """ Delete a configured load balancer. @@ -1331,30 +1327,30 @@ async def edit( load_balancer_id: str, *, zone_id: str, - adaptive_routing: AdaptiveRoutingParam | NotGiven = NOT_GIVEN, - country_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - default_pools: List[DefaultPools] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - fallback_pool: str | NotGiven = NOT_GIVEN, - location_strategy: LocationStrategyParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - pop_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - random_steering: RandomSteeringParam | NotGiven = NOT_GIVEN, - region_pools: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - rules: Iterable[RulesParam] | NotGiven = NOT_GIVEN, - session_affinity: SessionAffinity | NotGiven = NOT_GIVEN, - session_affinity_attributes: SessionAffinityAttributesParam | NotGiven = NOT_GIVEN, - session_affinity_ttl: float | NotGiven = NOT_GIVEN, - steering_policy: SteeringPolicy | NotGiven = NOT_GIVEN, - ttl: float | NotGiven = NOT_GIVEN, + adaptive_routing: AdaptiveRoutingParam | Omit = omit, + country_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + default_pools: SequenceNotStr[DefaultPools] | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + fallback_pool: str | Omit = omit, + location_strategy: LocationStrategyParam | Omit = omit, + name: str | Omit = omit, + pop_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + proxied: bool | Omit = omit, + random_steering: RandomSteeringParam | Omit = omit, + region_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, + rules: Iterable[RulesParam] | Omit = omit, + session_affinity: SessionAffinity | Omit = omit, + session_affinity_attributes: SessionAffinityAttributesParam | Omit = omit, + session_affinity_ttl: float | Omit = omit, + steering_policy: SteeringPolicy | Omit = omit, + ttl: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LoadBalancer: """ Apply changes to an existing load balancer, overwriting the supplied properties. @@ -1388,7 +1384,7 @@ async def edit( exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used. - pop_pools: (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs + pop_pools: Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any PoPs not explicitly defined will fall back to using the corresponding country_pool, then region_pool mapping if it exists else to default_pools. @@ -1412,41 +1408,37 @@ async def edit( execute. session_affinity: Specifies the type of session affinity the load balancer should use unless - specified as `"none"`. The supported types are: - - - `"cookie"`: On the first request to a proxied load balancer, a cookie is - generated, encoding information of which origin the request will be forwarded - to. Subsequent requests, by the same client to the same load balancer, will be - sent to the origin server the cookie encodes, for the duration of the cookie - and as long as the origin server remains healthy. If the cookie has expired or - the origin server is unhealthy, then a new origin server is calculated and - used. - - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - selection is stable and based on the client's ip address. - - `"header"`: On the first request to a proxied load balancer, a session key - based on the configured HTTP headers (see - `session_affinity_attributes.headers`) is generated, encoding the request - headers used for storing in the load balancer session state which origin the - request will be forwarded to. Subsequent requests to the load balancer with - the same headers will be sent to the same origin server, for the duration of - the session and as long as the origin server remains healthy. If the session - has been idle for the duration of `session_affinity_ttl` seconds or the origin - server is unhealthy, then a new origin server is calculated and used. See - `headers` in `session_affinity_attributes` for additional required - configuration. + specified as `"none"`. The supported types are: - `"cookie"`: On the first + request to a proxied load balancer, a cookie is generated, encoding information + of which origin the request will be forwarded to. Subsequent requests, by the + same client to the same load balancer, will be sent to the origin server the + cookie encodes, for the duration of the cookie and as long as the origin server + remains healthy. If the cookie has expired or the origin server is unhealthy, + then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + same as `"cookie"` except the initial origin selection is stable and based on + the client's ip address. - `"header"`: On the first request to a proxied load + balancer, a session key based on the configured HTTP headers (see + `session_affinity_attributes.headers`) is generated, encoding the request + headers used for storing in the load balancer session state which origin the + request will be forwarded to. Subsequent requests to the load balancer with the + same headers will be sent to the same origin server, for the duration of the + session and as long as the origin server remains healthy. If the session has + been idle for the duration of `session_affinity_ttl` seconds or the origin + server is unhealthy, then a new origin server is calculated and used. See + `headers` in `session_affinity_attributes` for additional required + configuration. session_affinity_attributes: Configures attributes for session affinity. session_affinity_ttl: Time, in seconds, until a client's session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different - origin server. The accepted ranges per `session_affinity` policy are: - - - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - unless explicitly set. The accepted range of values is between [1800, 604800]. - - `"header"`: The current default of 1800 seconds will be used unless explicitly - set. The accepted range of values is between [30, 3600]. Note: With session - affinity by header, sessions only expire after they haven't been used for the - number of seconds specified. + origin server. The accepted ranges per `session_affinity` policy are: - + `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless + explicitly set. The accepted range of values is between [1800, 604800]. - + `"header"`: The current default of 1800 seconds will be used unless explicitly + set. The accepted range of values is between [30, 3600]. Note: With session + affinity by header, sessions only expire after they haven't been used for the + number of seconds specified. steering_policy: Steering Policy for this load balancer. @@ -1531,7 +1523,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LoadBalancer: """ Fetch a single configured load balancer. @@ -1589,6 +1581,10 @@ def __init__(self, load_balancers: LoadBalancersResource) -> None: def monitors(self) -> MonitorsResourceWithRawResponse: return MonitorsResourceWithRawResponse(self._load_balancers.monitors) + @cached_property + def monitor_groups(self) -> MonitorGroupsResourceWithRawResponse: + return MonitorGroupsResourceWithRawResponse(self._load_balancers.monitor_groups) + @cached_property def pools(self) -> PoolsResourceWithRawResponse: return PoolsResourceWithRawResponse(self._load_balancers.pools) @@ -1633,6 +1629,10 @@ def __init__(self, load_balancers: AsyncLoadBalancersResource) -> None: def monitors(self) -> AsyncMonitorsResourceWithRawResponse: return AsyncMonitorsResourceWithRawResponse(self._load_balancers.monitors) + @cached_property + def monitor_groups(self) -> AsyncMonitorGroupsResourceWithRawResponse: + return AsyncMonitorGroupsResourceWithRawResponse(self._load_balancers.monitor_groups) + @cached_property def pools(self) -> AsyncPoolsResourceWithRawResponse: return AsyncPoolsResourceWithRawResponse(self._load_balancers.pools) @@ -1677,6 +1677,10 @@ def __init__(self, load_balancers: LoadBalancersResource) -> None: def monitors(self) -> MonitorsResourceWithStreamingResponse: return MonitorsResourceWithStreamingResponse(self._load_balancers.monitors) + @cached_property + def monitor_groups(self) -> MonitorGroupsResourceWithStreamingResponse: + return MonitorGroupsResourceWithStreamingResponse(self._load_balancers.monitor_groups) + @cached_property def pools(self) -> PoolsResourceWithStreamingResponse: return PoolsResourceWithStreamingResponse(self._load_balancers.pools) @@ -1721,6 +1725,10 @@ def __init__(self, load_balancers: AsyncLoadBalancersResource) -> None: def monitors(self) -> AsyncMonitorsResourceWithStreamingResponse: return AsyncMonitorsResourceWithStreamingResponse(self._load_balancers.monitors) + @cached_property + def monitor_groups(self) -> AsyncMonitorGroupsResourceWithStreamingResponse: + return AsyncMonitorGroupsResourceWithStreamingResponse(self._load_balancers.monitor_groups) + @cached_property def pools(self) -> AsyncPoolsResourceWithStreamingResponse: return AsyncPoolsResourceWithStreamingResponse(self._load_balancers.pools) diff --git a/src/cloudflare/resources/load_balancers/monitor_groups.py b/src/cloudflare/resources/load_balancers/monitor_groups.py new file mode 100644 index 00000000000..b07f8c4f7c7 --- /dev/null +++ b/src/cloudflare/resources/load_balancers/monitor_groups.py @@ -0,0 +1,757 @@ +# 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, 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 ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.load_balancers import monitor_group_edit_params, monitor_group_create_params, monitor_group_update_params +from ...types.load_balancers.monitor_group import MonitorGroup + +__all__ = ["MonitorGroupsResource", "AsyncMonitorGroupsResource"] + + +class MonitorGroupsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> MonitorGroupsResourceWithRawResponse: + """ + 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 MonitorGroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> MonitorGroupsResourceWithStreamingResponse: + """ + 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 MonitorGroupsResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + id: str, + description: str, + members: Iterable[monitor_group_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, + ) -> MonitorGroup: + """ + Create a new monitor group. + + Args: + account_id: Identifier. + + id: The ID of the Monitor Group to use for checking the health of origins within + this pool. + + description: A short description of the monitor group + + members: List of monitors in this group + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/load_balancers/monitor_groups", + body=maybe_transform( + { + "id": id, + "description": description, + "members": members, + }, + monitor_group_create_params.MonitorGroupCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MonitorGroup]._unwrapper, + ), + cast_to=cast(Type[MonitorGroup], ResultWrapper[MonitorGroup]), + ) + + def update( + self, + monitor_group_id: str, + *, + account_id: str, + id: str, + description: str, + members: Iterable[monitor_group_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MonitorGroup: + """ + Modify a configured monitor group. + + Args: + account_id: Identifier. + + id: The ID of the Monitor Group to use for checking the health of origins within + this pool. + + description: A short description of the monitor group + + members: List of monitors in this group + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 monitor_group_id: + raise ValueError(f"Expected a non-empty value for `monitor_group_id` but received {monitor_group_id!r}") + return self._put( + f"/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", + body=maybe_transform( + { + "id": id, + "description": description, + "members": members, + }, + monitor_group_update_params.MonitorGroupUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MonitorGroup]._unwrapper, + ), + cast_to=cast(Type[MonitorGroup], ResultWrapper[MonitorGroup]), + ) + + def list( + 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[MonitorGroup]: + """ + List configured monitor groups. + + Args: + account_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 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}/load_balancers/monitor_groups", + page=SyncSinglePage[MonitorGroup], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=MonitorGroup, + ) + + def delete( + self, + monitor_group_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, + ) -> MonitorGroup: + """ + Delete a configured monitor group. + + Args: + account_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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not monitor_group_id: + raise ValueError(f"Expected a non-empty value for `monitor_group_id` but received {monitor_group_id!r}") + return self._delete( + f"/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MonitorGroup]._unwrapper, + ), + cast_to=cast(Type[MonitorGroup], ResultWrapper[MonitorGroup]), + ) + + def edit( + self, + monitor_group_id: str, + *, + account_id: str, + id: str, + description: str, + members: Iterable[monitor_group_edit_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, + ) -> MonitorGroup: + """ + Apply changes to an existing monitor group, overwriting the supplied properties. + + Args: + account_id: Identifier. + + id: The ID of the Monitor Group to use for checking the health of origins within + this pool. + + description: A short description of the monitor group + + members: List of monitors in this group + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 monitor_group_id: + raise ValueError(f"Expected a non-empty value for `monitor_group_id` but received {monitor_group_id!r}") + return self._patch( + f"/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", + body=maybe_transform( + { + "id": id, + "description": description, + "members": members, + }, + monitor_group_edit_params.MonitorGroupEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MonitorGroup]._unwrapper, + ), + cast_to=cast(Type[MonitorGroup], ResultWrapper[MonitorGroup]), + ) + + def get( + self, + monitor_group_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, + ) -> MonitorGroup: + """ + Fetch a single configured monitor group. + + Args: + account_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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not monitor_group_id: + raise ValueError(f"Expected a non-empty value for `monitor_group_id` but received {monitor_group_id!r}") + return self._get( + f"/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MonitorGroup]._unwrapper, + ), + cast_to=cast(Type[MonitorGroup], ResultWrapper[MonitorGroup]), + ) + + +class AsyncMonitorGroupsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncMonitorGroupsResourceWithRawResponse: + """ + 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 AsyncMonitorGroupsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncMonitorGroupsResourceWithStreamingResponse: + """ + 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 AsyncMonitorGroupsResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + id: str, + description: str, + members: Iterable[monitor_group_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, + ) -> MonitorGroup: + """ + Create a new monitor group. + + Args: + account_id: Identifier. + + id: The ID of the Monitor Group to use for checking the health of origins within + this pool. + + description: A short description of the monitor group + + members: List of monitors in this group + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/load_balancers/monitor_groups", + body=await async_maybe_transform( + { + "id": id, + "description": description, + "members": members, + }, + monitor_group_create_params.MonitorGroupCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MonitorGroup]._unwrapper, + ), + cast_to=cast(Type[MonitorGroup], ResultWrapper[MonitorGroup]), + ) + + async def update( + self, + monitor_group_id: str, + *, + account_id: str, + id: str, + description: str, + members: Iterable[monitor_group_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> MonitorGroup: + """ + Modify a configured monitor group. + + Args: + account_id: Identifier. + + id: The ID of the Monitor Group to use for checking the health of origins within + this pool. + + description: A short description of the monitor group + + members: List of monitors in this group + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 monitor_group_id: + raise ValueError(f"Expected a non-empty value for `monitor_group_id` but received {monitor_group_id!r}") + return await self._put( + f"/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", + body=await async_maybe_transform( + { + "id": id, + "description": description, + "members": members, + }, + monitor_group_update_params.MonitorGroupUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MonitorGroup]._unwrapper, + ), + cast_to=cast(Type[MonitorGroup], ResultWrapper[MonitorGroup]), + ) + + def list( + 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[MonitorGroup, AsyncSinglePage[MonitorGroup]]: + """ + List configured monitor groups. + + Args: + account_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 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}/load_balancers/monitor_groups", + page=AsyncSinglePage[MonitorGroup], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=MonitorGroup, + ) + + async def delete( + self, + monitor_group_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, + ) -> MonitorGroup: + """ + Delete a configured monitor group. + + Args: + account_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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not monitor_group_id: + raise ValueError(f"Expected a non-empty value for `monitor_group_id` but received {monitor_group_id!r}") + return await self._delete( + f"/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MonitorGroup]._unwrapper, + ), + cast_to=cast(Type[MonitorGroup], ResultWrapper[MonitorGroup]), + ) + + async def edit( + self, + monitor_group_id: str, + *, + account_id: str, + id: str, + description: str, + members: Iterable[monitor_group_edit_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, + ) -> MonitorGroup: + """ + Apply changes to an existing monitor group, overwriting the supplied properties. + + Args: + account_id: Identifier. + + id: The ID of the Monitor Group to use for checking the health of origins within + this pool. + + description: A short description of the monitor group + + members: List of monitors in this group + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 monitor_group_id: + raise ValueError(f"Expected a non-empty value for `monitor_group_id` but received {monitor_group_id!r}") + return await self._patch( + f"/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", + body=await async_maybe_transform( + { + "id": id, + "description": description, + "members": members, + }, + monitor_group_edit_params.MonitorGroupEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MonitorGroup]._unwrapper, + ), + cast_to=cast(Type[MonitorGroup], ResultWrapper[MonitorGroup]), + ) + + async def get( + self, + monitor_group_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, + ) -> MonitorGroup: + """ + Fetch a single configured monitor group. + + Args: + account_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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not monitor_group_id: + raise ValueError(f"Expected a non-empty value for `monitor_group_id` but received {monitor_group_id!r}") + return await self._get( + f"/accounts/{account_id}/load_balancers/monitor_groups/{monitor_group_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[MonitorGroup]._unwrapper, + ), + cast_to=cast(Type[MonitorGroup], ResultWrapper[MonitorGroup]), + ) + + +class MonitorGroupsResourceWithRawResponse: + def __init__(self, monitor_groups: MonitorGroupsResource) -> None: + self._monitor_groups = monitor_groups + + self.create = to_raw_response_wrapper( + monitor_groups.create, + ) + self.update = to_raw_response_wrapper( + monitor_groups.update, + ) + self.list = to_raw_response_wrapper( + monitor_groups.list, + ) + self.delete = to_raw_response_wrapper( + monitor_groups.delete, + ) + self.edit = to_raw_response_wrapper( + monitor_groups.edit, + ) + self.get = to_raw_response_wrapper( + monitor_groups.get, + ) + + +class AsyncMonitorGroupsResourceWithRawResponse: + def __init__(self, monitor_groups: AsyncMonitorGroupsResource) -> None: + self._monitor_groups = monitor_groups + + self.create = async_to_raw_response_wrapper( + monitor_groups.create, + ) + self.update = async_to_raw_response_wrapper( + monitor_groups.update, + ) + self.list = async_to_raw_response_wrapper( + monitor_groups.list, + ) + self.delete = async_to_raw_response_wrapper( + monitor_groups.delete, + ) + self.edit = async_to_raw_response_wrapper( + monitor_groups.edit, + ) + self.get = async_to_raw_response_wrapper( + monitor_groups.get, + ) + + +class MonitorGroupsResourceWithStreamingResponse: + def __init__(self, monitor_groups: MonitorGroupsResource) -> None: + self._monitor_groups = monitor_groups + + self.create = to_streamed_response_wrapper( + monitor_groups.create, + ) + self.update = to_streamed_response_wrapper( + monitor_groups.update, + ) + self.list = to_streamed_response_wrapper( + monitor_groups.list, + ) + self.delete = to_streamed_response_wrapper( + monitor_groups.delete, + ) + self.edit = to_streamed_response_wrapper( + monitor_groups.edit, + ) + self.get = to_streamed_response_wrapper( + monitor_groups.get, + ) + + +class AsyncMonitorGroupsResourceWithStreamingResponse: + def __init__(self, monitor_groups: AsyncMonitorGroupsResource) -> None: + self._monitor_groups = monitor_groups + + self.create = async_to_streamed_response_wrapper( + monitor_groups.create, + ) + self.update = async_to_streamed_response_wrapper( + monitor_groups.update, + ) + self.list = async_to_streamed_response_wrapper( + monitor_groups.list, + ) + self.delete = async_to_streamed_response_wrapper( + monitor_groups.delete, + ) + self.edit = async_to_streamed_response_wrapper( + monitor_groups.edit, + ) + self.get = async_to_streamed_response_wrapper( + monitor_groups.get, + ) diff --git a/src/cloudflare/resources/load_balancers/monitors/monitors.py b/src/cloudflare/resources/load_balancers/monitors/monitors.py index f7a41b0b924..1c4346c62e3 100644 --- a/src/cloudflare/resources/load_balancers/monitors/monitors.py +++ b/src/cloudflare/resources/load_balancers/monitors/monitors.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Type, cast +from typing import Dict, Type, cast from typing_extensions import Literal import httpx @@ -15,7 +15,7 @@ PreviewsResourceWithStreamingResponse, AsyncPreviewsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .references import ( @@ -75,34 +75,34 @@ def create( self, *, account_id: str, - allow_insecure: bool | NotGiven = NOT_GIVEN, - consecutive_down: int | NotGiven = NOT_GIVEN, - consecutive_up: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expected_body: str | NotGiven = NOT_GIVEN, - expected_codes: str | NotGiven = NOT_GIVEN, - follow_redirects: bool | NotGiven = NOT_GIVEN, - header: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - method: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - port: int | NotGiven = NOT_GIVEN, - probe_zone: str | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - load_balancer_monitor_timeout: int | NotGiven = NOT_GIVEN, - type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | NotGiven = NOT_GIVEN, + allow_insecure: bool | Omit = omit, + consecutive_down: int | Omit = omit, + consecutive_up: int | Omit = omit, + description: str | Omit = omit, + expected_body: str | Omit = omit, + expected_codes: str | Omit = omit, + follow_redirects: bool | Omit = omit, + header: Dict[str, SequenceNotStr[str]] | Omit = omit, + interval: int | Omit = omit, + method: str | Omit = omit, + path: str | Omit = omit, + port: int | Omit = omit, + probe_zone: str | Omit = omit, + retries: int | Omit = omit, + load_balancer_monitor_timeout: int | Omit = omit, + type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Monitor: """ Create a configured monitor. Args: - account_id: Identifier + account_id: Identifier. allow_insecure: Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. @@ -201,34 +201,34 @@ def update( monitor_id: str, *, account_id: str, - allow_insecure: bool | NotGiven = NOT_GIVEN, - consecutive_down: int | NotGiven = NOT_GIVEN, - consecutive_up: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expected_body: str | NotGiven = NOT_GIVEN, - expected_codes: str | NotGiven = NOT_GIVEN, - follow_redirects: bool | NotGiven = NOT_GIVEN, - header: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - method: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - port: int | NotGiven = NOT_GIVEN, - probe_zone: str | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - load_balancer_monitor_timeout: int | NotGiven = NOT_GIVEN, - type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | NotGiven = NOT_GIVEN, + allow_insecure: bool | Omit = omit, + consecutive_down: int | Omit = omit, + consecutive_up: int | Omit = omit, + description: str | Omit = omit, + expected_body: str | Omit = omit, + expected_codes: str | Omit = omit, + follow_redirects: bool | Omit = omit, + header: Dict[str, SequenceNotStr[str]] | Omit = omit, + interval: int | Omit = omit, + method: str | Omit = omit, + path: str | Omit = omit, + port: int | Omit = omit, + probe_zone: str | Omit = omit, + retries: int | Omit = omit, + load_balancer_monitor_timeout: int | Omit = omit, + type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Monitor: """ Modify a configured monitor. Args: - account_id: Identifier + account_id: Identifier. allow_insecure: Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. @@ -333,13 +333,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Monitor]: """ List configured monitors for an account. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -370,13 +370,13 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MonitorDeleteResponse: """ Delete a configured monitor. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -407,34 +407,34 @@ def edit( monitor_id: str, *, account_id: str, - allow_insecure: bool | NotGiven = NOT_GIVEN, - consecutive_down: int | NotGiven = NOT_GIVEN, - consecutive_up: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expected_body: str | NotGiven = NOT_GIVEN, - expected_codes: str | NotGiven = NOT_GIVEN, - follow_redirects: bool | NotGiven = NOT_GIVEN, - header: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - method: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - port: int | NotGiven = NOT_GIVEN, - probe_zone: str | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - load_balancer_monitor_timeout: int | NotGiven = NOT_GIVEN, - type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | NotGiven = NOT_GIVEN, + allow_insecure: bool | Omit = omit, + consecutive_down: int | Omit = omit, + consecutive_up: int | Omit = omit, + description: str | Omit = omit, + expected_body: str | Omit = omit, + expected_codes: str | Omit = omit, + follow_redirects: bool | Omit = omit, + header: Dict[str, SequenceNotStr[str]] | Omit = omit, + interval: int | Omit = omit, + method: str | Omit = omit, + path: str | Omit = omit, + port: int | Omit = omit, + probe_zone: str | Omit = omit, + retries: int | Omit = omit, + load_balancer_monitor_timeout: int | Omit = omit, + type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Monitor: """ Apply changes to an existing monitor, overwriting the supplied properties. Args: - account_id: Identifier + account_id: Identifier. allow_insecure: Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. @@ -540,13 +540,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Monitor: """ List a single configured monitor for an account. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -605,34 +605,34 @@ async def create( self, *, account_id: str, - allow_insecure: bool | NotGiven = NOT_GIVEN, - consecutive_down: int | NotGiven = NOT_GIVEN, - consecutive_up: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expected_body: str | NotGiven = NOT_GIVEN, - expected_codes: str | NotGiven = NOT_GIVEN, - follow_redirects: bool | NotGiven = NOT_GIVEN, - header: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - method: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - port: int | NotGiven = NOT_GIVEN, - probe_zone: str | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - load_balancer_monitor_timeout: int | NotGiven = NOT_GIVEN, - type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | NotGiven = NOT_GIVEN, + allow_insecure: bool | Omit = omit, + consecutive_down: int | Omit = omit, + consecutive_up: int | Omit = omit, + description: str | Omit = omit, + expected_body: str | Omit = omit, + expected_codes: str | Omit = omit, + follow_redirects: bool | Omit = omit, + header: Dict[str, SequenceNotStr[str]] | Omit = omit, + interval: int | Omit = omit, + method: str | Omit = omit, + path: str | Omit = omit, + port: int | Omit = omit, + probe_zone: str | Omit = omit, + retries: int | Omit = omit, + load_balancer_monitor_timeout: int | Omit = omit, + type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Monitor: """ Create a configured monitor. Args: - account_id: Identifier + account_id: Identifier. allow_insecure: Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. @@ -731,34 +731,34 @@ async def update( monitor_id: str, *, account_id: str, - allow_insecure: bool | NotGiven = NOT_GIVEN, - consecutive_down: int | NotGiven = NOT_GIVEN, - consecutive_up: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expected_body: str | NotGiven = NOT_GIVEN, - expected_codes: str | NotGiven = NOT_GIVEN, - follow_redirects: bool | NotGiven = NOT_GIVEN, - header: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - method: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - port: int | NotGiven = NOT_GIVEN, - probe_zone: str | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - load_balancer_monitor_timeout: int | NotGiven = NOT_GIVEN, - type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | NotGiven = NOT_GIVEN, + allow_insecure: bool | Omit = omit, + consecutive_down: int | Omit = omit, + consecutive_up: int | Omit = omit, + description: str | Omit = omit, + expected_body: str | Omit = omit, + expected_codes: str | Omit = omit, + follow_redirects: bool | Omit = omit, + header: Dict[str, SequenceNotStr[str]] | Omit = omit, + interval: int | Omit = omit, + method: str | Omit = omit, + path: str | Omit = omit, + port: int | Omit = omit, + probe_zone: str | Omit = omit, + retries: int | Omit = omit, + load_balancer_monitor_timeout: int | Omit = omit, + type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Monitor: """ Modify a configured monitor. Args: - account_id: Identifier + account_id: Identifier. allow_insecure: Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. @@ -863,13 +863,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Monitor, AsyncSinglePage[Monitor]]: """ List configured monitors for an account. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -900,13 +900,13 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MonitorDeleteResponse: """ Delete a configured monitor. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -937,34 +937,34 @@ async def edit( monitor_id: str, *, account_id: str, - allow_insecure: bool | NotGiven = NOT_GIVEN, - consecutive_down: int | NotGiven = NOT_GIVEN, - consecutive_up: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expected_body: str | NotGiven = NOT_GIVEN, - expected_codes: str | NotGiven = NOT_GIVEN, - follow_redirects: bool | NotGiven = NOT_GIVEN, - header: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - method: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - port: int | NotGiven = NOT_GIVEN, - probe_zone: str | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - load_balancer_monitor_timeout: int | NotGiven = NOT_GIVEN, - type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | NotGiven = NOT_GIVEN, + allow_insecure: bool | Omit = omit, + consecutive_down: int | Omit = omit, + consecutive_up: int | Omit = omit, + description: str | Omit = omit, + expected_body: str | Omit = omit, + expected_codes: str | Omit = omit, + follow_redirects: bool | Omit = omit, + header: Dict[str, SequenceNotStr[str]] | Omit = omit, + interval: int | Omit = omit, + method: str | Omit = omit, + path: str | Omit = omit, + port: int | Omit = omit, + probe_zone: str | Omit = omit, + retries: int | Omit = omit, + load_balancer_monitor_timeout: int | Omit = omit, + type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Monitor: """ Apply changes to an existing monitor, overwriting the supplied properties. Args: - account_id: Identifier + account_id: Identifier. allow_insecure: Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. @@ -1070,13 +1070,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Monitor: """ List a single configured monitor for an account. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/load_balancers/monitors/previews.py b/src/cloudflare/resources/load_balancers/monitors/previews.py index 50d9a0f2fe9..aceb7f5a462 100644 --- a/src/cloudflare/resources/load_balancers/monitors/previews.py +++ b/src/cloudflare/resources/load_balancers/monitors/previews.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Dict, List, Type, cast +from typing import Dict, Type, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,28 +50,28 @@ def create( monitor_id: str, *, account_id: str, - allow_insecure: bool | NotGiven = NOT_GIVEN, - consecutive_down: int | NotGiven = NOT_GIVEN, - consecutive_up: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expected_body: str | NotGiven = NOT_GIVEN, - expected_codes: str | NotGiven = NOT_GIVEN, - follow_redirects: bool | NotGiven = NOT_GIVEN, - header: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - method: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - port: int | NotGiven = NOT_GIVEN, - probe_zone: str | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - load_balancer_monitor_timeout: int | NotGiven = NOT_GIVEN, - type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | NotGiven = NOT_GIVEN, + allow_insecure: bool | Omit = omit, + consecutive_down: int | Omit = omit, + consecutive_up: int | Omit = omit, + description: str | Omit = omit, + expected_body: str | Omit = omit, + expected_codes: str | Omit = omit, + follow_redirects: bool | Omit = omit, + header: Dict[str, SequenceNotStr[str]] | Omit = omit, + interval: int | Omit = omit, + method: str | Omit = omit, + path: str | Omit = omit, + port: int | Omit = omit, + probe_zone: str | Omit = omit, + retries: int | Omit = omit, + load_balancer_monitor_timeout: int | Omit = omit, + type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewCreateResponse: """Preview pools using the specified monitor with provided monitor details. @@ -79,7 +79,7 @@ def create( returned preview_id can be used in the preview endpoint to retrieve the results. Args: - account_id: Identifier + account_id: Identifier. allow_insecure: Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. @@ -201,28 +201,28 @@ async def create( monitor_id: str, *, account_id: str, - allow_insecure: bool | NotGiven = NOT_GIVEN, - consecutive_down: int | NotGiven = NOT_GIVEN, - consecutive_up: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expected_body: str | NotGiven = NOT_GIVEN, - expected_codes: str | NotGiven = NOT_GIVEN, - follow_redirects: bool | NotGiven = NOT_GIVEN, - header: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - method: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - port: int | NotGiven = NOT_GIVEN, - probe_zone: str | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - load_balancer_monitor_timeout: int | NotGiven = NOT_GIVEN, - type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | NotGiven = NOT_GIVEN, + allow_insecure: bool | Omit = omit, + consecutive_down: int | Omit = omit, + consecutive_up: int | Omit = omit, + description: str | Omit = omit, + expected_body: str | Omit = omit, + expected_codes: str | Omit = omit, + follow_redirects: bool | Omit = omit, + header: Dict[str, SequenceNotStr[str]] | Omit = omit, + interval: int | Omit = omit, + method: str | Omit = omit, + path: str | Omit = omit, + port: int | Omit = omit, + probe_zone: str | Omit = omit, + retries: int | Omit = omit, + load_balancer_monitor_timeout: int | Omit = omit, + type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewCreateResponse: """Preview pools using the specified monitor with provided monitor details. @@ -230,7 +230,7 @@ async def create( returned preview_id can be used in the preview endpoint to retrieve the results. Args: - account_id: Identifier + account_id: Identifier. allow_insecure: Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. diff --git a/src/cloudflare/resources/load_balancers/monitors/references.py b/src/cloudflare/resources/load_balancers/monitors/references.py index f91dc316661..0730278f0df 100644 --- a/src/cloudflare/resources/load_balancers/monitors/references.py +++ b/src/cloudflare/resources/load_balancers/monitors/references.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -50,13 +50,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ReferenceGetResponse]: """ Get the list of resources that reference the provided monitor. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -110,13 +110,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ReferenceGetResponse, AsyncSinglePage[ReferenceGetResponse]]: """ Get the list of resources that reference the provided monitor. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/load_balancers/pools/health.py b/src/cloudflare/resources/load_balancers/pools/health.py index ebe58f49c2b..d5a46419742 100644 --- a/src/cloudflare/resources/load_balancers/pools/health.py +++ b/src/cloudflare/resources/load_balancers/pools/health.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Dict, List, Type, cast +from typing import Dict, Type, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,28 +51,28 @@ def create( pool_id: str, *, account_id: str, - allow_insecure: bool | NotGiven = NOT_GIVEN, - consecutive_down: int | NotGiven = NOT_GIVEN, - consecutive_up: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expected_body: str | NotGiven = NOT_GIVEN, - expected_codes: str | NotGiven = NOT_GIVEN, - follow_redirects: bool | NotGiven = NOT_GIVEN, - header: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - method: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - port: int | NotGiven = NOT_GIVEN, - probe_zone: str | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - load_balancer_monitor_timeout: int | NotGiven = NOT_GIVEN, - type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | NotGiven = NOT_GIVEN, + allow_insecure: bool | Omit = omit, + consecutive_down: int | Omit = omit, + consecutive_up: int | Omit = omit, + description: str | Omit = omit, + expected_body: str | Omit = omit, + expected_codes: str | Omit = omit, + follow_redirects: bool | Omit = omit, + header: Dict[str, SequenceNotStr[str]] | Omit = omit, + interval: int | Omit = omit, + method: str | Omit = omit, + path: str | Omit = omit, + port: int | Omit = omit, + probe_zone: str | Omit = omit, + retries: int | Omit = omit, + load_balancer_monitor_timeout: int | Omit = omit, + type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HealthCreateResponse: """Preview pool health using provided monitor details. @@ -80,7 +80,7 @@ def create( be used in the preview endpoint to retrieve the results. Args: - account_id: Identifier + account_id: Identifier. allow_insecure: Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. @@ -186,13 +186,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HealthGetResponse: """ Fetch the latest pool health status for a single pool. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -244,28 +244,28 @@ async def create( pool_id: str, *, account_id: str, - allow_insecure: bool | NotGiven = NOT_GIVEN, - consecutive_down: int | NotGiven = NOT_GIVEN, - consecutive_up: int | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - expected_body: str | NotGiven = NOT_GIVEN, - expected_codes: str | NotGiven = NOT_GIVEN, - follow_redirects: bool | NotGiven = NOT_GIVEN, - header: Dict[str, List[str]] | NotGiven = NOT_GIVEN, - interval: int | NotGiven = NOT_GIVEN, - method: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - port: int | NotGiven = NOT_GIVEN, - probe_zone: str | NotGiven = NOT_GIVEN, - retries: int | NotGiven = NOT_GIVEN, - load_balancer_monitor_timeout: int | NotGiven = NOT_GIVEN, - type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | NotGiven = NOT_GIVEN, + allow_insecure: bool | Omit = omit, + consecutive_down: int | Omit = omit, + consecutive_up: int | Omit = omit, + description: str | Omit = omit, + expected_body: str | Omit = omit, + expected_codes: str | Omit = omit, + follow_redirects: bool | Omit = omit, + header: Dict[str, SequenceNotStr[str]] | Omit = omit, + interval: int | Omit = omit, + method: str | Omit = omit, + path: str | Omit = omit, + port: int | Omit = omit, + probe_zone: str | Omit = omit, + retries: int | Omit = omit, + load_balancer_monitor_timeout: int | Omit = omit, + type: Literal["http", "https", "tcp", "udp_icmp", "icmp_ping", "smtp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HealthCreateResponse: """Preview pool health using provided monitor details. @@ -273,7 +273,7 @@ async def create( be used in the preview endpoint to retrieve the results. Args: - account_id: Identifier + account_id: Identifier. allow_insecure: Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors. @@ -379,13 +379,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HealthGetResponse: """ Fetch the latest pool health status for a single pool. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/load_balancers/pools/pools.py b/src/cloudflare/resources/load_balancers/pools/pools.py index 4796afced92..5f47f1da0c5 100644 --- a/src/cloudflare/resources/load_balancers/pools/pools.py +++ b/src/cloudflare/resources/load_balancers/pools/pools.py @@ -15,7 +15,7 @@ HealthResourceWithStreamingResponse, AsyncHealthResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .references import ( @@ -88,28 +88,29 @@ def create( account_id: str, name: str, origins: Iterable[OriginParam], - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - latitude: float | NotGiven = NOT_GIVEN, - load_shedding: LoadSheddingParam | NotGiven = NOT_GIVEN, - longitude: float | NotGiven = NOT_GIVEN, - minimum_origins: int | NotGiven = NOT_GIVEN, - monitor: str | NotGiven = NOT_GIVEN, - notification_email: str | NotGiven = NOT_GIVEN, - notification_filter: Optional[NotificationFilterParam] | NotGiven = NOT_GIVEN, - origin_steering: OriginSteeringParam | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + enabled: bool | Omit = omit, + latitude: float | Omit = omit, + load_shedding: LoadSheddingParam | Omit = omit, + longitude: float | Omit = omit, + minimum_origins: int | Omit = omit, + monitor: str | Omit = omit, + monitor_group: str | Omit = omit, + notification_email: str | Omit = omit, + notification_filter: Optional[NotificationFilterParam] | Omit = omit, + origin_steering: OriginSteeringParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Pool: """ Create a new pool. Args: - account_id: Identifier + account_id: Identifier. name: A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. @@ -138,6 +139,9 @@ def create( monitor: The ID of the Monitor to use for checking the health of origins within this pool. + monitor_group: The ID of the Monitor Group to use for checking the health of origins within + this pool. + notification_email: This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address @@ -173,6 +177,7 @@ def create( "longitude": longitude, "minimum_origins": minimum_origins, "monitor": monitor, + "monitor_group": monitor_group, "notification_email": notification_email, "notification_filter": notification_filter, "origin_steering": origin_steering, @@ -196,29 +201,30 @@ def update( account_id: str, name: str, origins: Iterable[OriginParam], - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - latitude: float | NotGiven = NOT_GIVEN, - load_shedding: LoadSheddingParam | NotGiven = NOT_GIVEN, - longitude: float | NotGiven = NOT_GIVEN, - minimum_origins: int | NotGiven = NOT_GIVEN, - monitor: str | NotGiven = NOT_GIVEN, - notification_email: str | NotGiven = NOT_GIVEN, - notification_filter: Optional[NotificationFilterParam] | NotGiven = NOT_GIVEN, - origin_steering: OriginSteeringParam | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + latitude: float | Omit = omit, + load_shedding: LoadSheddingParam | Omit = omit, + longitude: float | Omit = omit, + minimum_origins: int | Omit = omit, + monitor: str | Omit = omit, + monitor_group: str | Omit = omit, + notification_email: str | Omit = omit, + notification_filter: Optional[NotificationFilterParam] | Omit = omit, + origin_steering: OriginSteeringParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Pool: """ Modify a configured pool. Args: - account_id: Identifier + account_id: Identifier. name: A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. @@ -250,6 +256,9 @@ def update( monitor: The ID of the Monitor to use for checking the health of origins within this pool. + monitor_group: The ID of the Monitor Group to use for checking the health of origins within + this pool. + notification_email: This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address @@ -288,6 +297,7 @@ def update( "longitude": longitude, "minimum_origins": minimum_origins, "monitor": monitor, + "monitor_group": monitor_group, "notification_email": notification_email, "notification_filter": notification_filter, "origin_steering": origin_steering, @@ -308,19 +318,19 @@ def list( self, *, account_id: str, - monitor: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Pool]: """ List configured pools. Args: - account_id: Identifier + account_id: Identifier. monitor: The ID of the Monitor to use for checking the health of origins within this pool. @@ -358,13 +368,13 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PoolDeleteResponse: """ Delete a configured pool. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -394,13 +404,13 @@ def bulk_edit( self, *, account_id: str, - notification_email: Literal[""] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Pool]: """Apply changes to a number of existing pools, overwriting the supplied properties. @@ -410,7 +420,7 @@ def bulk_edit( `limit`/`offset` or `per_page`/`page`. Args: - account_id: Identifier + account_id: Identifier. notification_email: The email address to send health status notifications to. This field is now deprecated in favor of Cloudflare Notifications for Load Balancing, so only @@ -442,31 +452,32 @@ def edit( pool_id: str, *, account_id: str, - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - latitude: float | NotGiven = NOT_GIVEN, - load_shedding: LoadSheddingParam | NotGiven = NOT_GIVEN, - longitude: float | NotGiven = NOT_GIVEN, - minimum_origins: int | NotGiven = NOT_GIVEN, - monitor: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - notification_email: str | NotGiven = NOT_GIVEN, - notification_filter: Optional[NotificationFilterParam] | NotGiven = NOT_GIVEN, - origin_steering: OriginSteeringParam | NotGiven = NOT_GIVEN, - origins: Iterable[OriginParam] | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + latitude: float | Omit = omit, + load_shedding: LoadSheddingParam | Omit = omit, + longitude: float | Omit = omit, + minimum_origins: int | Omit = omit, + monitor: str | Omit = omit, + monitor_group: str | Omit = omit, + name: str | Omit = omit, + notification_email: str | Omit = omit, + notification_filter: Optional[NotificationFilterParam] | Omit = omit, + origin_steering: OriginSteeringParam | Omit = omit, + origins: Iterable[OriginParam] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Pool: """ Apply changes to an existing pool, overwriting the supplied properties. Args: - account_id: Identifier + account_id: Identifier. check_regions: A list of regions from which to run health checks. Null means every Cloudflare data center. @@ -492,6 +503,9 @@ def edit( monitor: The ID of the Monitor to use for checking the health of origins within this pool. + monitor_group: The ID of the Monitor Group to use for checking the health of origins within + this pool. + name: A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. @@ -534,6 +548,7 @@ def edit( "longitude": longitude, "minimum_origins": minimum_origins, "monitor": monitor, + "monitor_group": monitor_group, "name": name, "notification_email": notification_email, "notification_filter": notification_filter, @@ -562,13 +577,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Pool: """ Fetch a single configured pool. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -629,28 +644,29 @@ async def create( account_id: str, name: str, origins: Iterable[OriginParam], - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - latitude: float | NotGiven = NOT_GIVEN, - load_shedding: LoadSheddingParam | NotGiven = NOT_GIVEN, - longitude: float | NotGiven = NOT_GIVEN, - minimum_origins: int | NotGiven = NOT_GIVEN, - monitor: str | NotGiven = NOT_GIVEN, - notification_email: str | NotGiven = NOT_GIVEN, - notification_filter: Optional[NotificationFilterParam] | NotGiven = NOT_GIVEN, - origin_steering: OriginSteeringParam | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + enabled: bool | Omit = omit, + latitude: float | Omit = omit, + load_shedding: LoadSheddingParam | Omit = omit, + longitude: float | Omit = omit, + minimum_origins: int | Omit = omit, + monitor: str | Omit = omit, + monitor_group: str | Omit = omit, + notification_email: str | Omit = omit, + notification_filter: Optional[NotificationFilterParam] | Omit = omit, + origin_steering: OriginSteeringParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Pool: """ Create a new pool. Args: - account_id: Identifier + account_id: Identifier. name: A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. @@ -679,6 +695,9 @@ async def create( monitor: The ID of the Monitor to use for checking the health of origins within this pool. + monitor_group: The ID of the Monitor Group to use for checking the health of origins within + this pool. + notification_email: This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address @@ -714,6 +733,7 @@ async def create( "longitude": longitude, "minimum_origins": minimum_origins, "monitor": monitor, + "monitor_group": monitor_group, "notification_email": notification_email, "notification_filter": notification_filter, "origin_steering": origin_steering, @@ -737,29 +757,30 @@ async def update( account_id: str, name: str, origins: Iterable[OriginParam], - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - latitude: float | NotGiven = NOT_GIVEN, - load_shedding: LoadSheddingParam | NotGiven = NOT_GIVEN, - longitude: float | NotGiven = NOT_GIVEN, - minimum_origins: int | NotGiven = NOT_GIVEN, - monitor: str | NotGiven = NOT_GIVEN, - notification_email: str | NotGiven = NOT_GIVEN, - notification_filter: Optional[NotificationFilterParam] | NotGiven = NOT_GIVEN, - origin_steering: OriginSteeringParam | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + latitude: float | Omit = omit, + load_shedding: LoadSheddingParam | Omit = omit, + longitude: float | Omit = omit, + minimum_origins: int | Omit = omit, + monitor: str | Omit = omit, + monitor_group: str | Omit = omit, + notification_email: str | Omit = omit, + notification_filter: Optional[NotificationFilterParam] | Omit = omit, + origin_steering: OriginSteeringParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Pool: """ Modify a configured pool. Args: - account_id: Identifier + account_id: Identifier. name: A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. @@ -791,6 +812,9 @@ async def update( monitor: The ID of the Monitor to use for checking the health of origins within this pool. + monitor_group: The ID of the Monitor Group to use for checking the health of origins within + this pool. + notification_email: This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address @@ -829,6 +853,7 @@ async def update( "longitude": longitude, "minimum_origins": minimum_origins, "monitor": monitor, + "monitor_group": monitor_group, "notification_email": notification_email, "notification_filter": notification_filter, "origin_steering": origin_steering, @@ -849,19 +874,19 @@ def list( self, *, account_id: str, - monitor: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Pool, AsyncSinglePage[Pool]]: """ List configured pools. Args: - account_id: Identifier + account_id: Identifier. monitor: The ID of the Monitor to use for checking the health of origins within this pool. @@ -899,13 +924,13 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PoolDeleteResponse: """ Delete a configured pool. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -935,13 +960,13 @@ def bulk_edit( self, *, account_id: str, - notification_email: Literal[""] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Pool, AsyncSinglePage[Pool]]: """Apply changes to a number of existing pools, overwriting the supplied properties. @@ -951,7 +976,7 @@ def bulk_edit( `limit`/`offset` or `per_page`/`page`. Args: - account_id: Identifier + account_id: Identifier. notification_email: The email address to send health status notifications to. This field is now deprecated in favor of Cloudflare Notifications for Load Balancing, so only @@ -983,31 +1008,32 @@ async def edit( pool_id: str, *, account_id: str, - check_regions: Optional[List[CheckRegion]] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - latitude: float | NotGiven = NOT_GIVEN, - load_shedding: LoadSheddingParam | NotGiven = NOT_GIVEN, - longitude: float | NotGiven = NOT_GIVEN, - minimum_origins: int | NotGiven = NOT_GIVEN, - monitor: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - notification_email: str | NotGiven = NOT_GIVEN, - notification_filter: Optional[NotificationFilterParam] | NotGiven = NOT_GIVEN, - origin_steering: OriginSteeringParam | NotGiven = NOT_GIVEN, - origins: Iterable[OriginParam] | NotGiven = NOT_GIVEN, + check_regions: Optional[List[CheckRegion]] | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + latitude: float | Omit = omit, + load_shedding: LoadSheddingParam | Omit = omit, + longitude: float | Omit = omit, + minimum_origins: int | Omit = omit, + monitor: str | Omit = omit, + monitor_group: str | Omit = omit, + name: str | Omit = omit, + notification_email: str | Omit = omit, + notification_filter: Optional[NotificationFilterParam] | Omit = omit, + origin_steering: OriginSteeringParam | Omit = omit, + origins: Iterable[OriginParam] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Pool: """ Apply changes to an existing pool, overwriting the supplied properties. Args: - account_id: Identifier + account_id: Identifier. check_regions: A list of regions from which to run health checks. Null means every Cloudflare data center. @@ -1033,6 +1059,9 @@ async def edit( monitor: The ID of the Monitor to use for checking the health of origins within this pool. + monitor_group: The ID of the Monitor Group to use for checking the health of origins within + this pool. + name: A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed. @@ -1075,6 +1104,7 @@ async def edit( "longitude": longitude, "minimum_origins": minimum_origins, "monitor": monitor, + "monitor_group": monitor_group, "name": name, "notification_email": notification_email, "notification_filter": notification_filter, @@ -1103,13 +1133,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Pool: """ Fetch a single configured pool. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/load_balancers/pools/references.py b/src/cloudflare/resources/load_balancers/pools/references.py index 1278c53d179..2bdf9464def 100644 --- a/src/cloudflare/resources/load_balancers/pools/references.py +++ b/src/cloudflare/resources/load_balancers/pools/references.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -50,13 +50,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ReferenceGetResponse]: """ Get the list of resources that reference the provided pool. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -110,13 +110,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ReferenceGetResponse, AsyncSinglePage[ReferenceGetResponse]]: """ Get the list of resources that reference the provided pool. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/load_balancers/previews.py b/src/cloudflare/resources/load_balancers/previews.py index 73f409f054a..9aa003c8728 100644 --- a/src/cloudflare/resources/load_balancers/previews.py +++ b/src/cloudflare/resources/load_balancers/previews.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -52,13 +52,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewGetResponse: """ Get the result of a previous preview operation using the provided preview_id. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -115,13 +115,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewGetResponse: """ Get the result of a previous preview operation using the provided preview_id. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/load_balancers/regions.py b/src/cloudflare/resources/load_balancers/regions.py index 70733922a92..d885fe0838d 100644 --- a/src/cloudflare/resources/load_balancers/regions.py +++ b/src/cloudflare/resources/load_balancers/regions.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,21 +50,21 @@ def list( self, *, account_id: str, - country_code_a2: str | NotGiven = NOT_GIVEN, - subdivision_code: str | NotGiven = NOT_GIVEN, - subdivision_code_a2: str | NotGiven = NOT_GIVEN, + country_code_a2: str | Omit = omit, + subdivision_code: str | Omit = omit, + subdivision_code_a2: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RegionListResponse: """ List all region mappings. Args: - account_id: Identifier + account_id: Identifier. country_code_a2: Two-letter alpha-2 country code followed in ISO 3166-1. @@ -119,13 +119,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RegionGetResponse: """ Get a single region mapping. Args: - account_id: Identifier + account_id: Identifier. region_id: A list of Cloudflare regions. WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, @@ -187,21 +187,21 @@ async def list( self, *, account_id: str, - country_code_a2: str | NotGiven = NOT_GIVEN, - subdivision_code: str | NotGiven = NOT_GIVEN, - subdivision_code_a2: str | NotGiven = NOT_GIVEN, + country_code_a2: str | Omit = omit, + subdivision_code: str | Omit = omit, + subdivision_code_a2: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RegionListResponse: """ List all region mappings. Args: - account_id: Identifier + account_id: Identifier. country_code_a2: Two-letter alpha-2 country code followed in ISO 3166-1. @@ -256,13 +256,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RegionGetResponse: """ Get a single region mapping. Args: - account_id: Identifier + account_id: Identifier. region_id: A list of Cloudflare regions. WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, diff --git a/src/cloudflare/resources/load_balancers/searches.py b/src/cloudflare/resources/load_balancers/searches.py index 346a0832936..0bf1c0e6e04 100644 --- a/src/cloudflare/resources/load_balancers/searches.py +++ b/src/cloudflare/resources/load_balancers/searches.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,22 +48,22 @@ def list( self, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - query: str | NotGiven = NOT_GIVEN, - references: Literal["", "*", "referral", "referrer"] | NotGiven = NOT_GIVEN, + page: float | Omit = omit, + per_page: float | Omit = omit, + query: str | Omit = omit, + references: Literal["", "*", "referral", "referrer"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[SearchListResponse]: """ Search for Load Balancing resources. Args: - account_id: Identifier + account_id: Identifier. query: Search query term. @@ -126,22 +126,22 @@ def list( self, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - query: str | NotGiven = NOT_GIVEN, - references: Literal["", "*", "referral", "referrer"] | NotGiven = NOT_GIVEN, + page: float | Omit = omit, + per_page: float | Omit = omit, + query: str | Omit = omit, + references: Literal["", "*", "referral", "referrer"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SearchListResponse, AsyncV4PagePagination[SearchListResponse]]: """ Search for Load Balancing resources. Args: - account_id: Identifier + account_id: Identifier. query: Search query term. diff --git a/src/cloudflare/resources/logpush/datasets/fields.py b/src/cloudflare/resources/logpush/datasets/fields.py index 99ef23f9902..8d3be479e80 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 NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -48,6 +48,7 @@ def get( Literal[ "access_requests", "audit_logs", + "audit_logs_v2", "biso_user_actions", "casb_findings", "device_posture_results", @@ -73,18 +74,18 @@ def get( ] ], *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Lists all fields available for a dataset. - The response result is an object with + The response result is. an object with key-value pairs, where keys are field names, and values are descriptions. Args: @@ -156,6 +157,7 @@ async def get( Literal[ "access_requests", "audit_logs", + "audit_logs_v2", "biso_user_actions", "casb_findings", "device_posture_results", @@ -181,18 +183,18 @@ async def get( ] ], *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Lists all fields available for a dataset. - The response result is an object with + The response result is. an object with key-value pairs, where keys are field names, and values are descriptions. Args: diff --git a/src/cloudflare/resources/logpush/datasets/jobs.py b/src/cloudflare/resources/logpush/datasets/jobs.py index 8ab7f2d709b..1e13aa37bc4 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 NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -49,6 +49,7 @@ def get( Literal[ "access_requests", "audit_logs", + "audit_logs_v2", "biso_user_actions", "casb_findings", "device_posture_results", @@ -74,14 +75,14 @@ def get( ] ], *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Optional[LogpushJob]]: """ Lists Logpush jobs for an account or zone for a dataset. @@ -152,6 +153,7 @@ def get( Literal[ "access_requests", "audit_logs", + "audit_logs_v2", "biso_user_actions", "casb_findings", "device_posture_results", @@ -177,14 +179,14 @@ def get( ] ], *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[LogpushJob], AsyncSinglePage[Optional[LogpushJob]]]: """ Lists Logpush jobs for an account or zone for a dataset. diff --git a/src/cloudflare/resources/logpush/edge.py b/src/cloudflare/resources/logpush/edge.py index 51e10cea84b..5404dffd698 100644 --- a/src/cloudflare/resources/logpush/edge.py +++ b/src/cloudflare/resources/logpush/edge.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,15 +49,15 @@ def create( self, *, zone_id: str, - fields: str | NotGiven = NOT_GIVEN, - filter: str | NotGiven = NOT_GIVEN, - sample: int | NotGiven = NOT_GIVEN, + fields: str | Omit = omit, + filter: str | Omit = omit, + sample: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[InstantLogpushJob]: """ Creates a new Instant Logs job for a zone. @@ -84,7 +84,7 @@ def create( 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}/logpush/edge", + f"/zones/{zone_id}/logpush/edge/jobs", body=maybe_transform( { "fields": fields, @@ -112,7 +112,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Optional[InstantLogpushJob]]: """ Lists Instant Logs jobs for a zone. @@ -131,7 +131,7 @@ def get( 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}/logpush/edge", + f"/zones/{zone_id}/logpush/edge/jobs", page=SyncSinglePage[Optional[InstantLogpushJob]], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -164,15 +164,15 @@ async def create( self, *, zone_id: str, - fields: str | NotGiven = NOT_GIVEN, - filter: str | NotGiven = NOT_GIVEN, - sample: int | NotGiven = NOT_GIVEN, + fields: str | Omit = omit, + filter: str | Omit = omit, + sample: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[InstantLogpushJob]: """ Creates a new Instant Logs job for a zone. @@ -199,7 +199,7 @@ async def create( 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}/logpush/edge", + f"/zones/{zone_id}/logpush/edge/jobs", body=await async_maybe_transform( { "fields": fields, @@ -227,7 +227,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[InstantLogpushJob], AsyncSinglePage[Optional[InstantLogpushJob]]]: """ Lists Instant Logs jobs for a zone. @@ -246,7 +246,7 @@ def get( 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}/logpush/edge", + f"/zones/{zone_id}/logpush/edge/jobs", page=AsyncSinglePage[Optional[InstantLogpushJob]], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout diff --git a/src/cloudflare/resources/logpush/jobs.py b/src/cloudflare/resources/logpush/jobs.py index fd6b3035775..4560c03365f 100644 --- a/src/cloudflare/resources/logpush/jobs.py +++ b/src/cloudflare/resources/logpush/jobs.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, Union, Optional, cast from typing_extensions import Literal import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,12 +52,13 @@ def create( self, *, destination_conf: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dataset: Optional[ Literal[ "access_requests", "audit_logs", + "audit_logs_v2", "biso_user_actions", "casb_findings", "device_posture_results", @@ -82,31 +83,31 @@ def create( "zero_trust_network_sessions", ] ] - | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - filter: Optional[str] | NotGiven = NOT_GIVEN, - frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN, - kind: Literal["edge"] | NotGiven = NOT_GIVEN, - logpull_options: Optional[str] | NotGiven = NOT_GIVEN, - max_upload_bytes: Optional[int] | NotGiven = NOT_GIVEN, - max_upload_interval_seconds: Optional[int] | NotGiven = NOT_GIVEN, - max_upload_records: Optional[int] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, - output_options: Optional[OutputOptionsParam] | NotGiven = NOT_GIVEN, - ownership_challenge: str | NotGiven = NOT_GIVEN, + | Omit = omit, + enabled: bool | Omit = omit, + filter: Optional[str] | Omit = omit, + frequency: Optional[Literal["high", "low"]] | Omit = omit, + kind: Literal["", "edge"] | Omit = omit, + logpull_options: Optional[str] | Omit = omit, + max_upload_bytes: Union[Literal[0], int, None] | Omit = omit, + max_upload_interval_seconds: Union[Literal[0], int, None] | Omit = omit, + max_upload_records: Union[Literal[0], int, None] | Omit = omit, + name: Optional[str] | Omit = omit, + output_options: Optional[OutputOptionsParam] | Omit = omit, + ownership_challenge: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LogpushJob]: """ Creates a new Logpush job for an account or zone. Args: - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -122,14 +123,13 @@ def create( more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/). - frequency: This field is deprecated. Please use `max_upload_*` parameters instead. The + frequency: This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files. kind: The kind parameter (optional) is used to differentiate between Logpush and Edge - Log Delivery jobs. Currently, Edge Log Delivery is only supported for the - `http_requests` dataset. + Log Delivery jobs (when supported by the dataset). logpull_options: This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from @@ -140,21 +140,19 @@ def create( max_upload_bytes: The maximum uncompressed file size of a batch of logs. This setting value must be between `5 MB` and `1 GB`, or `0` to disable it. Note that you cannot set a minimum file size; this means that log files may be much smaller than this batch - size. This parameter is not available for jobs with `edge` as its kind. + size. max_upload_interval_seconds: The maximum interval in seconds for log batches. This setting must be between 30 and 300 seconds (5 minutes), or `0` to disable it. Note that you cannot specify a minimum interval for log batches; this means that log files may be sent in - shorter intervals than this. This parameter is only used for jobs with `edge` as - its kind. + shorter intervals than this. max_upload_records: The maximum number of log lines per batch. This setting must be between 1000 and 1,000,000 lines, or `0` to disable it. Note that you cannot specify a minimum number of log lines per batch; this means that log files may contain many fewer - lines than this. This parameter is not available for jobs with `edge` as its - kind. + lines than this. - name: Optional human readable job name. Not unique. Cloudflare suggests that you set + name: Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job. @@ -217,26 +215,26 @@ def update( self, job_id: int, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - destination_conf: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - filter: Optional[str] | NotGiven = NOT_GIVEN, - frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN, - kind: Literal["edge"] | NotGiven = NOT_GIVEN, - logpull_options: Optional[str] | NotGiven = NOT_GIVEN, - max_upload_bytes: Optional[int] | NotGiven = NOT_GIVEN, - max_upload_interval_seconds: Optional[int] | NotGiven = NOT_GIVEN, - max_upload_records: Optional[int] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, - output_options: Optional[OutputOptionsParam] | NotGiven = NOT_GIVEN, - ownership_challenge: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + destination_conf: str | Omit = omit, + enabled: bool | Omit = omit, + filter: Optional[str] | Omit = omit, + frequency: Optional[Literal["high", "low"]] | Omit = omit, + kind: Literal["", "edge"] | Omit = omit, + logpull_options: Optional[str] | Omit = omit, + max_upload_bytes: Union[Literal[0], int, None] | Omit = omit, + max_upload_interval_seconds: Union[Literal[0], int, None] | Omit = omit, + max_upload_records: Union[Literal[0], int, None] | Omit = omit, + name: Optional[str] | Omit = omit, + output_options: Optional[OutputOptionsParam] | Omit = omit, + ownership_challenge: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LogpushJob]: """ Updates a Logpush job. @@ -248,8 +246,8 @@ def update( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. enabled: Flag that indicates if the job is enabled. @@ -258,14 +256,13 @@ def update( more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/). - frequency: This field is deprecated. Please use `max_upload_*` parameters instead. The + frequency: This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files. kind: The kind parameter (optional) is used to differentiate between Logpush and Edge - Log Delivery jobs. Currently, Edge Log Delivery is only supported for the - `http_requests` dataset. + Log Delivery jobs (when supported by the dataset). logpull_options: This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from @@ -276,21 +273,19 @@ def update( max_upload_bytes: The maximum uncompressed file size of a batch of logs. This setting value must be between `5 MB` and `1 GB`, or `0` to disable it. Note that you cannot set a minimum file size; this means that log files may be much smaller than this batch - size. This parameter is not available for jobs with `edge` as its kind. + size. max_upload_interval_seconds: The maximum interval in seconds for log batches. This setting must be between 30 and 300 seconds (5 minutes), or `0` to disable it. Note that you cannot specify a minimum interval for log batches; this means that log files may be sent in - shorter intervals than this. This parameter is only used for jobs with `edge` as - its kind. + shorter intervals than this. max_upload_records: The maximum number of log lines per batch. This setting must be between 1000 and 1,000,000 lines, or `0` to disable it. Note that you cannot specify a minimum number of log lines per batch; this means that log files may contain many fewer - lines than this. This parameter is not available for jobs with `edge` as its - kind. + lines than this. - name: Optional human readable job name. Not unique. Cloudflare suggests that you set + name: Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job. @@ -351,14 +346,14 @@ def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Optional[LogpushJob]]: """ Lists Logpush jobs for an account or zone. @@ -401,14 +396,14 @@ def delete( self, job_id: int, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[JobDeleteResponse]: """ Deletes a Logpush job. @@ -456,14 +451,14 @@ def get( self, job_id: int, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LogpushJob]: """ Gets the details of a Logpush job. @@ -532,12 +527,13 @@ async def create( self, *, destination_conf: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dataset: Optional[ Literal[ "access_requests", "audit_logs", + "audit_logs_v2", "biso_user_actions", "casb_findings", "device_posture_results", @@ -562,31 +558,31 @@ async def create( "zero_trust_network_sessions", ] ] - | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - filter: Optional[str] | NotGiven = NOT_GIVEN, - frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN, - kind: Literal["edge"] | NotGiven = NOT_GIVEN, - logpull_options: Optional[str] | NotGiven = NOT_GIVEN, - max_upload_bytes: Optional[int] | NotGiven = NOT_GIVEN, - max_upload_interval_seconds: Optional[int] | NotGiven = NOT_GIVEN, - max_upload_records: Optional[int] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, - output_options: Optional[OutputOptionsParam] | NotGiven = NOT_GIVEN, - ownership_challenge: str | NotGiven = NOT_GIVEN, + | Omit = omit, + enabled: bool | Omit = omit, + filter: Optional[str] | Omit = omit, + frequency: Optional[Literal["high", "low"]] | Omit = omit, + kind: Literal["", "edge"] | Omit = omit, + logpull_options: Optional[str] | Omit = omit, + max_upload_bytes: Union[Literal[0], int, None] | Omit = omit, + max_upload_interval_seconds: Union[Literal[0], int, None] | Omit = omit, + max_upload_records: Union[Literal[0], int, None] | Omit = omit, + name: Optional[str] | Omit = omit, + output_options: Optional[OutputOptionsParam] | Omit = omit, + ownership_challenge: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LogpushJob]: """ Creates a new Logpush job for an account or zone. Args: - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -602,14 +598,13 @@ async def create( more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/). - frequency: This field is deprecated. Please use `max_upload_*` parameters instead. The + frequency: This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files. kind: The kind parameter (optional) is used to differentiate between Logpush and Edge - Log Delivery jobs. Currently, Edge Log Delivery is only supported for the - `http_requests` dataset. + Log Delivery jobs (when supported by the dataset). logpull_options: This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from @@ -620,21 +615,19 @@ async def create( max_upload_bytes: The maximum uncompressed file size of a batch of logs. This setting value must be between `5 MB` and `1 GB`, or `0` to disable it. Note that you cannot set a minimum file size; this means that log files may be much smaller than this batch - size. This parameter is not available for jobs with `edge` as its kind. + size. max_upload_interval_seconds: The maximum interval in seconds for log batches. This setting must be between 30 and 300 seconds (5 minutes), or `0` to disable it. Note that you cannot specify a minimum interval for log batches; this means that log files may be sent in - shorter intervals than this. This parameter is only used for jobs with `edge` as - its kind. + shorter intervals than this. max_upload_records: The maximum number of log lines per batch. This setting must be between 1000 and 1,000,000 lines, or `0` to disable it. Note that you cannot specify a minimum number of log lines per batch; this means that log files may contain many fewer - lines than this. This parameter is not available for jobs with `edge` as its - kind. + lines than this. - name: Optional human readable job name. Not unique. Cloudflare suggests that you set + name: Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job. @@ -697,26 +690,26 @@ async def update( self, job_id: int, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - destination_conf: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - filter: Optional[str] | NotGiven = NOT_GIVEN, - frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN, - kind: Literal["edge"] | NotGiven = NOT_GIVEN, - logpull_options: Optional[str] | NotGiven = NOT_GIVEN, - max_upload_bytes: Optional[int] | NotGiven = NOT_GIVEN, - max_upload_interval_seconds: Optional[int] | NotGiven = NOT_GIVEN, - max_upload_records: Optional[int] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, - output_options: Optional[OutputOptionsParam] | NotGiven = NOT_GIVEN, - ownership_challenge: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + destination_conf: str | Omit = omit, + enabled: bool | Omit = omit, + filter: Optional[str] | Omit = omit, + frequency: Optional[Literal["high", "low"]] | Omit = omit, + kind: Literal["", "edge"] | Omit = omit, + logpull_options: Optional[str] | Omit = omit, + max_upload_bytes: Union[Literal[0], int, None] | Omit = omit, + max_upload_interval_seconds: Union[Literal[0], int, None] | Omit = omit, + max_upload_records: Union[Literal[0], int, None] | Omit = omit, + name: Optional[str] | Omit = omit, + output_options: Optional[OutputOptionsParam] | Omit = omit, + ownership_challenge: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LogpushJob]: """ Updates a Logpush job. @@ -728,8 +721,8 @@ async def update( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. enabled: Flag that indicates if the job is enabled. @@ -738,14 +731,13 @@ async def update( more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/). - frequency: This field is deprecated. Please use `max_upload_*` parameters instead. The + frequency: This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files. kind: The kind parameter (optional) is used to differentiate between Logpush and Edge - Log Delivery jobs. Currently, Edge Log Delivery is only supported for the - `http_requests` dataset. + Log Delivery jobs (when supported by the dataset). logpull_options: This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from @@ -756,21 +748,19 @@ async def update( max_upload_bytes: The maximum uncompressed file size of a batch of logs. This setting value must be between `5 MB` and `1 GB`, or `0` to disable it. Note that you cannot set a minimum file size; this means that log files may be much smaller than this batch - size. This parameter is not available for jobs with `edge` as its kind. + size. max_upload_interval_seconds: The maximum interval in seconds for log batches. This setting must be between 30 and 300 seconds (5 minutes), or `0` to disable it. Note that you cannot specify a minimum interval for log batches; this means that log files may be sent in - shorter intervals than this. This parameter is only used for jobs with `edge` as - its kind. + shorter intervals than this. max_upload_records: The maximum number of log lines per batch. This setting must be between 1000 and 1,000,000 lines, or `0` to disable it. Note that you cannot specify a minimum number of log lines per batch; this means that log files may contain many fewer - lines than this. This parameter is not available for jobs with `edge` as its - kind. + lines than this. - name: Optional human readable job name. Not unique. Cloudflare suggests that you set + name: Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job. @@ -831,14 +821,14 @@ async def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[LogpushJob], AsyncSinglePage[Optional[LogpushJob]]]: """ Lists Logpush jobs for an account or zone. @@ -881,14 +871,14 @@ async def delete( self, job_id: int, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[JobDeleteResponse]: """ Deletes a Logpush job. @@ -936,14 +926,14 @@ async def get( self, job_id: int, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LogpushJob]: """ Gets the details of a Logpush job. diff --git a/src/cloudflare/resources/logpush/ownership.py b/src/cloudflare/resources/logpush/ownership.py index 2c3f41295c0..c10b76d96c2 100644 --- a/src/cloudflare/resources/logpush/ownership.py +++ b/src/cloudflare/resources/logpush/ownership.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,21 +49,21 @@ def create( self, *, destination_conf: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OwnershipCreateResponse]: """ Gets a new ownership challenge sent to your destination. Args: - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -108,21 +108,21 @@ def validate( *, destination_conf: str, ownership_challenge: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OwnershipValidation]: """ Validates ownership challenge of the destination. Args: - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. ownership_challenge: Ownership challenge token to prove destination ownership. @@ -195,21 +195,21 @@ async def create( self, *, destination_conf: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OwnershipCreateResponse]: """ Gets a new ownership challenge sent to your destination. Args: - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -256,21 +256,21 @@ async def validate( *, destination_conf: str, ownership_challenge: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OwnershipValidation]: """ Validates ownership challenge of the destination. Args: - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. ownership_challenge: Ownership challenge token to prove destination ownership. diff --git a/src/cloudflare/resources/logpush/validate.py b/src/cloudflare/resources/logpush/validate.py index 79c2d6d70f9..cfeeb0f3af0 100644 --- a/src/cloudflare/resources/logpush/validate.py +++ b/src/cloudflare/resources/logpush/validate.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,21 +50,21 @@ def destination( self, *, destination_conf: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ValidateDestinationResponse]: """ Validates destination. Args: - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -110,21 +110,21 @@ def destination_exists( self, *, destination_conf: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ValidateDestinationExistsResponse]: """ Checks if there is an existing job with a destination. Args: - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -173,14 +173,14 @@ def origin( self, *, logpull_options: Optional[str], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ValidateOriginResponse]: """ Validates logpull origin with logpull_options. @@ -254,21 +254,21 @@ async def destination( self, *, destination_conf: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ValidateDestinationResponse]: """ Validates destination. Args: - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -314,21 +314,21 @@ async def destination_exists( self, *, destination_conf: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ValidateDestinationExistsResponse]: """ Checks if there is an existing job with a destination. Args: - destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - Additional configuration parameters supported by the destination may be + destination_conf: Uniquely identifies a resource (such as an s3 bucket) where data. will be + pushed. Additional configuration parameters supported by the destination may be included. account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -377,14 +377,14 @@ async def origin( self, *, logpull_options: Optional[str], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ValidateOriginResponse]: """ Validates logpull origin with logpull_options. diff --git a/src/cloudflare/resources/logs/control/cmb/config.py b/src/cloudflare/resources/logs/control/cmb/config.py index 7d18ee257da..bf0fe2e3c0c 100644 --- a/src/cloudflare/resources/logs/control/cmb/config.py +++ b/src/cloudflare/resources/logs/control/cmb/config.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,14 +48,14 @@ def create( self, *, account_id: str, - allow_out_of_region_access: bool | NotGiven = NOT_GIVEN, - regions: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CmbConfig]: """ Updates CMB config. @@ -105,7 +105,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes CMB config. @@ -144,7 +144,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CmbConfig]: """ Gets CMB config. @@ -199,14 +199,14 @@ async def create( self, *, account_id: str, - allow_out_of_region_access: bool | NotGiven = NOT_GIVEN, - regions: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CmbConfig]: """ Updates CMB config. @@ -256,7 +256,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes CMB config. @@ -295,7 +295,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CmbConfig]: """ Gets CMB config. diff --git a/src/cloudflare/resources/logs/control/retention.py b/src/cloudflare/resources/logs/control/retention.py index 387472a602f..3485d0a5d1f 100644 --- a/src/cloudflare/resources/logs/control/retention.py +++ b/src/cloudflare/resources/logs/control/retention.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,13 +49,13 @@ def create( self, *, zone_id: str, - flag: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RetentionCreateResponse]: """ Updates log retention flag for Logpull API. @@ -97,7 +97,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RetentionGetResponse]: """ Gets log retention flag for Logpull API. @@ -152,13 +152,13 @@ async def create( self, *, zone_id: str, - flag: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RetentionCreateResponse]: """ Updates log retention flag for Logpull API. @@ -200,7 +200,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RetentionGetResponse]: """ Gets log retention flag for Logpull API. diff --git a/src/cloudflare/resources/logs/rayid.py b/src/cloudflare/resources/logs/rayid.py index e333a6ad2e2..1f38aa3d088 100644 --- a/src/cloudflare/resources/logs/rayid.py +++ b/src/cloudflare/resources/logs/rayid.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,14 +49,14 @@ def get( rayid: str, *, zone_id: str, - fields: str | NotGiven = NOT_GIVEN, - timestamps: Literal["unix", "unixnano", "rfc3339"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RayIDGetResponse: """The `/rayids` api route allows lookups by specific rayid. @@ -64,7 +64,7 @@ def get( return zero, one, or more records (ray ids are not unique). Args: - zone_id: Identifier + zone_id: Identifier. rayid: Ray identifier. @@ -145,14 +145,14 @@ async def get( rayid: str, *, zone_id: str, - fields: str | NotGiven = NOT_GIVEN, - timestamps: Literal["unix", "unixnano", "rfc3339"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RayIDGetResponse: """The `/rayids` api route allows lookups by specific rayid. @@ -160,7 +160,7 @@ async def get( return zero, one, or more records (ray ids are not unique). Args: - zone_id: Identifier + zone_id: Identifier. rayid: Ray identifier. diff --git a/src/cloudflare/resources/logs/received/fields.py b/src/cloudflare/resources/logs/received/fields.py index f520728bac7..4527eff4bcd 100644 --- a/src/cloudflare/resources/logs/received/fields.py +++ b/src/cloudflare/resources/logs/received/fields.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -48,7 +48,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FieldGetResponse: """Lists all fields available. @@ -56,7 +56,7 @@ def get( where keys are field names, and values are descriptions. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -106,7 +106,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FieldGetResponse: """Lists all fields available. @@ -114,7 +114,7 @@ async def get( where keys are field names, and values are descriptions. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/logs/received/received.py b/src/cloudflare/resources/logs/received/received.py index cb526a9f015..bbb7f57a210 100644 --- a/src/cloudflare/resources/logs/received/received.py +++ b/src/cloudflare/resources/logs/received/received.py @@ -15,7 +15,7 @@ FieldsResourceWithStreamingResponse, AsyncFieldsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -61,17 +61,17 @@ def get( *, zone_id: str, end: Union[str, int], - count: int | NotGiven = NOT_GIVEN, - fields: str | NotGiven = NOT_GIVEN, - sample: float | NotGiven = NOT_GIVEN, - start: Union[str, int] | NotGiven = NOT_GIVEN, - timestamps: Literal["unix", "unixnano", "rfc3339"] | NotGiven = NOT_GIVEN, + count: int | Omit = omit, + fields: str | Omit = omit, + sample: float | Omit = omit, + start: Union[str, int] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ReceivedGetResponse: """The `/received` api route allows customers to retrieve their edge HTTP logs. @@ -85,7 +85,7 @@ def get( will be handled properly. Args: - zone_id: Identifier + zone_id: Identifier. end: Sets the (exclusive) end of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to @@ -196,17 +196,17 @@ async def get( *, zone_id: str, end: Union[str, int], - count: int | NotGiven = NOT_GIVEN, - fields: str | NotGiven = NOT_GIVEN, - sample: float | NotGiven = NOT_GIVEN, - start: Union[str, int] | NotGiven = NOT_GIVEN, - timestamps: Literal["unix", "unixnano", "rfc3339"] | NotGiven = NOT_GIVEN, + count: int | Omit = omit, + fields: str | Omit = omit, + sample: float | Omit = omit, + start: Union[str, int] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ReceivedGetResponse: """The `/received` api route allows customers to retrieve their edge HTTP logs. @@ -220,7 +220,7 @@ async def get( will be handled properly. Args: - zone_id: Identifier + zone_id: Identifier. end: Sets the (exclusive) end of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to 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 704b55c586a..98112dbdf70 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 @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -76,15 +76,15 @@ def create( destination_type: Literal["NONE", "ZERO_TRUST_LIST"], name: str, update_mode: Literal["AUTO", "MANUAL"], - description: str | NotGiven = NOT_GIVEN, - policy: str | NotGiven = NOT_GIVEN, - forwarded: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + policy: str | Omit = omit, + forwarded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CatalogSyncCreateResponse: """ Create a new Catalog Sync (Closed Beta). @@ -128,16 +128,16 @@ def update( sync_id: str, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policy: str | NotGiven = NOT_GIVEN, - update_mode: Literal["AUTO", "MANUAL"] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + name: str | Omit = omit, + policy: str | Omit = omit, + update_mode: Literal["AUTO", "MANUAL"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CatalogSyncUpdateResponse: """ Update a Catalog Sync (Closed Beta). @@ -185,7 +185,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CatalogSyncListResponse]: """ List Catalog Syncs (Closed Beta). @@ -215,13 +215,13 @@ def delete( sync_id: str, *, account_id: str, - delete_destination: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CatalogSyncDeleteResponse: """ Delete a Catalog Sync (Closed Beta). @@ -259,16 +259,16 @@ def edit( sync_id: str, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policy: str | NotGiven = NOT_GIVEN, - update_mode: Literal["AUTO", "MANUAL"] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + name: str | Omit = omit, + policy: str | Omit = omit, + update_mode: Literal["AUTO", "MANUAL"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CatalogSyncEditResponse: """ Update a Catalog Sync (Closed Beta). @@ -317,7 +317,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CatalogSyncGetResponse: """ Read a Catalog Sync (Closed Beta). @@ -357,7 +357,7 @@ def refresh( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Refresh a Catalog Sync's destination by running the sync policy against latest @@ -420,15 +420,15 @@ async def create( destination_type: Literal["NONE", "ZERO_TRUST_LIST"], name: str, update_mode: Literal["AUTO", "MANUAL"], - description: str | NotGiven = NOT_GIVEN, - policy: str | NotGiven = NOT_GIVEN, - forwarded: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + policy: str | Omit = omit, + forwarded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CatalogSyncCreateResponse: """ Create a new Catalog Sync (Closed Beta). @@ -472,16 +472,16 @@ async def update( sync_id: str, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policy: str | NotGiven = NOT_GIVEN, - update_mode: Literal["AUTO", "MANUAL"] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + name: str | Omit = omit, + policy: str | Omit = omit, + update_mode: Literal["AUTO", "MANUAL"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CatalogSyncUpdateResponse: """ Update a Catalog Sync (Closed Beta). @@ -529,7 +529,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CatalogSyncListResponse, AsyncSinglePage[CatalogSyncListResponse]]: """ List Catalog Syncs (Closed Beta). @@ -559,13 +559,13 @@ async def delete( sync_id: str, *, account_id: str, - delete_destination: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CatalogSyncDeleteResponse: """ Delete a Catalog Sync (Closed Beta). @@ -603,16 +603,16 @@ async def edit( sync_id: str, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policy: str | NotGiven = NOT_GIVEN, - update_mode: Literal["AUTO", "MANUAL"] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + name: str | Omit = omit, + policy: str | Omit = omit, + update_mode: Literal["AUTO", "MANUAL"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CatalogSyncEditResponse: """ Update a Catalog Sync (Closed Beta). @@ -661,7 +661,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CatalogSyncGetResponse: """ Read a Catalog Sync (Closed Beta). @@ -701,7 +701,7 @@ async def refresh( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Refresh a Catalog Sync's destination by running the sync policy against latest 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 f70aa94cb82..360302ee218 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 @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,13 +48,13 @@ def list( self, *, account_id: str, - destination_type: Literal["NONE", "ZERO_TRUST_LIST"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PrebuiltPolicyListResponse]: """ List prebuilt catalog sync policies (Closed Beta). @@ -112,13 +112,13 @@ def list( self, *, account_id: str, - destination_type: Literal["NONE", "ZERO_TRUST_LIST"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PrebuiltPolicyListResponse, AsyncSinglePage[PrebuiltPolicyListResponse]]: """ List prebuilt catalog sync policies (Closed Beta). diff --git a/src/cloudflare/resources/magic_cloud_networking/cloud_integrations.py b/src/cloudflare/resources/magic_cloud_networking/cloud_integrations.py index 704b86a6828..8953e359d8d 100644 --- a/src/cloudflare/resources/magic_cloud_networking/cloud_integrations.py +++ b/src/cloudflare/resources/magic_cloud_networking/cloud_integrations.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -69,14 +69,14 @@ def create( account_id: str, cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"], friendly_name: str, - description: str | NotGiven = NOT_GIVEN, - forwarded: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + forwarded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationCreateResponse: """ Create a new Cloud Integration (Closed Beta). @@ -118,19 +118,19 @@ def update( provider_id: str, *, account_id: str, - aws_arn: str | NotGiven = NOT_GIVEN, - azure_subscription_id: str | NotGiven = NOT_GIVEN, - azure_tenant_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - friendly_name: str | NotGiven = NOT_GIVEN, - gcp_project_id: str | NotGiven = NOT_GIVEN, - gcp_service_account_email: str | NotGiven = NOT_GIVEN, + aws_arn: str | Omit = omit, + azure_subscription_id: str | Omit = omit, + azure_tenant_id: str | Omit = omit, + description: str | Omit = omit, + friendly_name: str | Omit = omit, + gcp_project_id: str | Omit = omit, + gcp_service_account_email: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationUpdateResponse: """ Update a Cloud Integration (Closed Beta). @@ -176,16 +176,16 @@ def list( self, *, account_id: str, - cloudflare: bool | NotGiven = NOT_GIVEN, - desc: bool | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - status: bool | NotGiven = NOT_GIVEN, + cloudflare: bool | Omit = omit, + desc: bool | Omit = omit, + order_by: str | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CloudIntegrationListResponse]: """ List Cloud Integrations (Closed Beta). @@ -234,7 +234,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationDeleteResponse: """ Delete a Cloud Integration (Closed Beta). @@ -269,13 +269,13 @@ def discover( provider_id: str, *, account_id: str, - v2: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationDiscoverResponse: """ Run discovery for a Cloud Integration (Closed Beta). @@ -314,7 +314,7 @@ def discover_all( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationDiscoverAllResponse: """ Run discovery for all Cloud Integrations in an account (Closed Beta). @@ -343,19 +343,19 @@ def edit( provider_id: str, *, account_id: str, - aws_arn: str | NotGiven = NOT_GIVEN, - azure_subscription_id: str | NotGiven = NOT_GIVEN, - azure_tenant_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - friendly_name: str | NotGiven = NOT_GIVEN, - gcp_project_id: str | NotGiven = NOT_GIVEN, - gcp_service_account_email: str | NotGiven = NOT_GIVEN, + aws_arn: str | Omit = omit, + azure_subscription_id: str | Omit = omit, + azure_tenant_id: str | Omit = omit, + description: str | Omit = omit, + friendly_name: str | Omit = omit, + gcp_project_id: str | Omit = omit, + gcp_service_account_email: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationEditResponse: """ Update a Cloud Integration (Closed Beta). @@ -402,13 +402,13 @@ def get( provider_id: str, *, account_id: str, - status: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationGetResponse: """ Read a Cloud Integration (Closed Beta). @@ -449,7 +449,7 @@ def initial_setup( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationInitialSetupResponse: """ Get initial configuration to complete Cloud Integration setup (Closed Beta). @@ -511,14 +511,14 @@ async def create( account_id: str, cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"], friendly_name: str, - description: str | NotGiven = NOT_GIVEN, - forwarded: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + forwarded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationCreateResponse: """ Create a new Cloud Integration (Closed Beta). @@ -560,19 +560,19 @@ async def update( provider_id: str, *, account_id: str, - aws_arn: str | NotGiven = NOT_GIVEN, - azure_subscription_id: str | NotGiven = NOT_GIVEN, - azure_tenant_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - friendly_name: str | NotGiven = NOT_GIVEN, - gcp_project_id: str | NotGiven = NOT_GIVEN, - gcp_service_account_email: str | NotGiven = NOT_GIVEN, + aws_arn: str | Omit = omit, + azure_subscription_id: str | Omit = omit, + azure_tenant_id: str | Omit = omit, + description: str | Omit = omit, + friendly_name: str | Omit = omit, + gcp_project_id: str | Omit = omit, + gcp_service_account_email: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationUpdateResponse: """ Update a Cloud Integration (Closed Beta). @@ -618,16 +618,16 @@ def list( self, *, account_id: str, - cloudflare: bool | NotGiven = NOT_GIVEN, - desc: bool | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - status: bool | NotGiven = NOT_GIVEN, + cloudflare: bool | Omit = omit, + desc: bool | Omit = omit, + order_by: str | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CloudIntegrationListResponse, AsyncSinglePage[CloudIntegrationListResponse]]: """ List Cloud Integrations (Closed Beta). @@ -676,7 +676,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationDeleteResponse: """ Delete a Cloud Integration (Closed Beta). @@ -711,13 +711,13 @@ async def discover( provider_id: str, *, account_id: str, - v2: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationDiscoverResponse: """ Run discovery for a Cloud Integration (Closed Beta). @@ -758,7 +758,7 @@ async def discover_all( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationDiscoverAllResponse: """ Run discovery for all Cloud Integrations in an account (Closed Beta). @@ -787,19 +787,19 @@ async def edit( provider_id: str, *, account_id: str, - aws_arn: str | NotGiven = NOT_GIVEN, - azure_subscription_id: str | NotGiven = NOT_GIVEN, - azure_tenant_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - friendly_name: str | NotGiven = NOT_GIVEN, - gcp_project_id: str | NotGiven = NOT_GIVEN, - gcp_service_account_email: str | NotGiven = NOT_GIVEN, + aws_arn: str | Omit = omit, + azure_subscription_id: str | Omit = omit, + azure_tenant_id: str | Omit = omit, + description: str | Omit = omit, + friendly_name: str | Omit = omit, + gcp_project_id: str | Omit = omit, + gcp_service_account_email: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationEditResponse: """ Update a Cloud Integration (Closed Beta). @@ -846,13 +846,13 @@ async def get( provider_id: str, *, account_id: str, - status: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationGetResponse: """ Read a Cloud Integration (Closed Beta). @@ -895,7 +895,7 @@ async def initial_setup( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudIntegrationInitialSetupResponse: """ Get initial configuration to complete Cloud Integration setup (Closed Beta). 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 0955472166c..ea74a5cb0e0 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 @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import Type, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -50,13 +50,13 @@ def update( self, *, account_id: str, - prefixes: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AddressSpaceUpdateResponse: """ Update the Magic WAN Address Space (Closed Beta). @@ -94,7 +94,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AddressSpaceListResponse: """ Read the Magic WAN Address Space (Closed Beta). @@ -126,13 +126,13 @@ def edit( self, *, account_id: str, - prefixes: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AddressSpaceEditResponse: """ Update the Magic WAN Address Space (Closed Beta). @@ -186,13 +186,13 @@ async def update( self, *, account_id: str, - prefixes: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AddressSpaceUpdateResponse: """ Update the Magic WAN Address Space (Closed Beta). @@ -232,7 +232,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AddressSpaceListResponse: """ Read the Magic WAN Address Space (Closed Beta). @@ -264,13 +264,13 @@ async def edit( self, *, account_id: str, - prefixes: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AddressSpaceEditResponse: """ Update the Magic WAN Address Space (Closed Beta). 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 7677342c2b6..d8918bc0004 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 @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import Type, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -89,22 +89,22 @@ def create( install_routes_in_magic_wan: bool, name: str, type: Literal["OnrampTypeSingle", "OnrampTypeHub"], - adopted_hub_id: str | NotGiven = NOT_GIVEN, - attached_hubs: List[str] | NotGiven = NOT_GIVEN, - attached_vpcs: List[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - hub_provider_id: str | NotGiven = NOT_GIVEN, - manage_hub_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - manage_vpc_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - vpc: str | NotGiven = NOT_GIVEN, - forwarded: str | NotGiven = NOT_GIVEN, + adopted_hub_id: str | Omit = omit, + attached_hubs: SequenceNotStr[str] | Omit = omit, + attached_vpcs: SequenceNotStr[str] | Omit = omit, + description: str | Omit = omit, + hub_provider_id: str | Omit = omit, + manage_hub_to_hub_attachments: bool | Omit = omit, + manage_vpc_to_hub_attachments: bool | Omit = omit, + region: str | Omit = omit, + vpc: str | Omit = omit, + forwarded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampCreateResponse: """ Create a new On-ramp (Closed Beta). @@ -157,21 +157,21 @@ def update( onramp_id: str, *, account_id: str, - attached_hubs: List[str] | NotGiven = NOT_GIVEN, - attached_vpcs: List[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - install_routes_in_cloud: bool | NotGiven = NOT_GIVEN, - install_routes_in_magic_wan: bool | NotGiven = NOT_GIVEN, - manage_hub_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - manage_vpc_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - vpc: str | NotGiven = NOT_GIVEN, + attached_hubs: SequenceNotStr[str] | Omit = omit, + attached_vpcs: SequenceNotStr[str] | Omit = omit, + description: str | Omit = omit, + install_routes_in_cloud: bool | Omit = omit, + install_routes_in_magic_wan: bool | Omit = omit, + manage_hub_to_hub_attachments: bool | Omit = omit, + manage_vpc_to_hub_attachments: bool | Omit = omit, + name: str | Omit = omit, + vpc: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampUpdateResponse: """ Update an On-ramp (Closed Beta). @@ -219,16 +219,16 @@ def list( self, *, account_id: str, - desc: bool | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - status: bool | NotGiven = NOT_GIVEN, - vpcs: bool | NotGiven = NOT_GIVEN, + desc: bool | Omit = omit, + order_by: str | Omit = omit, + status: bool | Omit = omit, + vpcs: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[OnRampListResponse]: """ List On-ramps (Closed Beta). @@ -272,14 +272,14 @@ def delete( onramp_id: str, *, account_id: str, - destroy: bool | NotGiven = NOT_GIVEN, - force: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampDeleteResponse: """ Delete an On-ramp (Closed Beta). @@ -326,7 +326,7 @@ def apply( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampApplyResponse: """ Apply an On-ramp (Closed Beta). @@ -357,21 +357,21 @@ def edit( onramp_id: str, *, account_id: str, - attached_hubs: List[str] | NotGiven = NOT_GIVEN, - attached_vpcs: List[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - install_routes_in_cloud: bool | NotGiven = NOT_GIVEN, - install_routes_in_magic_wan: bool | NotGiven = NOT_GIVEN, - manage_hub_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - manage_vpc_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - vpc: str | NotGiven = NOT_GIVEN, + attached_hubs: SequenceNotStr[str] | Omit = omit, + attached_vpcs: SequenceNotStr[str] | Omit = omit, + description: str | Omit = omit, + install_routes_in_cloud: bool | Omit = omit, + install_routes_in_magic_wan: bool | Omit = omit, + manage_hub_to_hub_attachments: bool | Omit = omit, + manage_vpc_to_hub_attachments: bool | Omit = omit, + name: str | Omit = omit, + vpc: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampEditResponse: """ Update an On-ramp (Closed Beta). @@ -425,7 +425,7 @@ def export( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """ Export an On-ramp to terraform ready file(s) (Closed Beta). @@ -457,16 +457,16 @@ def get( onramp_id: str, *, account_id: str, - planned_resources: bool | NotGiven = NOT_GIVEN, - post_apply_resources: bool | NotGiven = NOT_GIVEN, - status: bool | NotGiven = NOT_GIVEN, - vpcs: bool | NotGiven = NOT_GIVEN, + planned_resources: bool | Omit = omit, + post_apply_resources: bool | Omit = omit, + status: bool | Omit = omit, + vpcs: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampGetResponse: """ Read an On-ramp (Closed Beta). @@ -515,7 +515,7 @@ def plan( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampPlanResponse: """ Plan an On-ramp (Closed Beta). @@ -575,22 +575,22 @@ async def create( install_routes_in_magic_wan: bool, name: str, type: Literal["OnrampTypeSingle", "OnrampTypeHub"], - adopted_hub_id: str | NotGiven = NOT_GIVEN, - attached_hubs: List[str] | NotGiven = NOT_GIVEN, - attached_vpcs: List[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - hub_provider_id: str | NotGiven = NOT_GIVEN, - manage_hub_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - manage_vpc_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - vpc: str | NotGiven = NOT_GIVEN, - forwarded: str | NotGiven = NOT_GIVEN, + adopted_hub_id: str | Omit = omit, + attached_hubs: SequenceNotStr[str] | Omit = omit, + attached_vpcs: SequenceNotStr[str] | Omit = omit, + description: str | Omit = omit, + hub_provider_id: str | Omit = omit, + manage_hub_to_hub_attachments: bool | Omit = omit, + manage_vpc_to_hub_attachments: bool | Omit = omit, + region: str | Omit = omit, + vpc: str | Omit = omit, + forwarded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampCreateResponse: """ Create a new On-ramp (Closed Beta). @@ -643,21 +643,21 @@ async def update( onramp_id: str, *, account_id: str, - attached_hubs: List[str] | NotGiven = NOT_GIVEN, - attached_vpcs: List[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - install_routes_in_cloud: bool | NotGiven = NOT_GIVEN, - install_routes_in_magic_wan: bool | NotGiven = NOT_GIVEN, - manage_hub_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - manage_vpc_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - vpc: str | NotGiven = NOT_GIVEN, + attached_hubs: SequenceNotStr[str] | Omit = omit, + attached_vpcs: SequenceNotStr[str] | Omit = omit, + description: str | Omit = omit, + install_routes_in_cloud: bool | Omit = omit, + install_routes_in_magic_wan: bool | Omit = omit, + manage_hub_to_hub_attachments: bool | Omit = omit, + manage_vpc_to_hub_attachments: bool | Omit = omit, + name: str | Omit = omit, + vpc: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampUpdateResponse: """ Update an On-ramp (Closed Beta). @@ -705,16 +705,16 @@ def list( self, *, account_id: str, - desc: bool | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - status: bool | NotGiven = NOT_GIVEN, - vpcs: bool | NotGiven = NOT_GIVEN, + desc: bool | Omit = omit, + order_by: str | Omit = omit, + status: bool | Omit = omit, + vpcs: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OnRampListResponse, AsyncSinglePage[OnRampListResponse]]: """ List On-ramps (Closed Beta). @@ -758,14 +758,14 @@ async def delete( onramp_id: str, *, account_id: str, - destroy: bool | NotGiven = NOT_GIVEN, - force: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampDeleteResponse: """ Delete an On-ramp (Closed Beta). @@ -812,7 +812,7 @@ async def apply( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampApplyResponse: """ Apply an On-ramp (Closed Beta). @@ -843,21 +843,21 @@ async def edit( onramp_id: str, *, account_id: str, - attached_hubs: List[str] | NotGiven = NOT_GIVEN, - attached_vpcs: List[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - install_routes_in_cloud: bool | NotGiven = NOT_GIVEN, - install_routes_in_magic_wan: bool | NotGiven = NOT_GIVEN, - manage_hub_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - manage_vpc_to_hub_attachments: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - vpc: str | NotGiven = NOT_GIVEN, + attached_hubs: SequenceNotStr[str] | Omit = omit, + attached_vpcs: SequenceNotStr[str] | Omit = omit, + description: str | Omit = omit, + install_routes_in_cloud: bool | Omit = omit, + install_routes_in_magic_wan: bool | Omit = omit, + manage_hub_to_hub_attachments: bool | Omit = omit, + manage_vpc_to_hub_attachments: bool | Omit = omit, + name: str | Omit = omit, + vpc: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampEditResponse: """ Update an On-ramp (Closed Beta). @@ -911,7 +911,7 @@ async def export( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """ Export an On-ramp to terraform ready file(s) (Closed Beta). @@ -943,16 +943,16 @@ async def get( onramp_id: str, *, account_id: str, - planned_resources: bool | NotGiven = NOT_GIVEN, - post_apply_resources: bool | NotGiven = NOT_GIVEN, - status: bool | NotGiven = NOT_GIVEN, - vpcs: bool | NotGiven = NOT_GIVEN, + planned_resources: bool | Omit = omit, + post_apply_resources: bool | Omit = omit, + status: bool | Omit = omit, + vpcs: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampGetResponse: """ Read an On-ramp (Closed Beta). @@ -1001,7 +1001,7 @@ async def plan( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OnRampPlanResponse: """ Plan an On-ramp (Closed Beta). diff --git a/src/cloudflare/resources/magic_cloud_networking/resources.py b/src/cloudflare/resources/magic_cloud_networking/resources.py index e043068d8d8..a6fa0be26aa 100644 --- a/src/cloudflare/resources/magic_cloud_networking/resources.py +++ b/src/cloudflare/resources/magic_cloud_networking/resources.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -65,16 +65,16 @@ def list( self, *, account_id: str, - cloudflare: bool | NotGiven = NOT_GIVEN, - desc: bool | NotGiven = NOT_GIVEN, - managed: bool | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - provider_id: str | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - resource_group: str | NotGiven = NOT_GIVEN, - resource_id: List[str] | NotGiven = NOT_GIVEN, + cloudflare: bool | Omit = omit, + desc: bool | Omit = omit, + managed: bool | Omit = omit, + order_by: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + provider_id: str | Omit = omit, + region: str | Omit = omit, + resource_group: str | Omit = omit, + resource_id: SequenceNotStr[str] | Omit = omit, resource_type: List[ Literal[ "aws_customer_gateway", @@ -136,15 +136,15 @@ def list( "cloudflare_ipsec_tunnel", ] ] - | NotGiven = NOT_GIVEN, - search: List[str] | NotGiven = NOT_GIVEN, - v2: bool | NotGiven = NOT_GIVEN, + | Omit = omit, + search: SequenceNotStr[str] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[ResourceListResponse]: """ List resources in the Resource Catalog (Closed Beta). @@ -196,12 +196,12 @@ def export( self, *, account_id: str, - desc: bool | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - provider_id: str | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - resource_group: str | NotGiven = NOT_GIVEN, - resource_id: List[str] | NotGiven = NOT_GIVEN, + desc: bool | Omit = omit, + order_by: str | Omit = omit, + provider_id: str | Omit = omit, + region: str | Omit = omit, + resource_group: str | Omit = omit, + resource_id: SequenceNotStr[str] | Omit = omit, resource_type: List[ Literal[ "aws_customer_gateway", @@ -263,15 +263,15 @@ def export( "cloudflare_ipsec_tunnel", ] ] - | NotGiven = NOT_GIVEN, - search: List[str] | NotGiven = NOT_GIVEN, - v2: bool | NotGiven = NOT_GIVEN, + | Omit = omit, + search: SequenceNotStr[str] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """ Export resources in the Resource Catalog as a JSON file (Closed Beta). @@ -320,13 +320,13 @@ def get( resource_id: str, *, account_id: str, - v2: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ResourceGetResponse: """ Read an resource from the Resource Catalog (Closed Beta). @@ -367,7 +367,7 @@ def policy_preview( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Preview Rego query result against the latest resource catalog (Closed Beta). @@ -421,16 +421,16 @@ def list( self, *, account_id: str, - cloudflare: bool | NotGiven = NOT_GIVEN, - desc: bool | NotGiven = NOT_GIVEN, - managed: bool | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - provider_id: str | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - resource_group: str | NotGiven = NOT_GIVEN, - resource_id: List[str] | NotGiven = NOT_GIVEN, + cloudflare: bool | Omit = omit, + desc: bool | Omit = omit, + managed: bool | Omit = omit, + order_by: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + provider_id: str | Omit = omit, + region: str | Omit = omit, + resource_group: str | Omit = omit, + resource_id: SequenceNotStr[str] | Omit = omit, resource_type: List[ Literal[ "aws_customer_gateway", @@ -492,15 +492,15 @@ def list( "cloudflare_ipsec_tunnel", ] ] - | NotGiven = NOT_GIVEN, - search: List[str] | NotGiven = NOT_GIVEN, - v2: bool | NotGiven = NOT_GIVEN, + | Omit = omit, + search: SequenceNotStr[str] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ResourceListResponse, AsyncV4PagePaginationArray[ResourceListResponse]]: """ List resources in the Resource Catalog (Closed Beta). @@ -552,12 +552,12 @@ async def export( self, *, account_id: str, - desc: bool | NotGiven = NOT_GIVEN, - order_by: str | NotGiven = NOT_GIVEN, - provider_id: str | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - resource_group: str | NotGiven = NOT_GIVEN, - resource_id: List[str] | NotGiven = NOT_GIVEN, + desc: bool | Omit = omit, + order_by: str | Omit = omit, + provider_id: str | Omit = omit, + region: str | Omit = omit, + resource_group: str | Omit = omit, + resource_id: SequenceNotStr[str] | Omit = omit, resource_type: List[ Literal[ "aws_customer_gateway", @@ -619,15 +619,15 @@ async def export( "cloudflare_ipsec_tunnel", ] ] - | NotGiven = NOT_GIVEN, - search: List[str] | NotGiven = NOT_GIVEN, - v2: bool | NotGiven = NOT_GIVEN, + | Omit = omit, + search: SequenceNotStr[str] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """ Export resources in the Resource Catalog as a JSON file (Closed Beta). @@ -676,13 +676,13 @@ async def get( resource_id: str, *, account_id: str, - v2: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ResourceGetResponse: """ Read an resource from the Resource Catalog (Closed Beta). @@ -723,7 +723,7 @@ async def policy_preview( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Preview Rego query result against the latest resource catalog (Closed Beta). diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py index 78a63d806ba..217848dca6a 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Iterable, cast +from typing import Type, Iterable, cast import httpx @@ -14,7 +14,7 @@ FullResourceWithStreamingResponse, AsyncFullResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -62,14 +62,14 @@ def create( account_id: str, default_sampling: float, name: str, - router_ips: List[str] | NotGiven = NOT_GIVEN, - warp_devices: Iterable[config_create_params.WARPDevice] | NotGiven = NOT_GIVEN, + router_ips: SequenceNotStr[str] | Omit = omit, + warp_devices: Iterable[config_create_params.WARPDevice] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Create a new network monitoring configuration. @@ -117,14 +117,14 @@ def update( account_id: str, default_sampling: float, name: str, - router_ips: List[str] | NotGiven = NOT_GIVEN, - warp_devices: Iterable[config_update_params.WARPDevice] | NotGiven = NOT_GIVEN, + router_ips: SequenceNotStr[str] | Omit = omit, + warp_devices: Iterable[config_update_params.WARPDevice] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Update an existing network monitoring configuration, requires the entire @@ -176,7 +176,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Delete an existing network monitoring configuration. @@ -208,16 +208,16 @@ def edit( self, *, account_id: str, - default_sampling: float | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - router_ips: List[str] | NotGiven = NOT_GIVEN, - warp_devices: Iterable[config_edit_params.WARPDevice] | NotGiven = NOT_GIVEN, + default_sampling: float | Omit = omit, + name: str | Omit = omit, + router_ips: SequenceNotStr[str] | Omit = omit, + warp_devices: Iterable[config_edit_params.WARPDevice] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Update fields in an existing network monitoring configuration. @@ -268,7 +268,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Lists default sampling, router IPs and warp devices for account. @@ -327,14 +327,14 @@ async def create( account_id: str, default_sampling: float, name: str, - router_ips: List[str] | NotGiven = NOT_GIVEN, - warp_devices: Iterable[config_create_params.WARPDevice] | NotGiven = NOT_GIVEN, + router_ips: SequenceNotStr[str] | Omit = omit, + warp_devices: Iterable[config_create_params.WARPDevice] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Create a new network monitoring configuration. @@ -382,14 +382,14 @@ async def update( account_id: str, default_sampling: float, name: str, - router_ips: List[str] | NotGiven = NOT_GIVEN, - warp_devices: Iterable[config_update_params.WARPDevice] | NotGiven = NOT_GIVEN, + router_ips: SequenceNotStr[str] | Omit = omit, + warp_devices: Iterable[config_update_params.WARPDevice] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Update an existing network monitoring configuration, requires the entire @@ -441,7 +441,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Delete an existing network monitoring configuration. @@ -473,16 +473,16 @@ async def edit( self, *, account_id: str, - default_sampling: float | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - router_ips: List[str] | NotGiven = NOT_GIVEN, - warp_devices: Iterable[config_edit_params.WARPDevice] | NotGiven = NOT_GIVEN, + default_sampling: float | Omit = omit, + name: str | Omit = omit, + router_ips: SequenceNotStr[str] | Omit = omit, + warp_devices: Iterable[config_edit_params.WARPDevice] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Update fields in an existing network monitoring configuration. @@ -533,7 +533,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Lists default sampling, router IPs and warp devices for account. diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/full.py b/src/cloudflare/resources/magic_network_monitoring/configs/full.py index 932d65f37d0..c6ff6036bb7 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/full.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/full.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Lists default sampling, router IPs, warp devices, and rules for account. @@ -109,7 +109,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Lists default sampling, router IPs, warp devices, and rules for account. diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py index 02160b95024..96590f760c5 100644 --- a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py +++ b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,7 +55,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Advertisement]: """Update advertisement for rule. @@ -121,7 +121,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Advertisement]: """Update advertisement for rule. diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py index 2f4fafb106b..ccd2abdc545 100644 --- a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py +++ b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -64,16 +64,16 @@ def create( account_id: str, duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"], name: str, - automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, - bandwidth: float | NotGiven = NOT_GIVEN, - packet_threshold: float | NotGiven = NOT_GIVEN, - prefixes: List[str] | NotGiven = NOT_GIVEN, + automatic_advertisement: Optional[bool] | Omit = omit, + bandwidth: float | Omit = omit, + packet_threshold: float | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MagicNetworkMonitoringRule]: """Create network monitoring rules for account. @@ -138,17 +138,17 @@ def update( account_id: str, duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"], name: str, - id: str | NotGiven = NOT_GIVEN, - automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, - bandwidth: float | NotGiven = NOT_GIVEN, - packet_threshold: float | NotGiven = NOT_GIVEN, - prefixes: List[str] | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + automatic_advertisement: Optional[bool] | Omit = omit, + bandwidth: float | Omit = omit, + packet_threshold: float | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MagicNetworkMonitoringRule]: """ Update network monitoring rules for account. @@ -217,7 +217,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Optional[MagicNetworkMonitoringRule]]: """ Lists network monitoring rules for account. @@ -252,7 +252,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MagicNetworkMonitoringRule]: """ Delete a network monitoring rule for account. @@ -289,18 +289,18 @@ def edit( rule_id: str, *, account_id: str, - automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, - bandwidth: float | NotGiven = NOT_GIVEN, - duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - packet_threshold: float | NotGiven = NOT_GIVEN, - prefixes: List[str] | NotGiven = NOT_GIVEN, + automatic_advertisement: Optional[bool] | Omit = omit, + bandwidth: float | Omit = omit, + duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"] | Omit = omit, + name: str | Omit = omit, + packet_threshold: float | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MagicNetworkMonitoringRule]: """ Update a network monitoring rule for account. @@ -371,7 +371,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MagicNetworkMonitoringRule]: """ List a single network monitoring rule for account. @@ -434,16 +434,16 @@ async def create( account_id: str, duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"], name: str, - automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, - bandwidth: float | NotGiven = NOT_GIVEN, - packet_threshold: float | NotGiven = NOT_GIVEN, - prefixes: List[str] | NotGiven = NOT_GIVEN, + automatic_advertisement: Optional[bool] | Omit = omit, + bandwidth: float | Omit = omit, + packet_threshold: float | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MagicNetworkMonitoringRule]: """Create network monitoring rules for account. @@ -508,17 +508,17 @@ async def update( account_id: str, duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"], name: str, - id: str | NotGiven = NOT_GIVEN, - automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, - bandwidth: float | NotGiven = NOT_GIVEN, - packet_threshold: float | NotGiven = NOT_GIVEN, - prefixes: List[str] | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + automatic_advertisement: Optional[bool] | Omit = omit, + bandwidth: float | Omit = omit, + packet_threshold: float | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MagicNetworkMonitoringRule]: """ Update network monitoring rules for account. @@ -587,7 +587,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[MagicNetworkMonitoringRule], AsyncSinglePage[Optional[MagicNetworkMonitoringRule]]]: """ Lists network monitoring rules for account. @@ -622,7 +622,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MagicNetworkMonitoringRule]: """ Delete a network monitoring rule for account. @@ -659,18 +659,18 @@ async def edit( rule_id: str, *, account_id: str, - automatic_advertisement: Optional[bool] | NotGiven = NOT_GIVEN, - bandwidth: float | NotGiven = NOT_GIVEN, - duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - packet_threshold: float | NotGiven = NOT_GIVEN, - prefixes: List[str] | NotGiven = NOT_GIVEN, + automatic_advertisement: Optional[bool] | Omit = omit, + bandwidth: float | Omit = omit, + duration: Literal["1m", "5m", "10m", "15m", "20m", "30m", "45m", "60m"] | Omit = omit, + name: str | Omit = omit, + packet_threshold: float | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MagicNetworkMonitoringRule]: """ Update a network monitoring rule for account. @@ -741,7 +741,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MagicNetworkMonitoringRule]: """ List a single network monitoring rule for account. 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 323c7d893d8..be0e187d9d1 100644 --- a/src/cloudflare/resources/magic_network_monitoring/vpc_flows/tokens.py +++ b/src/cloudflare/resources/magic_network_monitoring/vpc_flows/tokens.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,7 +51,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Generate authentication token for VPC flow logs export. @@ -109,7 +109,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Generate authentication token for VPC flow logs export. diff --git a/src/cloudflare/resources/magic_transit/apps.py b/src/cloudflare/resources/magic_transit/apps.py index 62c38bfcb0d..11604493a1f 100644 --- a/src/cloudflare/resources/magic_transit/apps.py +++ b/src/cloudflare/resources/magic_transit/apps.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import Any, List, Type, Optional, cast +from typing import Any, Type, Optional, cast import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,14 +55,14 @@ def create( account_id: str, name: str, type: str, - hostnames: List[str] | NotGiven = NOT_GIVEN, - ip_subnets: List[str] | NotGiven = NOT_GIVEN, + hostnames: SequenceNotStr[str] | Omit = omit, + ip_subnets: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppCreateResponse]: """ Creates a new App for an account @@ -115,16 +115,16 @@ def update( account_app_id: str, *, account_id: str, - hostnames: List[str] | NotGiven = NOT_GIVEN, - ip_subnets: List[str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + hostnames: SequenceNotStr[str] | Omit = omit, + ip_subnets: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppUpdateResponse]: """ Updates an Account App @@ -185,7 +185,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[AppListResponse]: """ Lists Apps associated with an account. @@ -222,7 +222,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppDeleteResponse]: """ Deletes specific Account App. @@ -261,16 +261,16 @@ def edit( account_app_id: str, *, account_id: str, - hostnames: List[str] | NotGiven = NOT_GIVEN, - ip_subnets: List[str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + hostnames: SequenceNotStr[str] | Omit = omit, + ip_subnets: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppEditResponse]: """ Updates an Account App @@ -349,14 +349,14 @@ async def create( account_id: str, name: str, type: str, - hostnames: List[str] | NotGiven = NOT_GIVEN, - ip_subnets: List[str] | NotGiven = NOT_GIVEN, + hostnames: SequenceNotStr[str] | Omit = omit, + ip_subnets: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppCreateResponse]: """ Creates a new App for an account @@ -409,16 +409,16 @@ async def update( account_app_id: str, *, account_id: str, - hostnames: List[str] | NotGiven = NOT_GIVEN, - ip_subnets: List[str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + hostnames: SequenceNotStr[str] | Omit = omit, + ip_subnets: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppUpdateResponse]: """ Updates an Account App @@ -479,7 +479,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AppListResponse, AsyncSinglePage[AppListResponse]]: """ Lists Apps associated with an account. @@ -516,7 +516,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppDeleteResponse]: """ Deletes specific Account App. @@ -555,16 +555,16 @@ async def edit( account_app_id: str, *, account_id: str, - hostnames: List[str] | NotGiven = NOT_GIVEN, - ip_subnets: List[str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + hostnames: SequenceNotStr[str] | Omit = omit, + ip_subnets: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppEditResponse]: """ Updates an Account App diff --git a/src/cloudflare/resources/magic_transit/cf_interconnects.py b/src/cloudflare/resources/magic_transit/cf_interconnects.py index d3b39b16c03..dcdb90f68cd 100644 --- a/src/cloudflare/resources/magic_transit/cf_interconnects.py +++ b/src/cloudflare/resources/magic_transit/cf_interconnects.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -53,18 +53,20 @@ def update( cf_interconnect_id: str, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, - gre: cf_interconnect_update_params.GRE | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - interface_address: str | NotGiven = NOT_GIVEN, - mtu: int | NotGiven = NOT_GIVEN, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + automatic_return_routing: bool | Omit = omit, + description: str | Omit = omit, + gre: cf_interconnect_update_params.GRE | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + interface_address: str | Omit = omit, + interface_address6: str | Omit = omit, + mtu: int | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CfInterconnectUpdateResponse: """Updates a specific interconnect associated with an account. @@ -77,6 +79,9 @@ def update( cf_interconnect_id: Identifier + automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false + otherwise. + description: An optional description of the interconnect. gre: The configuration specific to GRE interconnects. @@ -85,6 +90,11 @@ def update( of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. + interface_address6: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + address being the first IP of the subnet and not same as the address of + virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + mtu: The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. @@ -105,7 +115,7 @@ def update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -114,10 +124,12 @@ def update( f"/accounts/{account_id}/magic/cf_interconnects/{cf_interconnect_id}", body=maybe_transform( { + "automatic_return_routing": automatic_return_routing, "description": description, "gre": gre, "health_check": health_check, "interface_address": interface_address, + "interface_address6": interface_address6, "mtu": mtu, }, cf_interconnect_update_params.CfInterconnectUpdateParams, @@ -136,13 +148,13 @@ def list( self, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CfInterconnectListResponse: """ Lists interconnects associated with an account. @@ -165,7 +177,7 @@ def list( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -187,13 +199,13 @@ def bulk_update( *, account_id: str, body: object, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CfInterconnectBulkUpdateResponse: """Updates multiple interconnects associated with an account. @@ -219,7 +231,7 @@ def bulk_update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -242,13 +254,13 @@ def get( cf_interconnect_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CfInterconnectGetResponse: """ Lists details for a specific interconnect. @@ -275,7 +287,7 @@ def get( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -318,18 +330,20 @@ async def update( cf_interconnect_id: str, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, - gre: cf_interconnect_update_params.GRE | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - interface_address: str | NotGiven = NOT_GIVEN, - mtu: int | NotGiven = NOT_GIVEN, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + automatic_return_routing: bool | Omit = omit, + description: str | Omit = omit, + gre: cf_interconnect_update_params.GRE | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + interface_address: str | Omit = omit, + interface_address6: str | Omit = omit, + mtu: int | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CfInterconnectUpdateResponse: """Updates a specific interconnect associated with an account. @@ -342,6 +356,9 @@ async def update( cf_interconnect_id: Identifier + automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false + otherwise. + description: An optional description of the interconnect. gre: The configuration specific to GRE interconnects. @@ -350,6 +367,11 @@ async def update( of the tunnel. Select the subnet from the following private IP space: 10.0.0.0–10.255.255.255, 172.16.0.0–172.31.255.255, 192.168.0.0–192.168.255.255. + interface_address6: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + address being the first IP of the subnet and not same as the address of + virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + mtu: The Maximum Transmission Unit (MTU) in bytes for the interconnect. The minimum value is 576. @@ -370,7 +392,7 @@ async def update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -379,10 +401,12 @@ async def update( f"/accounts/{account_id}/magic/cf_interconnects/{cf_interconnect_id}", body=await async_maybe_transform( { + "automatic_return_routing": automatic_return_routing, "description": description, "gre": gre, "health_check": health_check, "interface_address": interface_address, + "interface_address6": interface_address6, "mtu": mtu, }, cf_interconnect_update_params.CfInterconnectUpdateParams, @@ -401,13 +425,13 @@ async def list( self, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CfInterconnectListResponse: """ Lists interconnects associated with an account. @@ -430,7 +454,7 @@ async def list( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -452,13 +476,13 @@ async def bulk_update( *, account_id: str, body: object, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CfInterconnectBulkUpdateResponse: """Updates multiple interconnects associated with an account. @@ -484,7 +508,7 @@ async def bulk_update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -507,13 +531,13 @@ async def get( cf_interconnect_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CfInterconnectGetResponse: """ Lists details for a specific interconnect. @@ -540,7 +564,7 @@ async def get( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), diff --git a/src/cloudflare/resources/magic_transit/connectors/connectors.py b/src/cloudflare/resources/magic_transit/connectors/connectors.py index 0af23684c7b..961707d44dc 100644 --- a/src/cloudflare/resources/magic_transit/connectors/connectors.py +++ b/src/cloudflare/resources/magic_transit/connectors/connectors.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -35,10 +35,12 @@ SnapshotsResourceWithStreamingResponse, AsyncSnapshotsResourceWithStreamingResponse, ) -from ....types.magic_transit import connector_edit_params, connector_update_params +from ....types.magic_transit import connector_edit_params, connector_create_params, connector_update_params from ....types.magic_transit.connector_get_response import ConnectorGetResponse from ....types.magic_transit.connector_edit_response import ConnectorEditResponse from ....types.magic_transit.connector_list_response import ConnectorListResponse +from ....types.magic_transit.connector_create_response import ConnectorCreateResponse +from ....types.magic_transit.connector_delete_response import ConnectorDeleteResponse from ....types.magic_transit.connector_update_response import ConnectorUpdateResponse __all__ = ["ConnectorsResource", "AsyncConnectorsResource"] @@ -72,29 +74,90 @@ def with_streaming_response(self) -> ConnectorsResourceWithStreamingResponse: """ return ConnectorsResourceWithStreamingResponse(self) + def create( + self, + *, + account_id: str, + device: connector_create_params.Device, + activated: bool | Omit = omit, + interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_hour_of_day: float | Omit = omit, + notes: str | Omit = omit, + timezone: 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, + ) -> ConnectorCreateResponse: + """ + Add a connector to your account + + Args: + account_id: Account identifier + + device: Exactly one of id, serial_number, or provision_license must be provided. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/magic/connectors", + body=maybe_transform( + { + "device": device, + "activated": activated, + "interrupt_window_duration_hours": interrupt_window_duration_hours, + "interrupt_window_hour_of_day": interrupt_window_hour_of_day, + "notes": notes, + "timezone": timezone, + }, + connector_create_params.ConnectorCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ConnectorCreateResponse]._unwrapper, + ), + cast_to=cast(Type[ConnectorCreateResponse], ResultWrapper[ConnectorCreateResponse]), + ) + def update( self, connector_id: str, *, account_id: str, - activated: bool | NotGiven = NOT_GIVEN, - interrupt_window_duration_hours: float | NotGiven = NOT_GIVEN, - interrupt_window_hour_of_day: float | NotGiven = NOT_GIVEN, - notes: str | NotGiven = NOT_GIVEN, - timezone: str | NotGiven = NOT_GIVEN, + activated: bool | Omit = omit, + interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_hour_of_day: float | Omit = omit, + notes: str | Omit = omit, + provision_license: bool | Omit = omit, + timezone: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectorUpdateResponse: """ - Replace Connector + Replace Connector or Re-provision License Key Args: account_id: Account identifier + provision_license: When true, regenerate license key for the connector. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -115,6 +178,7 @@ def update( "interrupt_window_duration_hours": interrupt_window_duration_hours, "interrupt_window_hour_of_day": interrupt_window_hour_of_day, "notes": notes, + "provision_license": provision_license, "timezone": timezone, }, connector_update_params.ConnectorUpdateParams, @@ -138,7 +202,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ConnectorListResponse]: """ List Connectors @@ -165,29 +229,74 @@ def list( model=ConnectorListResponse, ) + def delete( + self, + connector_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, + ) -> ConnectorDeleteResponse: + """ + Remove a connector from your account + + Args: + account_id: Account 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not connector_id: + raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") + return self._delete( + f"/accounts/{account_id}/magic/connectors/{connector_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ConnectorDeleteResponse]._unwrapper, + ), + cast_to=cast(Type[ConnectorDeleteResponse], ResultWrapper[ConnectorDeleteResponse]), + ) + def edit( self, connector_id: str, *, account_id: str, - activated: bool | NotGiven = NOT_GIVEN, - interrupt_window_duration_hours: float | NotGiven = NOT_GIVEN, - interrupt_window_hour_of_day: float | NotGiven = NOT_GIVEN, - notes: str | NotGiven = NOT_GIVEN, - timezone: str | NotGiven = NOT_GIVEN, + activated: bool | Omit = omit, + interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_hour_of_day: float | Omit = omit, + notes: str | Omit = omit, + provision_license: bool | Omit = omit, + timezone: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectorEditResponse: """ - Update Connector + Edit Connector to update specific properties or Re-provision License Key Args: account_id: Account identifier + provision_license: When true, regenerate license key for the connector. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -208,6 +317,7 @@ def edit( "interrupt_window_duration_hours": interrupt_window_duration_hours, "interrupt_window_hour_of_day": interrupt_window_hour_of_day, "notes": notes, + "provision_license": provision_license, "timezone": timezone, }, connector_edit_params.ConnectorEditParams, @@ -232,7 +342,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectorGetResponse: """ Fetch Connector @@ -293,29 +403,90 @@ def with_streaming_response(self) -> AsyncConnectorsResourceWithStreamingRespons """ return AsyncConnectorsResourceWithStreamingResponse(self) + async def create( + self, + *, + account_id: str, + device: connector_create_params.Device, + activated: bool | Omit = omit, + interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_hour_of_day: float | Omit = omit, + notes: str | Omit = omit, + timezone: 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, + ) -> ConnectorCreateResponse: + """ + Add a connector to your account + + Args: + account_id: Account identifier + + device: Exactly one of id, serial_number, or provision_license must be provided. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/magic/connectors", + body=await async_maybe_transform( + { + "device": device, + "activated": activated, + "interrupt_window_duration_hours": interrupt_window_duration_hours, + "interrupt_window_hour_of_day": interrupt_window_hour_of_day, + "notes": notes, + "timezone": timezone, + }, + connector_create_params.ConnectorCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ConnectorCreateResponse]._unwrapper, + ), + cast_to=cast(Type[ConnectorCreateResponse], ResultWrapper[ConnectorCreateResponse]), + ) + async def update( self, connector_id: str, *, account_id: str, - activated: bool | NotGiven = NOT_GIVEN, - interrupt_window_duration_hours: float | NotGiven = NOT_GIVEN, - interrupt_window_hour_of_day: float | NotGiven = NOT_GIVEN, - notes: str | NotGiven = NOT_GIVEN, - timezone: str | NotGiven = NOT_GIVEN, + activated: bool | Omit = omit, + interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_hour_of_day: float | Omit = omit, + notes: str | Omit = omit, + provision_license: bool | Omit = omit, + timezone: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectorUpdateResponse: """ - Replace Connector + Replace Connector or Re-provision License Key Args: account_id: Account identifier + provision_license: When true, regenerate license key for the connector. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -336,6 +507,7 @@ async def update( "interrupt_window_duration_hours": interrupt_window_duration_hours, "interrupt_window_hour_of_day": interrupt_window_hour_of_day, "notes": notes, + "provision_license": provision_license, "timezone": timezone, }, connector_update_params.ConnectorUpdateParams, @@ -359,7 +531,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ConnectorListResponse, AsyncSinglePage[ConnectorListResponse]]: """ List Connectors @@ -386,29 +558,74 @@ def list( model=ConnectorListResponse, ) + async def delete( + self, + connector_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, + ) -> ConnectorDeleteResponse: + """ + Remove a connector from your account + + Args: + account_id: Account 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not connector_id: + raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}") + return await self._delete( + f"/accounts/{account_id}/magic/connectors/{connector_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ConnectorDeleteResponse]._unwrapper, + ), + cast_to=cast(Type[ConnectorDeleteResponse], ResultWrapper[ConnectorDeleteResponse]), + ) + async def edit( self, connector_id: str, *, account_id: str, - activated: bool | NotGiven = NOT_GIVEN, - interrupt_window_duration_hours: float | NotGiven = NOT_GIVEN, - interrupt_window_hour_of_day: float | NotGiven = NOT_GIVEN, - notes: str | NotGiven = NOT_GIVEN, - timezone: str | NotGiven = NOT_GIVEN, + activated: bool | Omit = omit, + interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_hour_of_day: float | Omit = omit, + notes: str | Omit = omit, + provision_license: bool | Omit = omit, + timezone: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectorEditResponse: """ - Update Connector + Edit Connector to update specific properties or Re-provision License Key Args: account_id: Account identifier + provision_license: When true, regenerate license key for the connector. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -429,6 +646,7 @@ async def edit( "interrupt_window_duration_hours": interrupt_window_duration_hours, "interrupt_window_hour_of_day": interrupt_window_hour_of_day, "notes": notes, + "provision_license": provision_license, "timezone": timezone, }, connector_edit_params.ConnectorEditParams, @@ -453,7 +671,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectorGetResponse: """ Fetch Connector @@ -490,12 +708,18 @@ class ConnectorsResourceWithRawResponse: def __init__(self, connectors: ConnectorsResource) -> None: self._connectors = connectors + self.create = to_raw_response_wrapper( + connectors.create, + ) self.update = to_raw_response_wrapper( connectors.update, ) self.list = to_raw_response_wrapper( connectors.list, ) + self.delete = to_raw_response_wrapper( + connectors.delete, + ) self.edit = to_raw_response_wrapper( connectors.edit, ) @@ -516,12 +740,18 @@ class AsyncConnectorsResourceWithRawResponse: def __init__(self, connectors: AsyncConnectorsResource) -> None: self._connectors = connectors + self.create = async_to_raw_response_wrapper( + connectors.create, + ) self.update = async_to_raw_response_wrapper( connectors.update, ) self.list = async_to_raw_response_wrapper( connectors.list, ) + self.delete = async_to_raw_response_wrapper( + connectors.delete, + ) self.edit = async_to_raw_response_wrapper( connectors.edit, ) @@ -542,12 +772,18 @@ class ConnectorsResourceWithStreamingResponse: def __init__(self, connectors: ConnectorsResource) -> None: self._connectors = connectors + self.create = to_streamed_response_wrapper( + connectors.create, + ) self.update = to_streamed_response_wrapper( connectors.update, ) self.list = to_streamed_response_wrapper( connectors.list, ) + self.delete = to_streamed_response_wrapper( + connectors.delete, + ) self.edit = to_streamed_response_wrapper( connectors.edit, ) @@ -568,12 +804,18 @@ class AsyncConnectorsResourceWithStreamingResponse: def __init__(self, connectors: AsyncConnectorsResource) -> None: self._connectors = connectors + self.create = async_to_streamed_response_wrapper( + connectors.create, + ) self.update = async_to_streamed_response_wrapper( connectors.update, ) self.list = async_to_streamed_response_wrapper( connectors.list, ) + self.delete = async_to_streamed_response_wrapper( + connectors.delete, + ) self.edit = async_to_streamed_response_wrapper( connectors.edit, ) diff --git a/src/cloudflare/resources/magic_transit/connectors/events/events.py b/src/cloudflare/resources/magic_transit/connectors/events/events.py index e549050a08e..d02f170e0f5 100644 --- a/src/cloudflare/resources/magic_transit/connectors/events/events.py +++ b/src/cloudflare/resources/magic_transit/connectors/events/events.py @@ -14,7 +14,7 @@ LatestResourceWithStreamingResponse, AsyncLatestResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -64,14 +64,15 @@ def list( account_id: str, from_: float, to: float, - cursor: str | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, + cursor: str | Omit = omit, + k: 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventListResponse: """ List Events @@ -79,6 +80,8 @@ def list( Args: account_id: Account identifier + k: Filter by event kind + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -103,6 +106,7 @@ def list( "from_": from_, "to": to, "cursor": cursor, + "k": k, "limit": limit, }, event_list_params.EventListParams, @@ -124,7 +128,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventGetResponse: """ Get Event @@ -188,14 +192,15 @@ async def list( account_id: str, from_: float, to: float, - cursor: str | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, + cursor: str | Omit = omit, + k: 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventListResponse: """ List Events @@ -203,6 +208,8 @@ async def list( Args: account_id: Account identifier + k: Filter by event kind + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -227,6 +234,7 @@ async def list( "from_": from_, "to": to, "cursor": cursor, + "k": k, "limit": limit, }, event_list_params.EventListParams, @@ -248,7 +256,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventGetResponse: """ Get Event diff --git a/src/cloudflare/resources/magic_transit/connectors/events/latest.py b/src/cloudflare/resources/magic_transit/connectors/events/latest.py index 4b3fa920a82..a3bec2ee768 100644 --- a/src/cloudflare/resources/magic_transit/connectors/events/latest.py +++ b/src/cloudflare/resources/magic_transit/connectors/events/latest.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -52,7 +52,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LatestListResponse: """ Get latest Events @@ -115,7 +115,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LatestListResponse: """ Get latest Events diff --git a/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py b/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py index 3b55a6e40b6..6f682411445 100644 --- a/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py +++ b/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -52,7 +52,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LatestListResponse: """ Get latest Snapshots @@ -115,7 +115,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LatestListResponse: """ Get latest Snapshots diff --git a/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py b/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py index 0d441ae8828..6a2d8029801 100644 --- a/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py +++ b/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py @@ -14,7 +14,7 @@ LatestResourceWithStreamingResponse, AsyncLatestResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -64,14 +64,14 @@ def list( account_id: str, from_: float, to: float, - cursor: str | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SnapshotListResponse: """ List Snapshots @@ -123,7 +123,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SnapshotGetResponse: """ Get Snapshot @@ -187,14 +187,14 @@ async def list( account_id: str, from_: float, to: float, - cursor: str | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SnapshotListResponse: """ List Snapshots @@ -246,7 +246,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SnapshotGetResponse: """ Get Snapshot diff --git a/src/cloudflare/resources/magic_transit/gre_tunnels.py b/src/cloudflare/resources/magic_transit/gre_tunnels.py index 57a915e7372..ffd5ac90504 100644 --- a/src/cloudflare/resources/magic_transit/gre_tunnels.py +++ b/src/cloudflare/resources/magic_transit/gre_tunnels.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -57,17 +57,20 @@ def create( customer_gre_endpoint: str, interface_address: str, name: str, - description: str | NotGiven = NOT_GIVEN, - health_check: gre_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN, - mtu: int | NotGiven = NOT_GIVEN, - ttl: int | NotGiven = NOT_GIVEN, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + automatic_return_routing: bool | Omit = omit, + bgp: gre_tunnel_create_params.BGP | Omit = omit, + description: str | Omit = omit, + health_check: gre_tunnel_create_params.HealthCheck | Omit = omit, + interface_address6: str | Omit = omit, + mtu: int | Omit = omit, + ttl: int | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelCreateResponse: """Creates a new GRE tunnel. @@ -88,8 +91,16 @@ def create( name: The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. + automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false + otherwise. + description: An optional description of the GRE tunnel. + interface_address6: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + address being the first IP of the subnet and not same as the address of + virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + mtu: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. @@ -110,7 +121,7 @@ def create( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -123,8 +134,11 @@ def create( "customer_gre_endpoint": customer_gre_endpoint, "interface_address": interface_address, "name": name, + "automatic_return_routing": automatic_return_routing, + "bgp": bgp, "description": description, "health_check": health_check, + "interface_address6": interface_address6, "mtu": mtu, "ttl": ttl, }, @@ -149,17 +163,19 @@ def update( customer_gre_endpoint: str, interface_address: str, name: str, - description: str | NotGiven = NOT_GIVEN, - health_check: gre_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN, - mtu: int | NotGiven = NOT_GIVEN, - ttl: int | NotGiven = NOT_GIVEN, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + automatic_return_routing: bool | Omit = omit, + description: str | Omit = omit, + health_check: gre_tunnel_update_params.HealthCheck | Omit = omit, + interface_address6: str | Omit = omit, + mtu: int | Omit = omit, + ttl: int | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelUpdateResponse: """Updates a specific GRE tunnel. @@ -182,8 +198,16 @@ def update( name: The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. + automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false + otherwise. + description: An optional description of the GRE tunnel. + interface_address6: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + address being the first IP of the subnet and not same as the address of + virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + mtu: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. @@ -206,7 +230,7 @@ def update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -219,8 +243,10 @@ def update( "customer_gre_endpoint": customer_gre_endpoint, "interface_address": interface_address, "name": name, + "automatic_return_routing": automatic_return_routing, "description": description, "health_check": health_check, + "interface_address6": interface_address6, "mtu": mtu, "ttl": ttl, }, @@ -240,13 +266,13 @@ def list( self, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelListResponse: """ Lists GRE tunnels associated with an account. @@ -269,7 +295,7 @@ def list( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -291,13 +317,13 @@ def delete( gre_tunnel_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelDeleteResponse: """Disables and removes a specific static GRE tunnel. @@ -326,7 +352,7 @@ def delete( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -348,13 +374,13 @@ def bulk_update( *, account_id: str, body: object, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelBulkUpdateResponse: """Updates multiple GRE tunnels. @@ -379,7 +405,7 @@ def bulk_update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -402,13 +428,13 @@ def get( gre_tunnel_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelGetResponse: """ Lists informtion for a specific GRE tunnel. @@ -435,7 +461,7 @@ def get( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -481,17 +507,20 @@ async def create( customer_gre_endpoint: str, interface_address: str, name: str, - description: str | NotGiven = NOT_GIVEN, - health_check: gre_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN, - mtu: int | NotGiven = NOT_GIVEN, - ttl: int | NotGiven = NOT_GIVEN, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + automatic_return_routing: bool | Omit = omit, + bgp: gre_tunnel_create_params.BGP | Omit = omit, + description: str | Omit = omit, + health_check: gre_tunnel_create_params.HealthCheck | Omit = omit, + interface_address6: str | Omit = omit, + mtu: int | Omit = omit, + ttl: int | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelCreateResponse: """Creates a new GRE tunnel. @@ -512,8 +541,16 @@ async def create( name: The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. + automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false + otherwise. + description: An optional description of the GRE tunnel. + interface_address6: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + address being the first IP of the subnet and not same as the address of + virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + mtu: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. @@ -534,7 +571,7 @@ async def create( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -547,8 +584,11 @@ async def create( "customer_gre_endpoint": customer_gre_endpoint, "interface_address": interface_address, "name": name, + "automatic_return_routing": automatic_return_routing, + "bgp": bgp, "description": description, "health_check": health_check, + "interface_address6": interface_address6, "mtu": mtu, "ttl": ttl, }, @@ -573,17 +613,19 @@ async def update( customer_gre_endpoint: str, interface_address: str, name: str, - description: str | NotGiven = NOT_GIVEN, - health_check: gre_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN, - mtu: int | NotGiven = NOT_GIVEN, - ttl: int | NotGiven = NOT_GIVEN, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + automatic_return_routing: bool | Omit = omit, + description: str | Omit = omit, + health_check: gre_tunnel_update_params.HealthCheck | Omit = omit, + interface_address6: str | Omit = omit, + mtu: int | Omit = omit, + ttl: int | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelUpdateResponse: """Updates a specific GRE tunnel. @@ -606,8 +648,16 @@ async def update( name: The name of the tunnel. The name cannot contain spaces or special characters, must be 15 characters or less, and cannot share a name with another GRE tunnel. + automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false + otherwise. + description: An optional description of the GRE tunnel. + interface_address6: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + address being the first IP of the subnet and not same as the address of + virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + mtu: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The minimum value is 576. @@ -630,7 +680,7 @@ async def update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -643,8 +693,10 @@ async def update( "customer_gre_endpoint": customer_gre_endpoint, "interface_address": interface_address, "name": name, + "automatic_return_routing": automatic_return_routing, "description": description, "health_check": health_check, + "interface_address6": interface_address6, "mtu": mtu, "ttl": ttl, }, @@ -664,13 +716,13 @@ async def list( self, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelListResponse: """ Lists GRE tunnels associated with an account. @@ -693,7 +745,7 @@ async def list( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -715,13 +767,13 @@ async def delete( gre_tunnel_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelDeleteResponse: """Disables and removes a specific static GRE tunnel. @@ -750,7 +802,7 @@ async def delete( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -772,13 +824,13 @@ async def bulk_update( *, account_id: str, body: object, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelBulkUpdateResponse: """Updates multiple GRE tunnels. @@ -803,7 +855,7 @@ async def bulk_update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -826,13 +878,13 @@ async def get( gre_tunnel_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GRETunnelGetResponse: """ Lists informtion for a specific GRE tunnel. @@ -859,7 +911,7 @@ async def get( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), diff --git a/src/cloudflare/resources/magic_transit/ipsec_tunnels.py b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py index 14162a94440..3f3e8de9c21 100644 --- a/src/cloudflare/resources/magic_transit/ipsec_tunnels.py +++ b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -62,18 +62,21 @@ def create( cloudflare_endpoint: str, interface_address: str, name: str, - customer_endpoint: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - health_check: ipsec_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN, - psk: str | NotGiven = NOT_GIVEN, - replay_protection: bool | NotGiven = NOT_GIVEN, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + automatic_return_routing: bool | Omit = omit, + bgp: ipsec_tunnel_create_params.BGP | Omit = omit, + customer_endpoint: str | Omit = omit, + description: str | Omit = omit, + health_check: ipsec_tunnel_create_params.HealthCheck | Omit = omit, + interface_address6: str | Omit = omit, + psk: str | Omit = omit, + replay_protection: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelCreateResponse: """Creates a new IPsec tunnel associated with an account. @@ -92,11 +95,19 @@ def create( name: The name of the IPsec tunnel. The name cannot share a name with other tunnels. + automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false + otherwise. + customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. description: An optional description forthe IPsec tunnel. + interface_address6: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + address being the first IP of the subnet and not same as the address of + virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + psk: A randomly generated or provided string for use in the IPsec tunnel. replay_protection: If `true`, then IPsec replay protection will be supported in the @@ -117,7 +128,7 @@ def create( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -129,9 +140,12 @@ def create( "cloudflare_endpoint": cloudflare_endpoint, "interface_address": interface_address, "name": name, + "automatic_return_routing": automatic_return_routing, + "bgp": bgp, "customer_endpoint": customer_endpoint, "description": description, "health_check": health_check, + "interface_address6": interface_address6, "psk": psk, "replay_protection": replay_protection, }, @@ -155,18 +169,21 @@ def update( cloudflare_endpoint: str, interface_address: str, name: str, - customer_endpoint: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - health_check: ipsec_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN, - psk: str | NotGiven = NOT_GIVEN, - replay_protection: bool | NotGiven = NOT_GIVEN, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + automatic_return_routing: bool | Omit = omit, + bgp: ipsec_tunnel_update_params.BGP | Omit = omit, + customer_endpoint: str | Omit = omit, + description: str | Omit = omit, + health_check: ipsec_tunnel_update_params.HealthCheck | Omit = omit, + interface_address6: str | Omit = omit, + psk: str | Omit = omit, + replay_protection: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelUpdateResponse: """Updates a specific IPsec tunnel associated with an account. @@ -187,11 +204,19 @@ def update( name: The name of the IPsec tunnel. The name cannot share a name with other tunnels. + automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false + otherwise. + customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. description: An optional description forthe IPsec tunnel. + interface_address6: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + address being the first IP of the subnet and not same as the address of + virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + psk: A randomly generated or provided string for use in the IPsec tunnel. replay_protection: If `true`, then IPsec replay protection will be supported in the @@ -214,7 +239,7 @@ def update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -226,9 +251,12 @@ def update( "cloudflare_endpoint": cloudflare_endpoint, "interface_address": interface_address, "name": name, + "automatic_return_routing": automatic_return_routing, + "bgp": bgp, "customer_endpoint": customer_endpoint, "description": description, "health_check": health_check, + "interface_address6": interface_address6, "psk": psk, "replay_protection": replay_protection, }, @@ -248,13 +276,13 @@ def list( self, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelListResponse: """ Lists IPsec tunnels associated with an account. @@ -277,7 +305,7 @@ def list( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -299,13 +327,13 @@ def delete( ipsec_tunnel_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelDeleteResponse: """ Disables and removes a specific static IPsec Tunnel associated with an account. @@ -334,7 +362,7 @@ def delete( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -356,13 +384,13 @@ def bulk_update( *, account_id: str, body: object, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelBulkUpdateResponse: """Update multiple IPsec tunnels associated with an account. @@ -388,7 +416,7 @@ def bulk_update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -411,13 +439,13 @@ def get( ipsec_tunnel_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelGetResponse: """ Lists details for a specific IPsec tunnel. @@ -444,7 +472,7 @@ def get( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -472,7 +500,7 @@ def psk_generate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelPSKGenerateResponse: """ Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session. @@ -539,18 +567,21 @@ async def create( cloudflare_endpoint: str, interface_address: str, name: str, - customer_endpoint: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - health_check: ipsec_tunnel_create_params.HealthCheck | NotGiven = NOT_GIVEN, - psk: str | NotGiven = NOT_GIVEN, - replay_protection: bool | NotGiven = NOT_GIVEN, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + automatic_return_routing: bool | Omit = omit, + bgp: ipsec_tunnel_create_params.BGP | Omit = omit, + customer_endpoint: str | Omit = omit, + description: str | Omit = omit, + health_check: ipsec_tunnel_create_params.HealthCheck | Omit = omit, + interface_address6: str | Omit = omit, + psk: str | Omit = omit, + replay_protection: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelCreateResponse: """Creates a new IPsec tunnel associated with an account. @@ -569,11 +600,19 @@ async def create( name: The name of the IPsec tunnel. The name cannot share a name with other tunnels. + automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false + otherwise. + customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. description: An optional description forthe IPsec tunnel. + interface_address6: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + address being the first IP of the subnet and not same as the address of + virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + psk: A randomly generated or provided string for use in the IPsec tunnel. replay_protection: If `true`, then IPsec replay protection will be supported in the @@ -594,7 +633,7 @@ async def create( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -606,9 +645,12 @@ async def create( "cloudflare_endpoint": cloudflare_endpoint, "interface_address": interface_address, "name": name, + "automatic_return_routing": automatic_return_routing, + "bgp": bgp, "customer_endpoint": customer_endpoint, "description": description, "health_check": health_check, + "interface_address6": interface_address6, "psk": psk, "replay_protection": replay_protection, }, @@ -632,18 +674,21 @@ async def update( cloudflare_endpoint: str, interface_address: str, name: str, - customer_endpoint: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - health_check: ipsec_tunnel_update_params.HealthCheck | NotGiven = NOT_GIVEN, - psk: str | NotGiven = NOT_GIVEN, - replay_protection: bool | NotGiven = NOT_GIVEN, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + automatic_return_routing: bool | Omit = omit, + bgp: ipsec_tunnel_update_params.BGP | Omit = omit, + customer_endpoint: str | Omit = omit, + description: str | Omit = omit, + health_check: ipsec_tunnel_update_params.HealthCheck | Omit = omit, + interface_address6: str | Omit = omit, + psk: str | Omit = omit, + replay_protection: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelUpdateResponse: """Updates a specific IPsec tunnel associated with an account. @@ -664,11 +709,19 @@ async def update( name: The name of the IPsec tunnel. The name cannot share a name with other tunnels. + automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false + otherwise. + customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel. Not required, but must be set for proactive traceroutes to work. description: An optional description forthe IPsec tunnel. + interface_address6: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + address being the first IP of the subnet and not same as the address of + virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + psk: A randomly generated or provided string for use in the IPsec tunnel. replay_protection: If `true`, then IPsec replay protection will be supported in the @@ -691,7 +744,7 @@ async def update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -703,9 +756,12 @@ async def update( "cloudflare_endpoint": cloudflare_endpoint, "interface_address": interface_address, "name": name, + "automatic_return_routing": automatic_return_routing, + "bgp": bgp, "customer_endpoint": customer_endpoint, "description": description, "health_check": health_check, + "interface_address6": interface_address6, "psk": psk, "replay_protection": replay_protection, }, @@ -725,13 +781,13 @@ async def list( self, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelListResponse: """ Lists IPsec tunnels associated with an account. @@ -754,7 +810,7 @@ async def list( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -776,13 +832,13 @@ async def delete( ipsec_tunnel_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelDeleteResponse: """ Disables and removes a specific static IPsec Tunnel associated with an account. @@ -811,7 +867,7 @@ async def delete( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -833,13 +889,13 @@ async def bulk_update( *, account_id: str, body: object, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelBulkUpdateResponse: """Update multiple IPsec tunnels associated with an account. @@ -865,7 +921,7 @@ async def bulk_update( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -888,13 +944,13 @@ async def get( ipsec_tunnel_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelGetResponse: """ Lists details for a specific IPsec tunnel. @@ -921,7 +977,7 @@ async def get( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -949,7 +1005,7 @@ async def psk_generate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPSECTunnelPSKGenerateResponse: """ Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session. diff --git a/src/cloudflare/resources/magic_transit/pcaps/download.py b/src/cloudflare/resources/magic_transit/pcaps/download.py index f354fa8c704..780af5ba4ce 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/download.py +++ b/src/cloudflare/resources/magic_transit/pcaps/download.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -52,16 +52,16 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """Download PCAP information into a file. Response is a binary PCAP file. Args: - account_id: Identifier + account_id: Identifier. - pcap_id: Identifier + pcap_id: Identifier. extra_headers: Send extra headers @@ -115,16 +115,16 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """Download PCAP information into a file. Response is a binary PCAP file. Args: - account_id: Identifier + account_id: Identifier. - pcap_id: Identifier + pcap_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/magic_transit/pcaps/ownership.py b/src/cloudflare/resources/magic_transit/pcaps/ownership.py index bd642b5f5b9..76e096bbcfd 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/ownership.py +++ b/src/cloudflare/resources/magic_transit/pcaps/ownership.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +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 @@ -55,13 +55,13 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Ownership: """ Adds an AWS or GCP bucket to use with full packet captures. Args: - account_id: Identifier + account_id: Identifier. destination_conf: The full URI for the bucket. This field only applies to `full` packet captures. @@ -98,15 +98,15 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes buckets added to the packet captures API. Args: - account_id: Identifier + account_id: Identifier. - ownership_id: Identifier + ownership_id: Identifier. extra_headers: Send extra headers @@ -138,13 +138,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Ownership]: """ List all buckets configured for use with PCAPs API. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -176,13 +176,13 @@ def validate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Ownership: """ Validates buckets added to the packet captures API. Args: - account_id: Identifier + account_id: Identifier. destination_conf: The full URI for the bucket. This field only applies to `full` packet captures. @@ -248,13 +248,13 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Ownership: """ Adds an AWS or GCP bucket to use with full packet captures. Args: - account_id: Identifier + account_id: Identifier. destination_conf: The full URI for the bucket. This field only applies to `full` packet captures. @@ -293,15 +293,15 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes buckets added to the packet captures API. Args: - account_id: Identifier + account_id: Identifier. - ownership_id: Identifier + ownership_id: Identifier. extra_headers: Send extra headers @@ -333,13 +333,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Ownership, AsyncSinglePage[Ownership]]: """ List all buckets configured for use with PCAPs API. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -371,13 +371,13 @@ async def validate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Ownership: """ Validates buckets added to the packet captures API. Args: - account_id: Identifier + account_id: Identifier. destination_conf: The full URI for the bucket. This field only applies to `full` packet captures. diff --git a/src/cloudflare/resources/magic_transit/pcaps/pcaps.py b/src/cloudflare/resources/magic_transit/pcaps/pcaps.py index f5f09d51dfd..27d7c351c5f 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/pcaps.py +++ b/src/cloudflare/resources/magic_transit/pcaps/pcaps.py @@ -16,7 +16,7 @@ DownloadResourceWithStreamingResponse, AsyncDownloadResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ...._utils import required_args, maybe_transform, async_maybe_transform from .ownership import ( OwnershipResource, @@ -83,20 +83,20 @@ def create( system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN, - offset_time: Union[str, datetime] | NotGiven = NOT_GIVEN, + filter_v1: PCAPFilterParam | Omit = omit, + offset_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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PCAPCreateResponse: """ Create new PCAP request for account. Args: - account_id: Identifier + account_id: Identifier. packet_limit: The limit of packets contained in a packet capture. @@ -132,21 +132,21 @@ def create( system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - byte_limit: float | NotGiven = NOT_GIVEN, - filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN, - packet_limit: float | NotGiven = NOT_GIVEN, + byte_limit: float | Omit = omit, + filter_v1: PCAPFilterParam | Omit = omit, + packet_limit: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PCAPCreateResponse: """ Create new PCAP request for account. Args: - account_id: Identifier + account_id: Identifier. colo_name: The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` @@ -186,21 +186,21 @@ def create( self, *, account_id: str, - packet_limit: float | NotGiven = NOT_GIVEN, + packet_limit: float | Omit = omit, system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN, - offset_time: Union[str, datetime] | NotGiven = NOT_GIVEN, - colo_name: str | NotGiven = NOT_GIVEN, - destination_conf: str | NotGiven = NOT_GIVEN, - byte_limit: float | NotGiven = NOT_GIVEN, + filter_v1: PCAPFilterParam | Omit = omit, + offset_time: Union[str, datetime] | Omit = omit, + colo_name: str | Omit = omit, + destination_conf: str | Omit = omit, + byte_limit: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PCAPCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -244,13 +244,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PCAPListResponse]: """ Lists all packet capture requests for an account. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -281,15 +281,15 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PCAPGetResponse: """ Get information for a PCAP request by id. Args: - account_id: Identifier + account_id: Identifier. - pcap_id: Identifier + pcap_id: Identifier. extra_headers: Send extra headers @@ -330,15 +330,15 @@ def stop( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ - Stop full PCAP + Stop full PCAP. Args: - account_id: Identifier + account_id: Identifier. - pcap_id: Identifier + pcap_id: Identifier. extra_headers: Send extra headers @@ -399,20 +399,20 @@ async def create( system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN, - offset_time: Union[str, datetime] | NotGiven = NOT_GIVEN, + filter_v1: PCAPFilterParam | Omit = omit, + offset_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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PCAPCreateResponse: """ Create new PCAP request for account. Args: - account_id: Identifier + account_id: Identifier. packet_limit: The limit of packets contained in a packet capture. @@ -448,21 +448,21 @@ async def create( system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - byte_limit: float | NotGiven = NOT_GIVEN, - filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN, - packet_limit: float | NotGiven = NOT_GIVEN, + byte_limit: float | Omit = omit, + filter_v1: PCAPFilterParam | Omit = omit, + packet_limit: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PCAPCreateResponse: """ Create new PCAP request for account. Args: - account_id: Identifier + account_id: Identifier. colo_name: The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` @@ -502,21 +502,21 @@ async def create( self, *, account_id: str, - packet_limit: float | NotGiven = NOT_GIVEN, + packet_limit: float | Omit = omit, system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - filter_v1: PCAPFilterParam | NotGiven = NOT_GIVEN, - offset_time: Union[str, datetime] | NotGiven = NOT_GIVEN, - colo_name: str | NotGiven = NOT_GIVEN, - destination_conf: str | NotGiven = NOT_GIVEN, - byte_limit: float | NotGiven = NOT_GIVEN, + filter_v1: PCAPFilterParam | Omit = omit, + offset_time: Union[str, datetime] | Omit = omit, + colo_name: str | Omit = omit, + destination_conf: str | Omit = omit, + byte_limit: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PCAPCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -560,13 +560,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PCAPListResponse, AsyncSinglePage[PCAPListResponse]]: """ Lists all packet capture requests for an account. Args: - account_id: Identifier + account_id: Identifier. extra_headers: Send extra headers @@ -597,15 +597,15 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PCAPGetResponse: """ Get information for a PCAP request by id. Args: - account_id: Identifier + account_id: Identifier. - pcap_id: Identifier + pcap_id: Identifier. extra_headers: Send extra headers @@ -646,15 +646,15 @@ async def stop( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ - Stop full PCAP + Stop full PCAP. Args: - account_id: Identifier + account_id: Identifier. - pcap_id: Identifier + pcap_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/magic_transit/routes.py b/src/cloudflare/resources/magic_transit/routes.py index 6654b3f1d51..b38cd58d58e 100644 --- a/src/cloudflare/resources/magic_transit/routes.py +++ b/src/cloudflare/resources/magic_transit/routes.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,15 +58,15 @@ def create( nexthop: str, prefix: str, priority: int, - description: str | NotGiven = NOT_GIVEN, - scope: ScopeParam | NotGiven = NOT_GIVEN, - weight: int | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + scope: ScopeParam | Omit = omit, + weight: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteCreateResponse: """Creates a new Magic static route. @@ -129,15 +129,15 @@ def update( nexthop: str, prefix: str, priority: int, - description: str | NotGiven = NOT_GIVEN, - scope: ScopeParam | NotGiven = NOT_GIVEN, - weight: int | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + scope: ScopeParam | Omit = omit, + weight: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteUpdateResponse: """Update a specific Magic static route. @@ -205,7 +205,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteListResponse: """ List all Magic static routes. @@ -245,7 +245,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteDeleteResponse: """ Disable and remove a specific Magic static route. @@ -289,7 +289,7 @@ def bulk_update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteBulkUpdateResponse: """Update multiple Magic static routes. @@ -332,7 +332,7 @@ def empty( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteEmptyResponse: """ Delete multiple Magic static routes. @@ -372,7 +372,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteGetResponse: """ Get a specific Magic static route. @@ -434,15 +434,15 @@ async def create( nexthop: str, prefix: str, priority: int, - description: str | NotGiven = NOT_GIVEN, - scope: ScopeParam | NotGiven = NOT_GIVEN, - weight: int | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + scope: ScopeParam | Omit = omit, + weight: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteCreateResponse: """Creates a new Magic static route. @@ -505,15 +505,15 @@ async def update( nexthop: str, prefix: str, priority: int, - description: str | NotGiven = NOT_GIVEN, - scope: ScopeParam | NotGiven = NOT_GIVEN, - weight: int | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + scope: ScopeParam | Omit = omit, + weight: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteUpdateResponse: """Update a specific Magic static route. @@ -581,7 +581,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteListResponse: """ List all Magic static routes. @@ -621,7 +621,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteDeleteResponse: """ Disable and remove a specific Magic static route. @@ -665,7 +665,7 @@ async def bulk_update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteBulkUpdateResponse: """Update multiple Magic static routes. @@ -708,7 +708,7 @@ async def empty( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteEmptyResponse: """ Delete multiple Magic static routes. @@ -748,7 +748,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteGetResponse: """ Get a specific Magic static route. diff --git a/src/cloudflare/resources/magic_transit/sites/acls.py b/src/cloudflare/resources/magic_transit/sites/acls.py index 638385312d4..309e9a5c9ac 100644 --- a/src/cloudflare/resources/magic_transit/sites/acls.py +++ b/src/cloudflare/resources/magic_transit/sites/acls.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,16 +55,16 @@ def create( lan_1: ACLConfigurationParam, lan_2: ACLConfigurationParam, name: str, - description: str | NotGiven = NOT_GIVEN, - forward_locally: bool | NotGiven = NOT_GIVEN, - protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + forward_locally: bool | Omit = omit, + protocols: List[AllowedProtocol] | Omit = omit, + unidirectional: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ACL: """ Creates a new Site ACL. @@ -129,19 +129,19 @@ def update( *, account_id: str, site_id: str, - description: str | NotGiven = NOT_GIVEN, - forward_locally: bool | NotGiven = NOT_GIVEN, - lan_1: ACLConfigurationParam | NotGiven = NOT_GIVEN, - lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + forward_locally: bool | Omit = omit, + lan_1: ACLConfigurationParam | Omit = omit, + lan_2: ACLConfigurationParam | Omit = omit, + name: str | Omit = omit, + protocols: List[AllowedProtocol] | Omit = omit, + unidirectional: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ACL: """ Update a specific Site ACL. @@ -214,7 +214,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ACL]: """ Lists Site ACLs associated with an account. @@ -256,7 +256,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ACL: """ Remove a specific Site ACL. @@ -300,19 +300,19 @@ def edit( *, account_id: str, site_id: str, - description: str | NotGiven = NOT_GIVEN, - forward_locally: bool | NotGiven = NOT_GIVEN, - lan_1: ACLConfigurationParam | NotGiven = NOT_GIVEN, - lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + forward_locally: bool | Omit = omit, + lan_1: ACLConfigurationParam | Omit = omit, + lan_2: ACLConfigurationParam | Omit = omit, + name: str | Omit = omit, + protocols: List[AllowedProtocol] | Omit = omit, + unidirectional: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ACL: """ Patch a specific Site ACL. @@ -386,7 +386,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ACL: """ Get a specific Site ACL. @@ -453,16 +453,16 @@ async def create( lan_1: ACLConfigurationParam, lan_2: ACLConfigurationParam, name: str, - description: str | NotGiven = NOT_GIVEN, - forward_locally: bool | NotGiven = NOT_GIVEN, - protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + forward_locally: bool | Omit = omit, + protocols: List[AllowedProtocol] | Omit = omit, + unidirectional: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ACL: """ Creates a new Site ACL. @@ -527,19 +527,19 @@ async def update( *, account_id: str, site_id: str, - description: str | NotGiven = NOT_GIVEN, - forward_locally: bool | NotGiven = NOT_GIVEN, - lan_1: ACLConfigurationParam | NotGiven = NOT_GIVEN, - lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + forward_locally: bool | Omit = omit, + lan_1: ACLConfigurationParam | Omit = omit, + lan_2: ACLConfigurationParam | Omit = omit, + name: str | Omit = omit, + protocols: List[AllowedProtocol] | Omit = omit, + unidirectional: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ACL: """ Update a specific Site ACL. @@ -612,7 +612,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ACL, AsyncSinglePage[ACL]]: """ Lists Site ACLs associated with an account. @@ -654,7 +654,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ACL: """ Remove a specific Site ACL. @@ -698,19 +698,19 @@ async def edit( *, account_id: str, site_id: str, - description: str | NotGiven = NOT_GIVEN, - forward_locally: bool | NotGiven = NOT_GIVEN, - lan_1: ACLConfigurationParam | NotGiven = NOT_GIVEN, - lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, - unidirectional: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + forward_locally: bool | Omit = omit, + lan_1: ACLConfigurationParam | Omit = omit, + lan_2: ACLConfigurationParam | Omit = omit, + name: str | Omit = omit, + protocols: List[AllowedProtocol] | Omit = omit, + unidirectional: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ACL: """ Patch a specific Site ACL. @@ -784,7 +784,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ACL: """ Get a specific Site ACL. diff --git a/src/cloudflare/resources/magic_transit/sites/lans.py b/src/cloudflare/resources/magic_transit/sites/lans.py index f3aa887e8ca..239adfec326 100644 --- a/src/cloudflare/resources/magic_transit/sites/lans.py +++ b/src/cloudflare/resources/magic_transit/sites/lans.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,18 +58,18 @@ def create( *, account_id: str, physport: int, - ha_link: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - nat: NatParam | NotGiven = NOT_GIVEN, - routed_subnets: Iterable[RoutedSubnetParam] | NotGiven = NOT_GIVEN, - static_addressing: LANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + ha_link: bool | Omit = omit, + name: str | Omit = omit, + nat: NatParam | Omit = omit, + routed_subnets: Iterable[RoutedSubnetParam] | Omit = omit, + static_addressing: LANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[LAN]: """Creates a new Site LAN. @@ -130,18 +130,18 @@ def update( *, account_id: str, site_id: str, - name: str | NotGiven = NOT_GIVEN, - nat: NatParam | NotGiven = NOT_GIVEN, - physport: int | NotGiven = NOT_GIVEN, - routed_subnets: Iterable[RoutedSubnetParam] | NotGiven = NOT_GIVEN, - static_addressing: LANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + nat: NatParam | Omit = omit, + physport: int | Omit = omit, + routed_subnets: Iterable[RoutedSubnetParam] | Omit = omit, + static_addressing: LANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LAN: """ Update a specific Site LAN. @@ -206,7 +206,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[LAN]: """ Lists Site LANs associated with an account. @@ -248,7 +248,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LAN: """ Remove a specific Site LAN. @@ -292,18 +292,18 @@ def edit( *, account_id: str, site_id: str, - name: str | NotGiven = NOT_GIVEN, - nat: NatParam | NotGiven = NOT_GIVEN, - physport: int | NotGiven = NOT_GIVEN, - routed_subnets: Iterable[RoutedSubnetParam] | NotGiven = NOT_GIVEN, - static_addressing: LANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + nat: NatParam | Omit = omit, + physport: int | Omit = omit, + routed_subnets: Iterable[RoutedSubnetParam] | Omit = omit, + static_addressing: LANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LAN: """ Patch a specific Site LAN. @@ -369,7 +369,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LAN: """ Get a specific Site LAN. @@ -434,18 +434,18 @@ def create( *, account_id: str, physport: int, - ha_link: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - nat: NatParam | NotGiven = NOT_GIVEN, - routed_subnets: Iterable[RoutedSubnetParam] | NotGiven = NOT_GIVEN, - static_addressing: LANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + ha_link: bool | Omit = omit, + name: str | Omit = omit, + nat: NatParam | Omit = omit, + routed_subnets: Iterable[RoutedSubnetParam] | Omit = omit, + static_addressing: LANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[LAN, AsyncSinglePage[LAN]]: """Creates a new Site LAN. @@ -506,18 +506,18 @@ async def update( *, account_id: str, site_id: str, - name: str | NotGiven = NOT_GIVEN, - nat: NatParam | NotGiven = NOT_GIVEN, - physport: int | NotGiven = NOT_GIVEN, - routed_subnets: Iterable[RoutedSubnetParam] | NotGiven = NOT_GIVEN, - static_addressing: LANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + nat: NatParam | Omit = omit, + physport: int | Omit = omit, + routed_subnets: Iterable[RoutedSubnetParam] | Omit = omit, + static_addressing: LANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LAN: """ Update a specific Site LAN. @@ -582,7 +582,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[LAN, AsyncSinglePage[LAN]]: """ Lists Site LANs associated with an account. @@ -624,7 +624,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LAN: """ Remove a specific Site LAN. @@ -668,18 +668,18 @@ async def edit( *, account_id: str, site_id: str, - name: str | NotGiven = NOT_GIVEN, - nat: NatParam | NotGiven = NOT_GIVEN, - physport: int | NotGiven = NOT_GIVEN, - routed_subnets: Iterable[RoutedSubnetParam] | NotGiven = NOT_GIVEN, - static_addressing: LANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + nat: NatParam | Omit = omit, + physport: int | Omit = omit, + routed_subnets: Iterable[RoutedSubnetParam] | Omit = omit, + static_addressing: LANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LAN: """ Patch a specific Site LAN. @@ -745,7 +745,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LAN: """ Get a specific Site LAN. diff --git a/src/cloudflare/resources/magic_transit/sites/sites.py b/src/cloudflare/resources/magic_transit/sites/sites.py index 11f326eb2e4..cc3cb96bf58 100644 --- a/src/cloudflare/resources/magic_transit/sites/sites.py +++ b/src/cloudflare/resources/magic_transit/sites/sites.py @@ -30,7 +30,7 @@ WANsResourceWithStreamingResponse, AsyncWANsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -92,17 +92,17 @@ def create( *, account_id: str, name: str, - connector_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - ha_mode: bool | NotGiven = NOT_GIVEN, - location: SiteLocationParam | NotGiven = NOT_GIVEN, - secondary_connector_id: str | NotGiven = NOT_GIVEN, + connector_id: str | Omit = omit, + description: str | Omit = omit, + ha_mode: bool | Omit = omit, + location: SiteLocationParam | Omit = omit, + secondary_connector_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Site: """ Creates a new Site @@ -159,17 +159,17 @@ def update( site_id: str, *, account_id: str, - connector_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - location: SiteLocationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - secondary_connector_id: str | NotGiven = NOT_GIVEN, + connector_id: str | Omit = omit, + description: str | Omit = omit, + location: SiteLocationParam | Omit = omit, + name: str | Omit = omit, + secondary_connector_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Site: """ Update a specific Site. @@ -225,13 +225,13 @@ def list( self, *, account_id: str, - connectorid: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Site]: """Lists Sites associated with an account. @@ -277,7 +277,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Site: """ Remove a specific Site. @@ -316,17 +316,17 @@ def edit( site_id: str, *, account_id: str, - connector_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - location: SiteLocationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - secondary_connector_id: str | NotGiven = NOT_GIVEN, + connector_id: str | Omit = omit, + description: str | Omit = omit, + location: SiteLocationParam | Omit = omit, + name: str | Omit = omit, + secondary_connector_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Site: """ Patch a specific Site. @@ -383,13 +383,13 @@ def get( site_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Site: """ Get a specific Site. @@ -416,7 +416,7 @@ def get( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), @@ -471,17 +471,17 @@ async def create( *, account_id: str, name: str, - connector_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - ha_mode: bool | NotGiven = NOT_GIVEN, - location: SiteLocationParam | NotGiven = NOT_GIVEN, - secondary_connector_id: str | NotGiven = NOT_GIVEN, + connector_id: str | Omit = omit, + description: str | Omit = omit, + ha_mode: bool | Omit = omit, + location: SiteLocationParam | Omit = omit, + secondary_connector_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Site: """ Creates a new Site @@ -538,17 +538,17 @@ async def update( site_id: str, *, account_id: str, - connector_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - location: SiteLocationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - secondary_connector_id: str | NotGiven = NOT_GIVEN, + connector_id: str | Omit = omit, + description: str | Omit = omit, + location: SiteLocationParam | Omit = omit, + name: str | Omit = omit, + secondary_connector_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Site: """ Update a specific Site. @@ -604,13 +604,13 @@ def list( self, *, account_id: str, - connectorid: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Site, AsyncSinglePage[Site]]: """Lists Sites associated with an account. @@ -656,7 +656,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Site: """ Remove a specific Site. @@ -695,17 +695,17 @@ async def edit( site_id: str, *, account_id: str, - connector_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - location: SiteLocationParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - secondary_connector_id: str | NotGiven = NOT_GIVEN, + connector_id: str | Omit = omit, + description: str | Omit = omit, + location: SiteLocationParam | Omit = omit, + name: str | Omit = omit, + secondary_connector_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Site: """ Patch a specific Site. @@ -762,13 +762,13 @@ async def get( site_id: str, *, account_id: str, - x_magic_new_hc_target: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Site: """ Get a specific Site. @@ -795,7 +795,7 @@ async def get( { "x-magic-new-hc-target": ("true" if x_magic_new_hc_target else "false") if is_given(x_magic_new_hc_target) - else NOT_GIVEN + else not_given } ), **(extra_headers or {}), diff --git a/src/cloudflare/resources/magic_transit/sites/wans.py b/src/cloudflare/resources/magic_transit/sites/wans.py index da699f1e741..b6e574898d4 100644 --- a/src/cloudflare/resources/magic_transit/sites/wans.py +++ b/src/cloudflare/resources/magic_transit/sites/wans.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,16 +52,16 @@ def create( *, account_id: str, physport: int, - name: str | NotGiven = NOT_GIVEN, - priority: int | NotGiven = NOT_GIVEN, - static_addressing: WANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + priority: int | Omit = omit, + static_addressing: WANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[WAN]: """ Creates a new Site WAN. @@ -114,17 +114,17 @@ def update( *, account_id: str, site_id: str, - name: str | NotGiven = NOT_GIVEN, - physport: int | NotGiven = NOT_GIVEN, - priority: int | NotGiven = NOT_GIVEN, - static_addressing: WANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + physport: int | Omit = omit, + priority: int | Omit = omit, + static_addressing: WANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WAN: """ Update a specific Site WAN. @@ -187,7 +187,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[WAN]: """ Lists Site WANs associated with an account. @@ -229,7 +229,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WAN: """ Remove a specific Site WAN. @@ -273,17 +273,17 @@ def edit( *, account_id: str, site_id: str, - name: str | NotGiven = NOT_GIVEN, - physport: int | NotGiven = NOT_GIVEN, - priority: int | NotGiven = NOT_GIVEN, - static_addressing: WANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + physport: int | Omit = omit, + priority: int | Omit = omit, + static_addressing: WANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WAN: """ Patch a specific Site WAN. @@ -347,7 +347,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WAN: """ Get a specific Site WAN. @@ -412,16 +412,16 @@ def create( *, account_id: str, physport: int, - name: str | NotGiven = NOT_GIVEN, - priority: int | NotGiven = NOT_GIVEN, - static_addressing: WANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + priority: int | Omit = omit, + static_addressing: WANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WAN, AsyncSinglePage[WAN]]: """ Creates a new Site WAN. @@ -474,17 +474,17 @@ async def update( *, account_id: str, site_id: str, - name: str | NotGiven = NOT_GIVEN, - physport: int | NotGiven = NOT_GIVEN, - priority: int | NotGiven = NOT_GIVEN, - static_addressing: WANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + physport: int | Omit = omit, + priority: int | Omit = omit, + static_addressing: WANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WAN: """ Update a specific Site WAN. @@ -547,7 +547,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WAN, AsyncSinglePage[WAN]]: """ Lists Site WANs associated with an account. @@ -589,7 +589,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WAN: """ Remove a specific Site WAN. @@ -633,17 +633,17 @@ async def edit( *, account_id: str, site_id: str, - name: str | NotGiven = NOT_GIVEN, - physport: int | NotGiven = NOT_GIVEN, - priority: int | NotGiven = NOT_GIVEN, - static_addressing: WANStaticAddressingParam | NotGiven = NOT_GIVEN, - vlan_tag: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + physport: int | Omit = omit, + priority: int | Omit = omit, + static_addressing: WANStaticAddressingParam | Omit = omit, + vlan_tag: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WAN: """ Patch a specific Site WAN. @@ -707,7 +707,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WAN: """ Get a specific Site WAN. diff --git a/src/cloudflare/resources/managed_transforms.py b/src/cloudflare/resources/managed_transforms.py index befa6f70244..1b70c745c06 100644 --- a/src/cloudflare/resources/managed_transforms.py +++ b/src/cloudflare/resources/managed_transforms.py @@ -6,7 +6,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +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 @@ -54,7 +54,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ManagedTransformListResponse: """ Fetches a list of all Managed Transforms. @@ -93,7 +93,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Disables all Managed Transforms. @@ -131,7 +131,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ManagedTransformEditResponse: """ Updates the status of one or more Managed Transforms. @@ -202,7 +202,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ManagedTransformListResponse: """ Fetches a list of all Managed Transforms. @@ -241,7 +241,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Disables all Managed Transforms. @@ -279,7 +279,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ManagedTransformEditResponse: """ Updates the status of one or more Managed Transforms. diff --git a/src/cloudflare/resources/memberships.py b/src/cloudflare/resources/memberships.py index a204fc13bc1..1bc6e6ba7b3 100644 --- a/src/cloudflare/resources/memberships.py +++ b/src/cloudflare/resources/memberships.py @@ -7,7 +7,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -59,7 +59,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MembershipUpdateResponse]: """ Accept or reject this account invitation. @@ -95,19 +95,19 @@ def update( def list( self, *, - account: membership_list_params.Account | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["id", "account.name", "status"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["accepted", "pending", "rejected"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Membership]: """ List memberships of accounts the user can access. @@ -166,7 +166,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MembershipDeleteResponse]: """ Remove the associated member from an account. @@ -205,7 +205,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MembershipGetResponse]: """ Get a specific membership. @@ -266,7 +266,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MembershipUpdateResponse]: """ Accept or reject this account invitation. @@ -302,19 +302,19 @@ async def update( def list( self, *, - account: membership_list_params.Account | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["id", "account.name", "status"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["accepted", "pending", "rejected"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Membership, AsyncV4PagePaginationArray[Membership]]: """ List memberships of accounts the user can access. @@ -373,7 +373,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MembershipDeleteResponse]: """ Remove the associated member from an account. @@ -412,7 +412,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MembershipGetResponse]: """ Get a specific membership. diff --git a/src/cloudflare/resources/mtls_certificates/associations.py b/src/cloudflare/resources/mtls_certificates/associations.py index c903b3dbb52..a76063559c4 100644 --- a/src/cloudflare/resources/mtls_certificates/associations.py +++ b/src/cloudflare/resources/mtls_certificates/associations.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -50,7 +50,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CertificateAsssociation]: """ Lists all active associations between the certificate and Cloudflare services. @@ -114,7 +114,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CertificateAsssociation, AsyncSinglePage[CertificateAsssociation]]: """ Lists all active associations between the certificate and Cloudflare services. diff --git a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py index 76ddaa6a950..663dbe56585 100644 --- a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py +++ b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -64,14 +64,14 @@ def create( account_id: str, ca: bool, certificates: str, - name: str | NotGiven = NOT_GIVEN, - private_key: str | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + private_key: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MTLSCertificateCreateResponse]: """ Upload a certificate that you want to use with mTLS-enabled Cloudflare services. @@ -128,7 +128,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[MTLSCertificate]: """ Lists all mTLS certificates. @@ -165,7 +165,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MTLSCertificate]: """ Deletes the mTLS certificate unless the certificate is in use by one or more @@ -212,7 +212,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MTLSCertificate]: """ Fetches a single mTLS certificate. @@ -279,14 +279,14 @@ async def create( account_id: str, ca: bool, certificates: str, - name: str | NotGiven = NOT_GIVEN, - private_key: str | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + private_key: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MTLSCertificateCreateResponse]: """ Upload a certificate that you want to use with mTLS-enabled Cloudflare services. @@ -343,7 +343,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[MTLSCertificate, AsyncSinglePage[MTLSCertificate]]: """ Lists all mTLS certificates. @@ -380,7 +380,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MTLSCertificate]: """ Deletes the mTLS certificate unless the certificate is in use by one or more @@ -427,7 +427,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MTLSCertificate]: """ Fetches a single mTLS certificate. diff --git a/src/cloudflare/resources/network_interconnects/cnis.py b/src/cloudflare/resources/network_interconnects/cnis.py index 3b3cb1c11bd..bdbbcbbd217 100644 --- a/src/cloudflare/resources/network_interconnects/cnis.py +++ b/src/cloudflare/resources/network_interconnects/cnis.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -53,13 +53,13 @@ def create( account: str, interconnect: str, magic: cni_create_params.Magic, - bgp: cni_create_params.BGP | NotGiven = NOT_GIVEN, + bgp: cni_create_params.BGP | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CNICreateResponse: """ Create a new CNI object @@ -107,13 +107,13 @@ def update( interconnect: str, magic: cni_update_params.Magic, p2p_ip: str, - bgp: cni_update_params.BGP | NotGiven = NOT_GIVEN, + bgp: cni_update_params.BGP | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CNIUpdateResponse: """ Modify stored information about a CNI object @@ -167,16 +167,16 @@ def list( self, *, account_id: str, - cursor: Optional[int] | NotGiven = NOT_GIVEN, - limit: Optional[int] | NotGiven = NOT_GIVEN, - slot: Optional[str] | NotGiven = NOT_GIVEN, - tunnel_id: Optional[str] | NotGiven = NOT_GIVEN, + cursor: Optional[int] | Omit = omit, + limit: Optional[int] | Omit = omit, + slot: Optional[str] | Omit = omit, + tunnel_id: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CNIListResponse: """ List existing CNI objects @@ -228,7 +228,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Delete a specified CNI object @@ -267,7 +267,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CNIGetResponse: """ Get information about a CNI object @@ -323,13 +323,13 @@ async def create( account: str, interconnect: str, magic: cni_create_params.Magic, - bgp: cni_create_params.BGP | NotGiven = NOT_GIVEN, + bgp: cni_create_params.BGP | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CNICreateResponse: """ Create a new CNI object @@ -377,13 +377,13 @@ async def update( interconnect: str, magic: cni_update_params.Magic, p2p_ip: str, - bgp: cni_update_params.BGP | NotGiven = NOT_GIVEN, + bgp: cni_update_params.BGP | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CNIUpdateResponse: """ Modify stored information about a CNI object @@ -437,16 +437,16 @@ async def list( self, *, account_id: str, - cursor: Optional[int] | NotGiven = NOT_GIVEN, - limit: Optional[int] | NotGiven = NOT_GIVEN, - slot: Optional[str] | NotGiven = NOT_GIVEN, - tunnel_id: Optional[str] | NotGiven = NOT_GIVEN, + cursor: Optional[int] | Omit = omit, + limit: Optional[int] | Omit = omit, + slot: Optional[str] | Omit = omit, + tunnel_id: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CNIListResponse: """ List existing CNI objects @@ -498,7 +498,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Delete a specified CNI object @@ -537,7 +537,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CNIGetResponse: """ Get information about a CNI object diff --git a/src/cloudflare/resources/network_interconnects/interconnects.py b/src/cloudflare/resources/network_interconnects/interconnects.py index b4788ad190a..f6f091ecedf 100644 --- a/src/cloudflare/resources/network_interconnects/interconnects.py +++ b/src/cloudflare/resources/network_interconnects/interconnects.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -55,13 +55,13 @@ def create( account: str, slot_id: str, type: str, - speed: Optional[str] | NotGiven = NOT_GIVEN, + speed: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectCreateResponse: """ Create a new interconnect @@ -93,7 +93,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectCreateResponse: """ Create a new interconnect @@ -123,18 +123,18 @@ def create( *, account_id: str, account: str, - slot_id: str | NotGiven = NOT_GIVEN, + slot_id: str | Omit = omit, type: str, - speed: Optional[str] | NotGiven = NOT_GIVEN, + speed: Optional[str] | Omit = omit, bandwidth: Literal["50M", "100M", "200M", "300M", "400M", "500M", "1G", "2G", "5G", "10G", "20G", "50G"] - | NotGiven = NOT_GIVEN, - pairing_key: str | NotGiven = NOT_GIVEN, + | Omit = omit, + pairing_key: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -166,16 +166,16 @@ def list( self, *, account_id: str, - cursor: Optional[int] | NotGiven = NOT_GIVEN, - limit: Optional[int] | NotGiven = NOT_GIVEN, - site: Optional[str] | NotGiven = NOT_GIVEN, - type: Optional[str] | NotGiven = NOT_GIVEN, + cursor: Optional[int] | Omit = omit, + limit: Optional[int] | Omit = omit, + site: Optional[str] | Omit = omit, + type: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectListResponse: """ List existing interconnects @@ -227,7 +227,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Delete an interconnect object @@ -266,7 +266,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectGetResponse: """ Get information about an interconnect object @@ -309,7 +309,7 @@ def loa( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Generate the Letter of Authorization (LOA) for a given interconnect @@ -348,7 +348,7 @@ def status( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectStatusResponse: """ Get the current status of an interconnect object @@ -410,13 +410,13 @@ async def create( account: str, slot_id: str, type: str, - speed: Optional[str] | NotGiven = NOT_GIVEN, + speed: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectCreateResponse: """ Create a new interconnect @@ -448,7 +448,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectCreateResponse: """ Create a new interconnect @@ -478,18 +478,18 @@ async def create( *, account_id: str, account: str, - slot_id: str | NotGiven = NOT_GIVEN, + slot_id: str | Omit = omit, type: str, - speed: Optional[str] | NotGiven = NOT_GIVEN, + speed: Optional[str] | Omit = omit, bandwidth: Literal["50M", "100M", "200M", "300M", "400M", "500M", "1G", "2G", "5G", "10G", "20G", "50G"] - | NotGiven = NOT_GIVEN, - pairing_key: str | NotGiven = NOT_GIVEN, + | Omit = omit, + pairing_key: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -521,16 +521,16 @@ async def list( self, *, account_id: str, - cursor: Optional[int] | NotGiven = NOT_GIVEN, - limit: Optional[int] | NotGiven = NOT_GIVEN, - site: Optional[str] | NotGiven = NOT_GIVEN, - type: Optional[str] | NotGiven = NOT_GIVEN, + cursor: Optional[int] | Omit = omit, + limit: Optional[int] | Omit = omit, + site: Optional[str] | Omit = omit, + type: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectListResponse: """ List existing interconnects @@ -582,7 +582,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Delete an interconnect object @@ -621,7 +621,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectGetResponse: """ Get information about an interconnect object @@ -664,7 +664,7 @@ async def loa( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Generate the Letter of Authorization (LOA) for a given interconnect @@ -703,7 +703,7 @@ async def status( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectStatusResponse: """ Get the current status of an interconnect object diff --git a/src/cloudflare/resources/network_interconnects/settings.py b/src/cloudflare/resources/network_interconnects/settings.py index 57329ba32d8..5999015aecb 100644 --- a/src/cloudflare/resources/network_interconnects/settings.py +++ b/src/cloudflare/resources/network_interconnects/settings.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,13 +48,13 @@ def update( self, *, account_id: str, - default_asn: Optional[int] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingUpdateResponse: """ Update the current settings for the active account @@ -88,7 +88,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingGetResponse: """ Get the current settings for the active account @@ -137,13 +137,13 @@ async def update( self, *, account_id: str, - default_asn: Optional[int] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingUpdateResponse: """ Update the current settings for the active account @@ -177,7 +177,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingGetResponse: """ Get the current settings for the active account diff --git a/src/cloudflare/resources/network_interconnects/slots.py b/src/cloudflare/resources/network_interconnects/slots.py index 27c517b8437..cdecb4d13d2 100644 --- a/src/cloudflare/resources/network_interconnects/slots.py +++ b/src/cloudflare/resources/network_interconnects/slots.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,18 +48,18 @@ def list( self, *, account_id: str, - address_contains: Optional[str] | NotGiven = NOT_GIVEN, - cursor: Optional[int] | NotGiven = NOT_GIVEN, - limit: Optional[int] | NotGiven = NOT_GIVEN, - occupied: Optional[bool] | NotGiven = NOT_GIVEN, - site: Optional[str] | NotGiven = NOT_GIVEN, - speed: Optional[str] | NotGiven = NOT_GIVEN, + address_contains: Optional[str] | Omit = omit, + cursor: Optional[int] | Omit = omit, + limit: Optional[int] | Omit = omit, + occupied: Optional[bool] | Omit = omit, + site: Optional[str] | Omit = omit, + speed: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SlotListResponse: """ Retrieve a list of all slots matching the specified parameters @@ -117,7 +117,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SlotGetResponse: """ Get information about the specified slot @@ -170,18 +170,18 @@ async def list( self, *, account_id: str, - address_contains: Optional[str] | NotGiven = NOT_GIVEN, - cursor: Optional[int] | NotGiven = NOT_GIVEN, - limit: Optional[int] | NotGiven = NOT_GIVEN, - occupied: Optional[bool] | NotGiven = NOT_GIVEN, - site: Optional[str] | NotGiven = NOT_GIVEN, - speed: Optional[str] | NotGiven = NOT_GIVEN, + address_contains: Optional[str] | Omit = omit, + cursor: Optional[int] | Omit = omit, + limit: Optional[int] | Omit = omit, + occupied: Optional[bool] | Omit = omit, + site: Optional[str] | Omit = omit, + speed: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SlotListResponse: """ Retrieve a list of all slots matching the specified parameters @@ -239,7 +239,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SlotGetResponse: """ Get information about the specified slot diff --git a/src/cloudflare/resources/organizations/__init__.py b/src/cloudflare/resources/organizations/__init__.py new file mode 100644 index 00000000000..c87211e2b2c --- /dev/null +++ b/src/cloudflare/resources/organizations/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .organizations import ( + OrganizationsResource, + AsyncOrganizationsResource, + OrganizationsResourceWithRawResponse, + AsyncOrganizationsResourceWithRawResponse, + OrganizationsResourceWithStreamingResponse, + AsyncOrganizationsResourceWithStreamingResponse, +) +from .organization_profile import ( + OrganizationProfileResource, + AsyncOrganizationProfileResource, + OrganizationProfileResourceWithRawResponse, + AsyncOrganizationProfileResourceWithRawResponse, + OrganizationProfileResourceWithStreamingResponse, + AsyncOrganizationProfileResourceWithStreamingResponse, +) + +__all__ = [ + "OrganizationProfileResource", + "AsyncOrganizationProfileResource", + "OrganizationProfileResourceWithRawResponse", + "AsyncOrganizationProfileResourceWithRawResponse", + "OrganizationProfileResourceWithStreamingResponse", + "AsyncOrganizationProfileResourceWithStreamingResponse", + "OrganizationsResource", + "AsyncOrganizationsResource", + "OrganizationsResourceWithRawResponse", + "AsyncOrganizationsResourceWithRawResponse", + "OrganizationsResourceWithStreamingResponse", + "AsyncOrganizationsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/organizations/organization_profile.py b/src/cloudflare/resources/organizations/organization_profile.py new file mode 100644 index 00000000000..0ef6dc6365e --- /dev/null +++ b/src/cloudflare/resources/organizations/organization_profile.py @@ -0,0 +1,286 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, 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.organizations import organization_profile_update_params +from ...types.organizations.organization_profile_get_params import Result + +__all__ = ["OrganizationProfileResource", "AsyncOrganizationProfileResource"] + + +class OrganizationProfileResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> OrganizationProfileResourceWithRawResponse: + """ + 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 OrganizationProfileResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> OrganizationProfileResourceWithStreamingResponse: + """ + 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 OrganizationProfileResourceWithStreamingResponse(self) + + def update( + self, + organization_id: str, + *, + business_address: str, + business_email: str, + business_name: str, + business_phone: str, + external_metadata: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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: + """ + Modify organization profile + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._put( + f"/organizations/{organization_id}/profile", + body=maybe_transform( + { + "business_address": business_address, + "business_email": business_email, + "business_name": business_name, + "business_phone": business_phone, + "external_metadata": external_metadata, + }, + organization_profile_update_params.OrganizationProfileUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + def get( + self, + organization_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Result: + """ + Get an organizations profile if it exists. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + return self._get( + f"/organizations/{organization_id}/profile", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Result]._unwrapper, + ), + cast_to=cast(Type[Result], ResultWrapper[Result]), + ) + + +class AsyncOrganizationProfileResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncOrganizationProfileResourceWithRawResponse: + """ + 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 AsyncOrganizationProfileResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncOrganizationProfileResourceWithStreamingResponse: + """ + 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 AsyncOrganizationProfileResourceWithStreamingResponse(self) + + async def update( + self, + organization_id: str, + *, + business_address: str, + business_email: str, + business_name: str, + business_phone: str, + external_metadata: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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: + """ + Modify organization profile + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._put( + f"/organizations/{organization_id}/profile", + body=await async_maybe_transform( + { + "business_address": business_address, + "business_email": business_email, + "business_name": business_name, + "business_phone": business_phone, + "external_metadata": external_metadata, + }, + organization_profile_update_params.OrganizationProfileUpdateParams, + ), + 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, + organization_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Result: + """ + Get an organizations profile if it exists. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + return await self._get( + f"/organizations/{organization_id}/profile", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Result]._unwrapper, + ), + cast_to=cast(Type[Result], ResultWrapper[Result]), + ) + + +class OrganizationProfileResourceWithRawResponse: + def __init__(self, organization_profile: OrganizationProfileResource) -> None: + self._organization_profile = organization_profile + + self.update = to_raw_response_wrapper( + organization_profile.update, + ) + self.get = to_raw_response_wrapper( + organization_profile.get, + ) + + +class AsyncOrganizationProfileResourceWithRawResponse: + def __init__(self, organization_profile: AsyncOrganizationProfileResource) -> None: + self._organization_profile = organization_profile + + self.update = async_to_raw_response_wrapper( + organization_profile.update, + ) + self.get = async_to_raw_response_wrapper( + organization_profile.get, + ) + + +class OrganizationProfileResourceWithStreamingResponse: + def __init__(self, organization_profile: OrganizationProfileResource) -> None: + self._organization_profile = organization_profile + + self.update = to_streamed_response_wrapper( + organization_profile.update, + ) + self.get = to_streamed_response_wrapper( + organization_profile.get, + ) + + +class AsyncOrganizationProfileResourceWithStreamingResponse: + def __init__(self, organization_profile: AsyncOrganizationProfileResource) -> None: + self._organization_profile = organization_profile + + self.update = async_to_streamed_response_wrapper( + organization_profile.update, + ) + self.get = async_to_streamed_response_wrapper( + organization_profile.get, + ) diff --git a/src/cloudflare/resources/organizations/organizations.py b/src/cloudflare/resources/organizations/organizations.py new file mode 100644 index 00000000000..1835e711c41 --- /dev/null +++ b/src/cloudflare/resources/organizations/organizations.py @@ -0,0 +1,646 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, 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 +from ..._base_client import AsyncPaginator, make_request_options +from .organization_profile import ( + OrganizationProfileResource, + AsyncOrganizationProfileResource, + OrganizationProfileResourceWithRawResponse, + AsyncOrganizationProfileResourceWithRawResponse, + OrganizationProfileResourceWithStreamingResponse, + AsyncOrganizationProfileResourceWithStreamingResponse, +) +from ...types.organizations import organization_list_params, organization_create_params, organization_update_params +from ...types.organizations.organization import Organization +from ...types.organizations.organization_delete_response import OrganizationDeleteResponse + +__all__ = ["OrganizationsResource", "AsyncOrganizationsResource"] + + +class OrganizationsResource(SyncAPIResource): + @cached_property + def organization_profile(self) -> OrganizationProfileResource: + return OrganizationProfileResource(self._client) + + @cached_property + def with_raw_response(self) -> OrganizationsResourceWithRawResponse: + """ + 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 OrganizationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: + """ + 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 OrganizationsResourceWithStreamingResponse(self) + + def create( + self, + *, + name: str, + parent: organization_create_params.Parent | Omit = omit, + profile: organization_create_params.Profile | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Organization: + """ + Create a new organization for a user. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/organizations", + body=maybe_transform( + { + "name": name, + "parent": parent, + "profile": profile, + }, + organization_create_params.OrganizationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Organization]._unwrapper, + ), + cast_to=cast(Type[Organization], ResultWrapper[Organization]), + ) + + def update( + self, + organization_id: str, + *, + name: str, + parent: organization_update_params.Parent | Omit = omit, + profile: organization_update_params.Profile | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Organization: + """ + Modify organization + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + return self._put( + f"/organizations/{organization_id}", + body=maybe_transform( + { + "name": name, + "parent": parent, + "profile": profile, + }, + organization_update_params.OrganizationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Organization]._unwrapper, + ), + cast_to=cast(Type[Organization], ResultWrapper[Organization]), + ) + + def list( + self, + *, + id: SequenceNotStr[str] | Omit = omit, + containing: organization_list_params.Containing | Omit = omit, + name: organization_list_params.Name | Omit = omit, + page_size: int | Omit = omit, + page_token: str | Omit = omit, + parent: organization_list_params.Parent | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[Organization]: + """ + Retrieve a list of organizations a particular user has access to. + + Args: + id: Only return organizations with the specified IDs (ex. id=foo&id=bar). Send + multiple elements by repeating the query value. + + page_size: The amount of items to return. Defaults to 10. + + page_token: An opaque token returned from the last list response that when provided will + retrieve the next page. + + Parameters used to filter the retrieved list must remain in subsequent requests + with a page token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/organizations", + page=SyncSinglePage[Organization], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "containing": containing, + "name": name, + "page_size": page_size, + "page_token": page_token, + "parent": parent, + }, + organization_list_params.OrganizationListParams, + ), + ), + model=Organization, + ) + + def delete( + self, + organization_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> OrganizationDeleteResponse: + """Delete an organization. + + The organization MUST be empty before deleting. It must + not contain any sub-organizations, accounts, members or users. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + return self._delete( + f"/organizations/{organization_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OrganizationDeleteResponse]._unwrapper, + ), + cast_to=cast(Type[OrganizationDeleteResponse], ResultWrapper[OrganizationDeleteResponse]), + ) + + def get( + self, + organization_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Organization: + """ + Retrieve the details of a certain organization. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + return self._get( + f"/organizations/{organization_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Organization]._unwrapper, + ), + cast_to=cast(Type[Organization], ResultWrapper[Organization]), + ) + + +class AsyncOrganizationsResource(AsyncAPIResource): + @cached_property + def organization_profile(self) -> AsyncOrganizationProfileResource: + return AsyncOrganizationProfileResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse: + """ + 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 AsyncOrganizationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResponse: + """ + 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 AsyncOrganizationsResourceWithStreamingResponse(self) + + async def create( + self, + *, + name: str, + parent: organization_create_params.Parent | Omit = omit, + profile: organization_create_params.Profile | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Organization: + """ + Create a new organization for a user. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/organizations", + body=await async_maybe_transform( + { + "name": name, + "parent": parent, + "profile": profile, + }, + organization_create_params.OrganizationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Organization]._unwrapper, + ), + cast_to=cast(Type[Organization], ResultWrapper[Organization]), + ) + + async def update( + self, + organization_id: str, + *, + name: str, + parent: organization_update_params.Parent | Omit = omit, + profile: organization_update_params.Profile | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Organization: + """ + Modify organization + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + return await self._put( + f"/organizations/{organization_id}", + body=await async_maybe_transform( + { + "name": name, + "parent": parent, + "profile": profile, + }, + organization_update_params.OrganizationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Organization]._unwrapper, + ), + cast_to=cast(Type[Organization], ResultWrapper[Organization]), + ) + + def list( + self, + *, + id: SequenceNotStr[str] | Omit = omit, + containing: organization_list_params.Containing | Omit = omit, + name: organization_list_params.Name | Omit = omit, + page_size: int | Omit = omit, + page_token: str | Omit = omit, + parent: organization_list_params.Parent | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[Organization, AsyncSinglePage[Organization]]: + """ + Retrieve a list of organizations a particular user has access to. + + Args: + id: Only return organizations with the specified IDs (ex. id=foo&id=bar). Send + multiple elements by repeating the query value. + + page_size: The amount of items to return. Defaults to 10. + + page_token: An opaque token returned from the last list response that when provided will + retrieve the next page. + + Parameters used to filter the retrieved list must remain in subsequent requests + with a page token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/organizations", + page=AsyncSinglePage[Organization], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "containing": containing, + "name": name, + "page_size": page_size, + "page_token": page_token, + "parent": parent, + }, + organization_list_params.OrganizationListParams, + ), + ), + model=Organization, + ) + + async def delete( + self, + organization_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> OrganizationDeleteResponse: + """Delete an organization. + + The organization MUST be empty before deleting. It must + not contain any sub-organizations, accounts, members or users. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + return await self._delete( + f"/organizations/{organization_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[OrganizationDeleteResponse]._unwrapper, + ), + cast_to=cast(Type[OrganizationDeleteResponse], ResultWrapper[OrganizationDeleteResponse]), + ) + + async def get( + self, + organization_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Organization: + """ + Retrieve the details of a certain organization. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + return await self._get( + f"/organizations/{organization_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Organization]._unwrapper, + ), + cast_to=cast(Type[Organization], ResultWrapper[Organization]), + ) + + +class OrganizationsResourceWithRawResponse: + def __init__(self, organizations: OrganizationsResource) -> None: + self._organizations = organizations + + self.create = to_raw_response_wrapper( + organizations.create, + ) + self.update = to_raw_response_wrapper( + organizations.update, + ) + self.list = to_raw_response_wrapper( + organizations.list, + ) + self.delete = to_raw_response_wrapper( + organizations.delete, + ) + self.get = to_raw_response_wrapper( + organizations.get, + ) + + @cached_property + def organization_profile(self) -> OrganizationProfileResourceWithRawResponse: + return OrganizationProfileResourceWithRawResponse(self._organizations.organization_profile) + + +class AsyncOrganizationsResourceWithRawResponse: + def __init__(self, organizations: AsyncOrganizationsResource) -> None: + self._organizations = organizations + + self.create = async_to_raw_response_wrapper( + organizations.create, + ) + self.update = async_to_raw_response_wrapper( + organizations.update, + ) + self.list = async_to_raw_response_wrapper( + organizations.list, + ) + self.delete = async_to_raw_response_wrapper( + organizations.delete, + ) + self.get = async_to_raw_response_wrapper( + organizations.get, + ) + + @cached_property + def organization_profile(self) -> AsyncOrganizationProfileResourceWithRawResponse: + return AsyncOrganizationProfileResourceWithRawResponse(self._organizations.organization_profile) + + +class OrganizationsResourceWithStreamingResponse: + def __init__(self, organizations: OrganizationsResource) -> None: + self._organizations = organizations + + self.create = to_streamed_response_wrapper( + organizations.create, + ) + self.update = to_streamed_response_wrapper( + organizations.update, + ) + self.list = to_streamed_response_wrapper( + organizations.list, + ) + self.delete = to_streamed_response_wrapper( + organizations.delete, + ) + self.get = to_streamed_response_wrapper( + organizations.get, + ) + + @cached_property + def organization_profile(self) -> OrganizationProfileResourceWithStreamingResponse: + return OrganizationProfileResourceWithStreamingResponse(self._organizations.organization_profile) + + +class AsyncOrganizationsResourceWithStreamingResponse: + def __init__(self, organizations: AsyncOrganizationsResource) -> None: + self._organizations = organizations + + self.create = async_to_streamed_response_wrapper( + organizations.create, + ) + self.update = async_to_streamed_response_wrapper( + organizations.update, + ) + self.list = async_to_streamed_response_wrapper( + organizations.list, + ) + self.delete = async_to_streamed_response_wrapper( + organizations.delete, + ) + self.get = async_to_streamed_response_wrapper( + organizations.get, + ) + + @cached_property + def organization_profile(self) -> AsyncOrganizationProfileResourceWithStreamingResponse: + return AsyncOrganizationProfileResourceWithStreamingResponse(self._organizations.organization_profile) diff --git a/src/cloudflare/resources/origin_ca_certificates.py b/src/cloudflare/resources/origin_ca_certificates.py index 87c708a69ac..4667a895303 100644 --- a/src/cloudflare/resources/origin_ca_certificates.py +++ b/src/cloudflare/resources/origin_ca_certificates.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,16 +52,16 @@ def with_streaming_response(self) -> OriginCACertificatesResourceWithStreamingRe def create( self, *, - csr: str | NotGiven = NOT_GIVEN, - hostnames: List[str] | NotGiven = NOT_GIVEN, - request_type: CertificateRequestType | NotGiven = NOT_GIVEN, - requested_validity: RequestValidity | NotGiven = NOT_GIVEN, + csr: str | Omit = omit, + hostnames: SequenceNotStr[str] | Omit = omit, + request_type: CertificateRequestType | Omit = omit, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginCACertificate]: """Create an Origin CA certificate. @@ -112,16 +112,16 @@ def list( self, *, zone_id: str, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[OriginCACertificate]: """List all existing Origin CA certificates for a given zone. @@ -179,7 +179,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginCACertificateDeleteResponse]: """Revoke an existing Origin CA certificate by its serial number. @@ -223,7 +223,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginCACertificate]: """Get an existing Origin CA certificate by its serial number. @@ -280,16 +280,16 @@ def with_streaming_response(self) -> AsyncOriginCACertificatesResourceWithStream async def create( self, *, - csr: str | NotGiven = NOT_GIVEN, - hostnames: List[str] | NotGiven = NOT_GIVEN, - request_type: CertificateRequestType | NotGiven = NOT_GIVEN, - requested_validity: RequestValidity | NotGiven = NOT_GIVEN, + csr: str | Omit = omit, + hostnames: SequenceNotStr[str] | Omit = omit, + request_type: CertificateRequestType | Omit = omit, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginCACertificate]: """Create an Origin CA certificate. @@ -340,16 +340,16 @@ def list( self, *, zone_id: str, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OriginCACertificate, AsyncV4PagePaginationArray[OriginCACertificate]]: """List all existing Origin CA certificates for a given zone. @@ -407,7 +407,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginCACertificateDeleteResponse]: """Revoke an existing Origin CA certificate by its serial number. @@ -451,7 +451,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginCACertificate]: """Get an existing Origin CA certificate by its serial number. diff --git a/src/cloudflare/resources/origin_post_quantum_encryption.py b/src/cloudflare/resources/origin_post_quantum_encryption.py index 8a8103ddebb..d049002bc21 100644 --- a/src/cloudflare/resources/origin_post_quantum_encryption.py +++ b/src/cloudflare/resources/origin_post_quantum_encryption.py @@ -7,7 +7,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -60,7 +60,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginPostQuantumEncryptionUpdateResponse]: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when @@ -68,10 +68,10 @@ def update( 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 + means that PQ algorithms are not advertised. Args: - zone_id: Identifier + zone_id: Identifier. value: Value of the Origin Post Quantum Encryption Setting. @@ -112,7 +112,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginPostQuantumEncryptionGetResponse]: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when @@ -120,10 +120,10 @@ def get( 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 + means that PQ algorithms are not advertised. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -181,7 +181,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginPostQuantumEncryptionUpdateResponse]: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when @@ -189,10 +189,10 @@ async def update( 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 + means that PQ algorithms are not advertised. Args: - zone_id: Identifier + zone_id: Identifier. value: Value of the Origin Post Quantum Encryption Setting. @@ -233,7 +233,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginPostQuantumEncryptionGetResponse]: """ Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when @@ -241,10 +241,10 @@ async def get( 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 + means that PQ algorithms are not advertised. Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py index e2ea8eb5a10..27a4956893b 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -59,7 +59,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateCreateResponse]: """Upload a certificate to be used for client authentication on a hostname. @@ -111,7 +111,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CertificateListResponse]: """ List Certificates @@ -148,7 +148,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateDeleteResponse]: """ Delete Hostname Client Certificate @@ -192,7 +192,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateGetResponse]: """ Get the certificate by ID to be used for client authentication on a hostname. @@ -258,7 +258,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateCreateResponse]: """Upload a certificate to be used for client authentication on a hostname. @@ -310,7 +310,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CertificateListResponse, AsyncSinglePage[CertificateListResponse]]: """ List Certificates @@ -347,7 +347,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateDeleteResponse]: """ Delete Hostname Client Certificate @@ -391,7 +391,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateGetResponse]: """ Get the certificate by ID to be used for client authentication on a hostname. diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py index 127601b743e..3428a834387 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames/hostnames.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._utils import maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -68,7 +68,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[HostnameUpdateResponse]: """ Associate a hostname to a certificate and enable, disable or invalidate the @@ -111,7 +111,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AuthenticatedOriginPull]: """ Get the Hostname Status for Client Authentication @@ -181,7 +181,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[HostnameUpdateResponse, AsyncSinglePage[HostnameUpdateResponse]]: """ Associate a hostname to a certificate and enable, disable or invalidate the @@ -224,7 +224,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AuthenticatedOriginPull]: """ Get the Hostname Status for Client Authentication 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 1df36588f40..ec3b5c01cd1 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 @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform, async_maybe_transform from .settings import ( SettingsResource, @@ -83,7 +83,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginTLSClientAuthCreateResponse]: """ Upload your own certificate you want Cloudflare to use for edge-to-origin @@ -139,7 +139,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[OriginTLSClientAuthListResponse]: """ List Certificates @@ -176,7 +176,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginTLSClientAuthDeleteResponse]: """ Delete Certificate @@ -222,7 +222,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginTLSClientAuthGetResponse]: """ Get Certificate Details @@ -296,7 +296,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginTLSClientAuthCreateResponse]: """ Upload your own certificate you want Cloudflare to use for edge-to-origin @@ -352,7 +352,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OriginTLSClientAuthListResponse, AsyncSinglePage[OriginTLSClientAuthListResponse]]: """ List Certificates @@ -389,7 +389,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginTLSClientAuthDeleteResponse]: """ Delete Certificate @@ -435,7 +435,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginTLSClientAuthGetResponse]: """ Get Certificate Details diff --git a/src/cloudflare/resources/origin_tls_client_auth/settings.py b/src/cloudflare/resources/origin_tls_client_auth/settings.py index 118502fb2df..9ae74bc3bc1 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/settings.py +++ b/src/cloudflare/resources/origin_tls_client_auth/settings.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,7 +55,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingUpdateResponse]: """Enable or disable zone-level authenticated origin pulls. @@ -100,7 +100,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingGetResponse]: """Get whether zone-level authenticated origin pulls is enabled or not. @@ -163,7 +163,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingUpdateResponse]: """Enable or disable zone-level authenticated origin pulls. @@ -208,7 +208,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingGetResponse]: """Get whether zone-level authenticated origin pulls is enabled or not. diff --git a/src/cloudflare/resources/page_rules.py b/src/cloudflare/resources/page_rules.py index 69dadce43b3..d687a14e8c0 100644 --- a/src/cloudflare/resources/page_rules.py +++ b/src/cloudflare/resources/page_rules.py @@ -7,7 +7,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -59,14 +59,14 @@ def create( zone_id: str, actions: Iterable[page_rule_create_params.Action], targets: Iterable[TargetParam], - priority: int | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRule]: """ Creates a new Page Rule. @@ -125,14 +125,14 @@ def update( zone_id: str, actions: Iterable[page_rule_update_params.Action], targets: Iterable[TargetParam], - priority: int | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRule]: """Replaces the configuration of an existing Page Rule. @@ -194,16 +194,16 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - order: Literal["status", "priority"] | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRuleListResponse]: """ Fetches Page Rules in a zone. @@ -261,7 +261,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRuleDeleteResponse]: """ Deletes an existing Page Rule. @@ -300,16 +300,16 @@ def edit( pagerule_id: str, *, zone_id: str, - actions: Iterable[page_rule_edit_params.Action] | NotGiven = NOT_GIVEN, - priority: int | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, - targets: Iterable[TargetParam] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRule]: """ Updates one or more fields of an existing Page Rule. @@ -375,7 +375,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRule]: """ Fetches the details of a Page Rule. @@ -436,14 +436,14 @@ async def create( zone_id: str, actions: Iterable[page_rule_create_params.Action], targets: Iterable[TargetParam], - priority: int | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRule]: """ Creates a new Page Rule. @@ -502,14 +502,14 @@ async def update( zone_id: str, actions: Iterable[page_rule_update_params.Action], targets: Iterable[TargetParam], - priority: int | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRule]: """Replaces the configuration of an existing Page Rule. @@ -571,16 +571,16 @@ async def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - order: Literal["status", "priority"] | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRuleListResponse]: """ Fetches Page Rules in a zone. @@ -638,7 +638,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRuleDeleteResponse]: """ Deletes an existing Page Rule. @@ -677,16 +677,16 @@ async def edit( pagerule_id: str, *, zone_id: str, - actions: Iterable[page_rule_edit_params.Action] | NotGiven = NOT_GIVEN, - priority: int | NotGiven = NOT_GIVEN, - status: Literal["active", "disabled"] | NotGiven = NOT_GIVEN, - targets: Iterable[TargetParam] | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRule]: """ Updates one or more fields of an existing Page Rule. @@ -752,7 +752,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageRule]: """ Fetches the details of a Page Rule. diff --git a/src/cloudflare/resources/page_shield/connections.py b/src/cloudflare/resources/page_shield/connections.py index ade3e22e7ea..d04b4fdf6fe 100644 --- a/src/cloudflare/resources/page_shield/connections.py +++ b/src/cloudflare/resources/page_shield/connections.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,24 +50,24 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - exclude_cdn_cgi: bool | NotGiven = NOT_GIVEN, - exclude_urls: str | NotGiven = NOT_GIVEN, - export: Literal["csv"] | NotGiven = NOT_GIVEN, - hosts: str | NotGiven = NOT_GIVEN, - order_by: Literal["first_seen_at", "last_seen_at"] | NotGiven = NOT_GIVEN, - page: str | NotGiven = NOT_GIVEN, - page_url: str | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - prioritize_malicious: bool | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, - urls: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + exclude_cdn_cgi: bool | Omit = omit, + exclude_urls: str | Omit = omit, + export: Literal["csv"] | Omit = omit, + hosts: str | Omit = omit, + order_by: Literal["first_seen_at", "last_seen_at"] | Omit = omit, + page: str | Omit = omit, + page_url: str | Omit = omit, + per_page: float | Omit = omit, + prioritize_malicious: bool | Omit = omit, + status: str | Omit = omit, + urls: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Connection]: """ Lists all connections detected by Page Shield. @@ -83,7 +83,7 @@ def list( exclude_urls: Excludes connections whose URL contains one of the URL-encoded URLs separated by commas. - export: Export the list of connections as a file. + export: Export the list of connections as a file, limited to 50000 entries. hosts: Includes connections that match one or more URL-encoded hostnames separated by commas. @@ -168,7 +168,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Connection]: """ Fetches a connection detected by Page Shield by connection ID. @@ -227,24 +227,24 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - exclude_cdn_cgi: bool | NotGiven = NOT_GIVEN, - exclude_urls: str | NotGiven = NOT_GIVEN, - export: Literal["csv"] | NotGiven = NOT_GIVEN, - hosts: str | NotGiven = NOT_GIVEN, - order_by: Literal["first_seen_at", "last_seen_at"] | NotGiven = NOT_GIVEN, - page: str | NotGiven = NOT_GIVEN, - page_url: str | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - prioritize_malicious: bool | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, - urls: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + exclude_cdn_cgi: bool | Omit = omit, + exclude_urls: str | Omit = omit, + export: Literal["csv"] | Omit = omit, + hosts: str | Omit = omit, + order_by: Literal["first_seen_at", "last_seen_at"] | Omit = omit, + page: str | Omit = omit, + page_url: str | Omit = omit, + per_page: float | Omit = omit, + prioritize_malicious: bool | Omit = omit, + status: str | Omit = omit, + urls: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Connection, AsyncSinglePage[Connection]]: """ Lists all connections detected by Page Shield. @@ -260,7 +260,7 @@ def list( exclude_urls: Excludes connections whose URL contains one of the URL-encoded URLs separated by commas. - export: Export the list of connections as a file. + export: Export the list of connections as a file, limited to 50000 entries. hosts: Includes connections that match one or more URL-encoded hostnames separated by commas. @@ -345,7 +345,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Connection]: """ Fetches a connection detected by Page Shield by connection ID. diff --git a/src/cloudflare/resources/page_shield/cookies.py b/src/cloudflare/resources/page_shield/cookies.py index ff7033bca30..cc5192361bc 100644 --- a/src/cloudflare/resources/page_shield/cookies.py +++ b/src/cloudflare/resources/page_shield/cookies.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,26 +51,26 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - domain: str | NotGiven = NOT_GIVEN, - export: Literal["csv"] | NotGiven = NOT_GIVEN, - hosts: str | NotGiven = NOT_GIVEN, - http_only: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order_by: Literal["first_seen_at", "last_seen_at"] | NotGiven = NOT_GIVEN, - page: str | NotGiven = NOT_GIVEN, - page_url: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - same_site: Literal["lax", "strict", "none"] | NotGiven = NOT_GIVEN, - secure: bool | NotGiven = NOT_GIVEN, - type: Literal["first_party", "unknown"] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + domain: str | Omit = omit, + export: Literal["csv"] | Omit = omit, + hosts: str | Omit = omit, + http_only: bool | Omit = omit, + name: str | Omit = omit, + order_by: Literal["first_seen_at", "last_seen_at"] | Omit = omit, + page: str | Omit = omit, + page_url: str | Omit = omit, + path: str | Omit = omit, + per_page: float | Omit = omit, + same_site: Literal["lax", "strict", "none"] | Omit = omit, + secure: bool | Omit = omit, + type: Literal["first_party", "unknown"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CookieListResponse]: """ Lists all cookies collected by Page Shield. @@ -82,7 +82,7 @@ def list( domain: Filters the returned cookies that match the specified domain attribute - export: Export the list of cookies as a file. + export: Export the list of cookies as a file, limited to 50000 entries. hosts: Includes cookies that match one or more URL-encoded hostnames separated by commas. @@ -173,7 +173,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CookieGetResponse]: """ Fetches a cookie collected by Page Shield by cookie ID. @@ -232,26 +232,26 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - domain: str | NotGiven = NOT_GIVEN, - export: Literal["csv"] | NotGiven = NOT_GIVEN, - hosts: str | NotGiven = NOT_GIVEN, - http_only: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order_by: Literal["first_seen_at", "last_seen_at"] | NotGiven = NOT_GIVEN, - page: str | NotGiven = NOT_GIVEN, - page_url: str | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - same_site: Literal["lax", "strict", "none"] | NotGiven = NOT_GIVEN, - secure: bool | NotGiven = NOT_GIVEN, - type: Literal["first_party", "unknown"] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + domain: str | Omit = omit, + export: Literal["csv"] | Omit = omit, + hosts: str | Omit = omit, + http_only: bool | Omit = omit, + name: str | Omit = omit, + order_by: Literal["first_seen_at", "last_seen_at"] | Omit = omit, + page: str | Omit = omit, + page_url: str | Omit = omit, + path: str | Omit = omit, + per_page: float | Omit = omit, + same_site: Literal["lax", "strict", "none"] | Omit = omit, + secure: bool | Omit = omit, + type: Literal["first_party", "unknown"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CookieListResponse, AsyncSinglePage[CookieListResponse]]: """ Lists all cookies collected by Page Shield. @@ -263,7 +263,7 @@ def list( domain: Filters the returned cookies that match the specified domain attribute - export: Export the list of cookies as a file. + export: Export the list of cookies as a file, limited to 50000 entries. hosts: Includes cookies that match one or more URL-encoded hostnames separated by commas. @@ -354,7 +354,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CookieGetResponse]: """ Fetches a cookie collected by Page Shield by cookie ID. diff --git a/src/cloudflare/resources/page_shield/page_shield.py b/src/cloudflare/resources/page_shield/page_shield.py index 56c8d75166d..671b12446f8 100644 --- a/src/cloudflare/resources/page_shield/page_shield.py +++ b/src/cloudflare/resources/page_shield/page_shield.py @@ -22,7 +22,7 @@ ScriptsResourceWithStreamingResponse, AsyncScriptsResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .policies import ( PoliciesResource, @@ -97,15 +97,15 @@ def update( self, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, - use_cloudflare_reporting_endpoint: bool | NotGiven = NOT_GIVEN, - use_connection_url_path: bool | NotGiven = NOT_GIVEN, + enabled: bool | Omit = omit, + use_cloudflare_reporting_endpoint: bool | Omit = omit, + use_connection_url_path: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageShieldUpdateResponse]: """ Updates Page Shield settings. @@ -159,7 +159,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Setting]: """ Fetches the Page Shield settings. @@ -230,15 +230,15 @@ async def update( self, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, - use_cloudflare_reporting_endpoint: bool | NotGiven = NOT_GIVEN, - use_connection_url_path: bool | NotGiven = NOT_GIVEN, + enabled: bool | Omit = omit, + use_cloudflare_reporting_endpoint: bool | Omit = omit, + use_connection_url_path: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PageShieldUpdateResponse]: """ Updates Page Shield settings. @@ -292,7 +292,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Setting]: """ Fetches the Page Shield settings. diff --git a/src/cloudflare/resources/page_shield/policies.py b/src/cloudflare/resources/page_shield/policies.py index 9d7db9cf31c..debfeeb0a6b 100644 --- a/src/cloudflare/resources/page_shield/policies.py +++ b/src/cloudflare/resources/page_shield/policies.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -63,7 +63,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyCreateResponse]: """ Create a Page Shield policy. @@ -119,17 +119,17 @@ def update( policy_id: str, *, zone_id: str, - action: Literal["allow", "log"] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + action: Literal["allow", "log"] | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + expression: str | Omit = omit, + value: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyUpdateResponse]: """ Update a Page Shield policy by ID. @@ -193,7 +193,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PolicyListResponse]: """ Lists all Page Shield policies. @@ -230,7 +230,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Delete a Page Shield policy by ID. @@ -271,7 +271,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyGetResponse]: """ Fetches a Page Shield policy by ID. @@ -340,7 +340,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyCreateResponse]: """ Create a Page Shield policy. @@ -396,17 +396,17 @@ async def update( policy_id: str, *, zone_id: str, - action: Literal["allow", "log"] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + action: Literal["allow", "log"] | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + expression: str | Omit = omit, + value: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyUpdateResponse]: """ Update a Page Shield policy by ID. @@ -470,7 +470,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PolicyListResponse, AsyncSinglePage[PolicyListResponse]]: """ Lists all Page Shield policies. @@ -507,7 +507,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Delete a Page Shield policy by ID. @@ -548,7 +548,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyGetResponse]: """ Fetches a Page Shield policy by ID. diff --git a/src/cloudflare/resources/page_shield/scripts.py b/src/cloudflare/resources/page_shield/scripts.py index 02f1a625320..08198419498 100644 --- a/src/cloudflare/resources/page_shield/scripts.py +++ b/src/cloudflare/resources/page_shield/scripts.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,25 +51,25 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - exclude_cdn_cgi: bool | NotGiven = NOT_GIVEN, - exclude_duplicates: bool | NotGiven = NOT_GIVEN, - exclude_urls: str | NotGiven = NOT_GIVEN, - export: Literal["csv"] | NotGiven = NOT_GIVEN, - hosts: str | NotGiven = NOT_GIVEN, - order_by: Literal["first_seen_at", "last_seen_at"] | NotGiven = NOT_GIVEN, - page: str | NotGiven = NOT_GIVEN, - page_url: str | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - prioritize_malicious: bool | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, - urls: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + exclude_cdn_cgi: bool | Omit = omit, + exclude_duplicates: bool | Omit = omit, + exclude_urls: str | Omit = omit, + export: Literal["csv"] | Omit = omit, + hosts: str | Omit = omit, + order_by: Literal["first_seen_at", "last_seen_at"] | Omit = omit, + page: str | Omit = omit, + page_url: str | Omit = omit, + per_page: float | Omit = omit, + prioritize_malicious: bool | Omit = omit, + status: str | Omit = omit, + urls: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Script]: """ Lists all scripts detected by Page Shield. @@ -90,7 +90,7 @@ def list( exclude_urls: Excludes scripts whose URL contains one of the URL-encoded URLs separated by commas. - export: Export the list of scripts as a file. + export: Export the list of scripts as a file, limited to 50000 entries. hosts: Includes scripts that match one or more URL-encoded hostnames separated by commas. @@ -175,7 +175,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ScriptGetResponse]: """ Fetches a script detected by Page Shield by script ID. @@ -234,25 +234,25 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - exclude_cdn_cgi: bool | NotGiven = NOT_GIVEN, - exclude_duplicates: bool | NotGiven = NOT_GIVEN, - exclude_urls: str | NotGiven = NOT_GIVEN, - export: Literal["csv"] | NotGiven = NOT_GIVEN, - hosts: str | NotGiven = NOT_GIVEN, - order_by: Literal["first_seen_at", "last_seen_at"] | NotGiven = NOT_GIVEN, - page: str | NotGiven = NOT_GIVEN, - page_url: str | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - prioritize_malicious: bool | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, - urls: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + exclude_cdn_cgi: bool | Omit = omit, + exclude_duplicates: bool | Omit = omit, + exclude_urls: str | Omit = omit, + export: Literal["csv"] | Omit = omit, + hosts: str | Omit = omit, + order_by: Literal["first_seen_at", "last_seen_at"] | Omit = omit, + page: str | Omit = omit, + page_url: str | Omit = omit, + per_page: float | Omit = omit, + prioritize_malicious: bool | Omit = omit, + status: str | Omit = omit, + urls: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Script, AsyncSinglePage[Script]]: """ Lists all scripts detected by Page Shield. @@ -273,7 +273,7 @@ def list( exclude_urls: Excludes scripts whose URL contains one of the URL-encoded URLs separated by commas. - export: Export the list of scripts as a file. + export: Export the list of scripts as a file, limited to 50000 entries. hosts: Includes scripts that match one or more URL-encoded hostnames separated by commas. @@ -358,7 +358,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ScriptGetResponse]: """ Fetches a script detected by Page Shield by script ID. diff --git a/src/cloudflare/resources/pages/projects/deployments/deployments.py b/src/cloudflare/resources/pages/projects/deployments/deployments.py index 12e24591101..693b938941a 100644 --- a/src/cloudflare/resources/pages/projects/deployments/deployments.py +++ b/src/cloudflare/resources/pages/projects/deployments/deployments.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, Mapping, Optional, cast from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ....._utils import maybe_transform, async_maybe_transform +from ....._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given +from ....._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -68,13 +68,25 @@ def create( project_name: str, *, account_id: str, - branch: str | NotGiven = NOT_GIVEN, + _headers: FileTypes | Omit = omit, + _redirects: FileTypes | Omit = omit, + _routes_json: FileTypes | Omit = omit, + _worker_bundle: FileTypes | Omit = omit, + _worker_js: FileTypes | Omit = omit, + branch: str | Omit = omit, + commit_dirty: Literal["true", "false"] | Omit = omit, + commit_hash: str | Omit = omit, + commit_message: str | Omit = omit, + functions_filepath_routing_config_json: FileTypes | Omit = omit, + manifest: str | Omit = omit, + pages_build_output_dir: str | Omit = omit, + wrangler_config_hash: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Deployment: """Start a new deployment from production. @@ -86,9 +98,37 @@ def create( project_name: Name of the project. + _headers: Headers configuration file for the deployment. + + _redirects: Redirects configuration file for the deployment. + + _routes_json: Routes configuration file defining routing rules. + + _worker_bundle: Worker bundle file in multipart/form-data format. Mutually exclusive with + `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the same + request. Maximum size: 25 MiB. + + _worker_js: Worker JavaScript file. Mutually exclusive with `_worker.bundle`. Cannot specify + both `_worker.js` and `_worker.bundle` in the same request. + branch: The branch to build the new deployment from. The `HEAD` of the branch will be used. If omitted, the production branch will be used by default. + commit_dirty: Boolean string indicating if the working directory has uncommitted changes. + + commit_hash: Git commit SHA associated with this deployment. + + commit_message: Git commit message associated with this deployment. + + functions_filepath_routing_config_json: Functions routing configuration file. + + manifest: JSON string containing a manifest of files to deploy. Maps file paths to their + content hashes. Required for direct upload deployments. Maximum 20,000 entries. + + pages_build_output_dir: The build output directory path. + + wrangler_config_hash: Hash of the Wrangler configuration file used for this deployment. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -101,13 +141,42 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") + body = deepcopy_minimal( + { + "_headers": _headers, + "_redirects": _redirects, + "_routes_json": _routes_json, + "_worker_bundle": _worker_bundle, + "_worker_js": _worker_js, + "branch": branch, + "commit_dirty": commit_dirty, + "commit_hash": commit_hash, + "commit_message": commit_message, + "functions_filepath_routing_config_json": functions_filepath_routing_config_json, + "manifest": manifest, + "pages_build_output_dir": pages_build_output_dir, + "wrangler_config_hash": wrangler_config_hash, + } + ) + files = extract_files( + cast(Mapping[str, object], body), + paths=[ + ["_headers"], + ["_redirects"], + ["_routes.json"], + ["_worker.bundle"], + ["_worker.js"], + ["functions-filepath-routing-config.json"], + ], + ) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._post( f"/accounts/{account_id}/pages/projects/{project_name}/deployments", - body=maybe_transform({"branch": branch}, deployment_create_params.DeploymentCreateParams), + body=maybe_transform(body, deployment_create_params.DeploymentCreateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -123,13 +192,13 @@ def list( project_name: str, *, account_id: str, - env: Literal["production", "preview"] | NotGiven = NOT_GIVEN, + env: Literal["production", "preview"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Deployment]: """ Fetch a list of project deployments. @@ -177,7 +246,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a deployment. @@ -226,7 +295,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Deployment: """ Fetch information about a deployment. @@ -276,7 +345,7 @@ def retry( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Deployment: """ Retry a previous deployment. @@ -327,7 +396,7 @@ def rollback( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Deployment: """Rollback the production deployment to a previous deployment. @@ -398,13 +467,25 @@ async def create( project_name: str, *, account_id: str, - branch: str | NotGiven = NOT_GIVEN, + _headers: FileTypes | Omit = omit, + _redirects: FileTypes | Omit = omit, + _routes_json: FileTypes | Omit = omit, + _worker_bundle: FileTypes | Omit = omit, + _worker_js: FileTypes | Omit = omit, + branch: str | Omit = omit, + commit_dirty: Literal["true", "false"] | Omit = omit, + commit_hash: str | Omit = omit, + commit_message: str | Omit = omit, + functions_filepath_routing_config_json: FileTypes | Omit = omit, + manifest: str | Omit = omit, + pages_build_output_dir: str | Omit = omit, + wrangler_config_hash: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Deployment: """Start a new deployment from production. @@ -416,9 +497,37 @@ async def create( project_name: Name of the project. + _headers: Headers configuration file for the deployment. + + _redirects: Redirects configuration file for the deployment. + + _routes_json: Routes configuration file defining routing rules. + + _worker_bundle: Worker bundle file in multipart/form-data format. Mutually exclusive with + `_worker.js`. Cannot specify both `_worker.js` and `_worker.bundle` in the same + request. Maximum size: 25 MiB. + + _worker_js: Worker JavaScript file. Mutually exclusive with `_worker.bundle`. Cannot specify + both `_worker.js` and `_worker.bundle` in the same request. + branch: The branch to build the new deployment from. The `HEAD` of the branch will be used. If omitted, the production branch will be used by default. + commit_dirty: Boolean string indicating if the working directory has uncommitted changes. + + commit_hash: Git commit SHA associated with this deployment. + + commit_message: Git commit message associated with this deployment. + + functions_filepath_routing_config_json: Functions routing configuration file. + + manifest: JSON string containing a manifest of files to deploy. Maps file paths to their + content hashes. Required for direct upload deployments. Maximum 20,000 entries. + + pages_build_output_dir: The build output directory path. + + wrangler_config_hash: Hash of the Wrangler configuration file used for this deployment. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -431,13 +540,42 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") + body = deepcopy_minimal( + { + "_headers": _headers, + "_redirects": _redirects, + "_routes_json": _routes_json, + "_worker_bundle": _worker_bundle, + "_worker_js": _worker_js, + "branch": branch, + "commit_dirty": commit_dirty, + "commit_hash": commit_hash, + "commit_message": commit_message, + "functions_filepath_routing_config_json": functions_filepath_routing_config_json, + "manifest": manifest, + "pages_build_output_dir": pages_build_output_dir, + "wrangler_config_hash": wrangler_config_hash, + } + ) + files = extract_files( + cast(Mapping[str, object], body), + paths=[ + ["_headers"], + ["_redirects"], + ["_routes.json"], + ["_worker.bundle"], + ["_worker.js"], + ["functions-filepath-routing-config.json"], + ], + ) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._post( f"/accounts/{account_id}/pages/projects/{project_name}/deployments", - body=await async_maybe_transform({"branch": branch}, deployment_create_params.DeploymentCreateParams), + body=await async_maybe_transform(body, deployment_create_params.DeploymentCreateParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -453,13 +591,13 @@ def list( project_name: str, *, account_id: str, - env: Literal["production", "preview"] | NotGiven = NOT_GIVEN, + env: Literal["production", "preview"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Deployment, AsyncSinglePage[Deployment]]: """ Fetch a list of project deployments. @@ -507,7 +645,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a deployment. @@ -556,7 +694,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Deployment: """ Fetch information about a deployment. @@ -606,7 +744,7 @@ async def retry( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Deployment: """ Retry a previous deployment. @@ -657,7 +795,7 @@ async def rollback( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Deployment: """Rollback the production deployment to a previous deployment. diff --git a/src/cloudflare/resources/pages/projects/deployments/history/logs.py b/src/cloudflare/resources/pages/projects/deployments/history/logs.py index 832547b6ab5..2658ffd5a30 100644 --- a/src/cloudflare/resources/pages/projects/deployments/history/logs.py +++ b/src/cloudflare/resources/pages/projects/deployments/history/logs.py @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Query, Headers, NotGiven, not_given from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -53,7 +53,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LogGetResponse: """ Fetch deployment logs for a project. @@ -123,7 +123,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LogGetResponse: """ Fetch deployment logs for a project. diff --git a/src/cloudflare/resources/pages/projects/domains.py b/src/cloudflare/resources/pages/projects/domains.py index 21540fb6628..35b9e13d318 100644 --- a/src/cloudflare/resources/pages/projects/domains.py +++ b/src/cloudflare/resources/pages/projects/domains.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,13 +53,13 @@ def create( project_name: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DomainCreateResponse]: """ Add a new domain for the Pages project. @@ -104,7 +104,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DomainListResponse]: """ Fetch a list of all domains associated with a Pages project. @@ -146,7 +146,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a Pages project's domain. @@ -196,7 +196,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DomainEditResponse]: """ Retry the validation status of a single domain. @@ -246,7 +246,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DomainGetResponse]: """ Fetch a single domain. @@ -310,13 +310,13 @@ async def create( project_name: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DomainCreateResponse]: """ Add a new domain for the Pages project. @@ -361,7 +361,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DomainListResponse, AsyncSinglePage[DomainListResponse]]: """ Fetch a list of all domains associated with a Pages project. @@ -403,7 +403,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a Pages project's domain. @@ -453,7 +453,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DomainEditResponse]: """ Retry the validation status of a single domain. @@ -503,7 +503,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DomainGetResponse]: """ Fetch a single domain. diff --git a/src/cloudflare/resources/pages/projects/projects.py b/src/cloudflare/resources/pages/projects/projects.py index f12aed24631..d3cd2f3219b 100644 --- a/src/cloudflare/resources/pages/projects/projects.py +++ b/src/cloudflare/resources/pages/projects/projects.py @@ -14,7 +14,7 @@ DomainsResourceWithStreamingResponse, AsyncDomainsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -25,8 +25,8 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage -from ....types.pages import project_edit_params, project_create_params +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ....types.pages import project_edit_params, project_list_params, project_create_params from ...._base_client import AsyncPaginator, make_request_options from ....types.pages.project import Project from .deployments.deployments import ( @@ -74,17 +74,17 @@ def create( self, *, account_id: str, - build_config: project_create_params.BuildConfig | NotGiven = NOT_GIVEN, - deployment_configs: project_create_params.DeploymentConfigs | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - production_branch: str | NotGiven = NOT_GIVEN, - source: project_create_params.Source | NotGiven = NOT_GIVEN, + name: str, + production_branch: str, + build_config: Optional[project_create_params.BuildConfig] | Omit = omit, + deployment_configs: Optional[project_create_params.DeploymentConfigs] | Omit = omit, + source: project_create_params.Source | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Project: """ Create a new project. @@ -92,14 +92,14 @@ def create( Args: account_id: Identifier - build_config: Configs for the project build process. - - deployment_configs: Configs for deployments in a project. - name: Name of the project. production_branch: Production branch of the project. Used to identify production deployments. + build_config: Configs for the project build process. + + deployment_configs: Configs for deployments in a project. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -114,10 +114,10 @@ def create( f"/accounts/{account_id}/pages/projects", body=maybe_transform( { - "build_config": build_config, - "deployment_configs": deployment_configs, "name": name, "production_branch": production_branch, + "build_config": build_config, + "deployment_configs": deployment_configs, "source": source, }, project_create_params.ProjectCreateParams, @@ -136,19 +136,25 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[Deployment]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[Deployment]: """ Fetch a list of all user projects. Args: account_id: Identifier + page: Which page of projects to fetch. + + per_page: How many project to return per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -161,9 +167,19 @@ def list( 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}/pages/projects", - page=SyncSinglePage[Deployment], + page=SyncV4PagePaginationArray[Deployment], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + project_list_params.ProjectListParams, + ), ), model=Deployment, ) @@ -178,7 +194,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a project by name. @@ -217,17 +233,17 @@ def edit( project_name: str, *, account_id: str, - build_config: project_edit_params.BuildConfig | NotGiven = NOT_GIVEN, - deployment_configs: project_edit_params.DeploymentConfigs | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - production_branch: str | NotGiven = NOT_GIVEN, - source: project_edit_params.Source | NotGiven = NOT_GIVEN, + name: str, + production_branch: str, + build_config: Optional[project_edit_params.BuildConfig] | Omit = omit, + deployment_configs: Optional[project_edit_params.DeploymentConfigs] | Omit = omit, + source: project_edit_params.Source | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Project: """Set new attributes for an existing project. @@ -239,14 +255,14 @@ def edit( project_name: Name of the project. - build_config: Configs for the project build process. - - deployment_configs: Configs for deployments in a project. - name: Name of the project. production_branch: Production branch of the project. Used to identify production deployments. + build_config: Configs for the project build process. + + deployment_configs: Configs for deployments in a project. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -263,10 +279,10 @@ def edit( f"/accounts/{account_id}/pages/projects/{project_name}", body=maybe_transform( { - "build_config": build_config, - "deployment_configs": deployment_configs, "name": name, "production_branch": production_branch, + "build_config": build_config, + "deployment_configs": deployment_configs, "source": source, }, project_edit_params.ProjectEditParams, @@ -291,7 +307,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Project: """ Fetch a project by name. @@ -335,7 +351,7 @@ def purge_build_cache( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Purge all cached build artifacts for a Pages project @@ -402,17 +418,17 @@ async def create( self, *, account_id: str, - build_config: project_create_params.BuildConfig | NotGiven = NOT_GIVEN, - deployment_configs: project_create_params.DeploymentConfigs | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - production_branch: str | NotGiven = NOT_GIVEN, - source: project_create_params.Source | NotGiven = NOT_GIVEN, + name: str, + production_branch: str, + build_config: Optional[project_create_params.BuildConfig] | Omit = omit, + deployment_configs: Optional[project_create_params.DeploymentConfigs] | Omit = omit, + source: project_create_params.Source | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Project: """ Create a new project. @@ -420,14 +436,14 @@ async def create( Args: account_id: Identifier - build_config: Configs for the project build process. - - deployment_configs: Configs for deployments in a project. - name: Name of the project. production_branch: Production branch of the project. Used to identify production deployments. + build_config: Configs for the project build process. + + deployment_configs: Configs for deployments in a project. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -442,10 +458,10 @@ async def create( f"/accounts/{account_id}/pages/projects", body=await async_maybe_transform( { - "build_config": build_config, - "deployment_configs": deployment_configs, "name": name, "production_branch": production_branch, + "build_config": build_config, + "deployment_configs": deployment_configs, "source": source, }, project_create_params.ProjectCreateParams, @@ -464,19 +480,25 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[Deployment, AsyncSinglePage[Deployment]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Deployment, AsyncV4PagePaginationArray[Deployment]]: """ Fetch a list of all user projects. Args: account_id: Identifier + page: Which page of projects to fetch. + + per_page: How many project to return per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -489,9 +511,19 @@ def list( 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}/pages/projects", - page=AsyncSinglePage[Deployment], + page=AsyncV4PagePaginationArray[Deployment], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + project_list_params.ProjectListParams, + ), ), model=Deployment, ) @@ -506,7 +538,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a project by name. @@ -545,17 +577,17 @@ async def edit( project_name: str, *, account_id: str, - build_config: project_edit_params.BuildConfig | NotGiven = NOT_GIVEN, - deployment_configs: project_edit_params.DeploymentConfigs | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - production_branch: str | NotGiven = NOT_GIVEN, - source: project_edit_params.Source | NotGiven = NOT_GIVEN, + name: str, + production_branch: str, + build_config: Optional[project_edit_params.BuildConfig] | Omit = omit, + deployment_configs: Optional[project_edit_params.DeploymentConfigs] | Omit = omit, + source: project_edit_params.Source | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Project: """Set new attributes for an existing project. @@ -567,14 +599,14 @@ async def edit( project_name: Name of the project. - build_config: Configs for the project build process. - - deployment_configs: Configs for deployments in a project. - name: Name of the project. production_branch: Production branch of the project. Used to identify production deployments. + build_config: Configs for the project build process. + + deployment_configs: Configs for deployments in a project. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -591,10 +623,10 @@ async def edit( f"/accounts/{account_id}/pages/projects/{project_name}", body=await async_maybe_transform( { - "build_config": build_config, - "deployment_configs": deployment_configs, "name": name, "production_branch": production_branch, + "build_config": build_config, + "deployment_configs": deployment_configs, "source": source, }, project_edit_params.ProjectEditParams, @@ -619,7 +651,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Project: """ Fetch a project by name. @@ -663,7 +695,7 @@ async def purge_build_cache( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Purge all cached build artifacts for a Pages project diff --git a/src/cloudflare/resources/pipelines.py b/src/cloudflare/resources/pipelines.py index 73287fe29d3..27d5e080106 100644 --- a/src/cloudflare/resources/pipelines.py +++ b/src/cloudflare/resources/pipelines.py @@ -2,11 +2,12 @@ from __future__ import annotations +import typing_extensions from typing import Type, Iterable, cast import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -47,6 +48,7 @@ def with_streaming_response(self) -> PipelinesResourceWithStreamingResponse: """ return PipelinesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def create( self, *, @@ -59,10 +61,12 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PipelineCreateResponse: - """ - Create a new pipeline. + """[DEPRECATED] Create a new pipeline. + + Use the new /pipelines/v1/pipelines endpoint + instead. Args: account_id: Specifies the public ID of the account. @@ -99,6 +103,7 @@ def create( cast_to=cast(Type[PipelineCreateResponse], ResultWrapper[PipelineCreateResponse]), ) + @typing_extensions.deprecated("deprecated") def update( self, pipeline_name: str, @@ -112,10 +117,12 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PipelineUpdateResponse: - """ - Update an existing pipeline. + """[DEPRECATED] Update an existing pipeline. + + Use the new /pipelines/v1/pipelines + endpoint instead. Args: account_id: Specifies the public ID of the account. @@ -156,22 +163,25 @@ def update( cast_to=cast(Type[PipelineUpdateResponse], ResultWrapper[PipelineUpdateResponse]), ) + @typing_extensions.deprecated("deprecated") def list( self, *, account_id: str, - page: str | NotGiven = NOT_GIVEN, - per_page: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + page: str | Omit = omit, + per_page: str | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PipelineListResponse: - """ - List, filter, and paginate pipelines in an account. + """[DEPRECATED] List, filter, and paginate pipelines in an account. + + Use the new + /pipelines/v1/pipelines endpoint instead. Args: account_id: Specifies the public ID of the account. @@ -211,6 +221,7 @@ def list( cast_to=PipelineListResponse, ) + @typing_extensions.deprecated("deprecated") def delete( self, pipeline_name: str, @@ -221,10 +232,12 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: - """ - Delete a pipeline. + """[DEPRECATED] Delete a pipeline. + + Use the new /pipelines/v1/pipelines endpoint + instead. Args: account_id: Specifies the public ID of the account. @@ -252,6 +265,7 @@ def delete( cast_to=NoneType, ) + @typing_extensions.deprecated("deprecated") def get( self, pipeline_name: str, @@ -262,10 +276,12 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PipelineGetResponse: - """ - Get configuration of a pipeline. + """[DEPRECATED] Get configuration of a pipeline. + + Use the new + /pipelines/v1/pipelines endpoint instead. Args: account_id: Specifies the public ID of the account. @@ -317,6 +333,7 @@ def with_streaming_response(self) -> AsyncPipelinesResourceWithStreamingResponse """ return AsyncPipelinesResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def create( self, *, @@ -329,10 +346,12 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PipelineCreateResponse: - """ - Create a new pipeline. + """[DEPRECATED] Create a new pipeline. + + Use the new /pipelines/v1/pipelines endpoint + instead. Args: account_id: Specifies the public ID of the account. @@ -369,6 +388,7 @@ async def create( cast_to=cast(Type[PipelineCreateResponse], ResultWrapper[PipelineCreateResponse]), ) + @typing_extensions.deprecated("deprecated") async def update( self, pipeline_name: str, @@ -382,10 +402,12 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PipelineUpdateResponse: - """ - Update an existing pipeline. + """[DEPRECATED] Update an existing pipeline. + + Use the new /pipelines/v1/pipelines + endpoint instead. Args: account_id: Specifies the public ID of the account. @@ -426,22 +448,25 @@ async def update( cast_to=cast(Type[PipelineUpdateResponse], ResultWrapper[PipelineUpdateResponse]), ) + @typing_extensions.deprecated("deprecated") async def list( self, *, account_id: str, - page: str | NotGiven = NOT_GIVEN, - per_page: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + page: str | Omit = omit, + per_page: str | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PipelineListResponse: - """ - List, filter, and paginate pipelines in an account. + """[DEPRECATED] List, filter, and paginate pipelines in an account. + + Use the new + /pipelines/v1/pipelines endpoint instead. Args: account_id: Specifies the public ID of the account. @@ -481,6 +506,7 @@ async def list( cast_to=PipelineListResponse, ) + @typing_extensions.deprecated("deprecated") async def delete( self, pipeline_name: str, @@ -491,10 +517,12 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: - """ - Delete a pipeline. + """[DEPRECATED] Delete a pipeline. + + Use the new /pipelines/v1/pipelines endpoint + instead. Args: account_id: Specifies the public ID of the account. @@ -522,6 +550,7 @@ async def delete( cast_to=NoneType, ) + @typing_extensions.deprecated("deprecated") async def get( self, pipeline_name: str, @@ -532,10 +561,12 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PipelineGetResponse: - """ - Get configuration of a pipeline. + """[DEPRECATED] Get configuration of a pipeline. + + Use the new + /pipelines/v1/pipelines endpoint instead. Args: account_id: Specifies the public ID of the account. @@ -571,20 +602,30 @@ class PipelinesResourceWithRawResponse: def __init__(self, pipelines: PipelinesResource) -> None: self._pipelines = pipelines - self.create = to_raw_response_wrapper( - pipelines.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + pipelines.create, # pyright: ignore[reportDeprecated], + ) ) - self.update = to_raw_response_wrapper( - pipelines.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + pipelines.update, # pyright: ignore[reportDeprecated], + ) ) - self.list = to_raw_response_wrapper( - pipelines.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + pipelines.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_raw_response_wrapper( - pipelines.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + pipelines.delete, # pyright: ignore[reportDeprecated], + ) ) - self.get = to_raw_response_wrapper( - pipelines.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + pipelines.get, # pyright: ignore[reportDeprecated], + ) ) @@ -592,20 +633,30 @@ class AsyncPipelinesResourceWithRawResponse: def __init__(self, pipelines: AsyncPipelinesResource) -> None: self._pipelines = pipelines - self.create = async_to_raw_response_wrapper( - pipelines.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + pipelines.create, # pyright: ignore[reportDeprecated], + ) ) - self.update = async_to_raw_response_wrapper( - pipelines.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + pipelines.update, # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_raw_response_wrapper( - pipelines.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + pipelines.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_raw_response_wrapper( - pipelines.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + pipelines.delete, # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_raw_response_wrapper( - pipelines.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + pipelines.get, # pyright: ignore[reportDeprecated], + ) ) @@ -613,20 +664,30 @@ class PipelinesResourceWithStreamingResponse: def __init__(self, pipelines: PipelinesResource) -> None: self._pipelines = pipelines - self.create = to_streamed_response_wrapper( - pipelines.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + pipelines.create, # pyright: ignore[reportDeprecated], + ) ) - self.update = to_streamed_response_wrapper( - pipelines.update, + self.update = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + pipelines.update, # pyright: ignore[reportDeprecated], + ) ) - self.list = to_streamed_response_wrapper( - pipelines.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + pipelines.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = to_streamed_response_wrapper( - pipelines.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + pipelines.delete, # pyright: ignore[reportDeprecated], + ) ) - self.get = to_streamed_response_wrapper( - pipelines.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + pipelines.get, # pyright: ignore[reportDeprecated], + ) ) @@ -634,18 +695,28 @@ class AsyncPipelinesResourceWithStreamingResponse: def __init__(self, pipelines: AsyncPipelinesResource) -> None: self._pipelines = pipelines - self.create = async_to_streamed_response_wrapper( - pipelines.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + pipelines.create, # pyright: ignore[reportDeprecated], + ) ) - self.update = async_to_streamed_response_wrapper( - pipelines.update, + self.update = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + pipelines.update, # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_streamed_response_wrapper( - pipelines.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + pipelines.list, # pyright: ignore[reportDeprecated], + ) ) - self.delete = async_to_streamed_response_wrapper( - pipelines.delete, + self.delete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + pipelines.delete, # pyright: ignore[reportDeprecated], + ) ) - self.get = async_to_streamed_response_wrapper( - pipelines.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + pipelines.get, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/queues/__init__.py b/src/cloudflare/resources/queues/__init__.py index bccb10e7bf2..145d49439c4 100644 --- a/src/cloudflare/resources/queues/__init__.py +++ b/src/cloudflare/resources/queues/__init__.py @@ -32,14 +32,16 @@ ConsumersResourceWithStreamingResponse, AsyncConsumersResourceWithStreamingResponse, ) +from .subscriptions import ( + SubscriptionsResource, + AsyncSubscriptionsResource, + SubscriptionsResourceWithRawResponse, + AsyncSubscriptionsResourceWithRawResponse, + SubscriptionsResourceWithStreamingResponse, + AsyncSubscriptionsResourceWithStreamingResponse, +) __all__ = [ - "ConsumersResource", - "AsyncConsumersResource", - "ConsumersResourceWithRawResponse", - "AsyncConsumersResourceWithRawResponse", - "ConsumersResourceWithStreamingResponse", - "AsyncConsumersResourceWithStreamingResponse", "MessagesResource", "AsyncMessagesResource", "MessagesResourceWithRawResponse", @@ -52,6 +54,18 @@ "AsyncPurgeResourceWithRawResponse", "PurgeResourceWithStreamingResponse", "AsyncPurgeResourceWithStreamingResponse", + "ConsumersResource", + "AsyncConsumersResource", + "ConsumersResourceWithRawResponse", + "AsyncConsumersResourceWithRawResponse", + "ConsumersResourceWithStreamingResponse", + "AsyncConsumersResourceWithStreamingResponse", + "SubscriptionsResource", + "AsyncSubscriptionsResource", + "SubscriptionsResourceWithRawResponse", + "AsyncSubscriptionsResourceWithRawResponse", + "SubscriptionsResourceWithStreamingResponse", + "AsyncSubscriptionsResourceWithStreamingResponse", "QueuesResource", "AsyncQueuesResource", "QueuesResourceWithRawResponse", diff --git a/src/cloudflare/resources/queues/consumers.py b/src/cloudflare/resources/queues/consumers.py index 34915d5cb6e..3d1a696af75 100644 --- a/src/cloudflare/resources/queues/consumers.py +++ b/src/cloudflare/resources/queues/consumers.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,16 +53,16 @@ def create( queue_id: str, *, account_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - script_name: str | NotGiven = NOT_GIVEN, - settings: consumer_create_params.MqWorkerConsumerSettings | NotGiven = NOT_GIVEN, - type: Literal["worker"] | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + script_name: str | Omit = omit, + settings: consumer_create_params.MqWorkerConsumerSettings | Omit = omit, + type: Literal["worker"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: """ Creates a new consumer for a Queue @@ -90,15 +90,15 @@ def create( queue_id: str, *, account_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - settings: consumer_create_params.MqHTTPConsumerSettings | NotGiven = NOT_GIVEN, - type: Literal["http_pull"] | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + settings: consumer_create_params.MqHTTPConsumerSettings | Omit = omit, + type: Literal["http_pull"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: """ Creates a new consumer for a Queue @@ -124,18 +124,18 @@ def create( queue_id: str, *, account_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - script_name: str | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + script_name: str | Omit = omit, settings: consumer_create_params.MqWorkerConsumerSettings | consumer_create_params.MqHTTPConsumerSettings - | NotGiven = NOT_GIVEN, - type: Literal["worker"] | Literal["http_pull"] | NotGiven = NOT_GIVEN, + | Omit = omit, + type: Literal["worker"] | Literal["http_pull"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -174,16 +174,16 @@ def update( *, account_id: str, queue_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - script_name: str | NotGiven = NOT_GIVEN, - settings: consumer_update_params.MqWorkerConsumerSettings | NotGiven = NOT_GIVEN, - type: Literal["worker"] | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + script_name: str | Omit = omit, + settings: consumer_update_params.MqWorkerConsumerSettings | Omit = omit, + type: Literal["worker"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -214,15 +214,15 @@ def update( *, account_id: str, queue_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - settings: consumer_update_params.MqHTTPConsumerSettings | NotGiven = NOT_GIVEN, - type: Literal["http_pull"] | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + settings: consumer_update_params.MqHTTPConsumerSettings | Omit = omit, + type: Literal["http_pull"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -251,18 +251,18 @@ def update( *, account_id: str, queue_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - script_name: str | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + script_name: str | Omit = omit, settings: consumer_update_params.MqWorkerConsumerSettings | consumer_update_params.MqHTTPConsumerSettings - | NotGiven = NOT_GIVEN, - type: Literal["worker"] | Literal["http_pull"] | NotGiven = NOT_GIVEN, + | Omit = omit, + type: Literal["worker"] | Literal["http_pull"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -296,6 +296,47 @@ def update( ), ) + def list( + self, + queue_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[Consumer]: + """ + Returns the consumers for a Queue + + Args: + account_id: A Resource identifier. + + queue_id: A Resource 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not queue_id: + raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/queues/{queue_id}/consumers", + page=SyncSinglePage[Consumer], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=cast(Any, Consumer), # Union types cannot be passed in as arguments in the type system + ) + def delete( self, consumer_id: str, @@ -307,7 +348,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConsumerDeleteResponse: """ Deletes the consumer for a queue. @@ -343,24 +384,27 @@ def delete( def get( self, - queue_id: str, + consumer_id: str, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Consumer]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[Consumer]: """ - Returns the consumers for a Queue + Fetches the consumer for a queue by consumer id Args: account_id: A Resource identifier. queue_id: A Resource identifier. + consumer_id: A Resource identifier. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -373,13 +417,23 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/queues/{queue_id}/consumers", - page=SyncSinglePage[Consumer], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + if not consumer_id: + raise ValueError(f"Expected a non-empty value for `consumer_id` but received {consumer_id!r}") + return cast( + Optional[Consumer], + self._get( + f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[Consumer] + ), # Union types cannot be passed in as arguments in the type system ), - model=cast(Any, Consumer), # Union types cannot be passed in as arguments in the type system ) @@ -409,16 +463,16 @@ async def create( queue_id: str, *, account_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - script_name: str | NotGiven = NOT_GIVEN, - settings: consumer_create_params.MqWorkerConsumerSettings | NotGiven = NOT_GIVEN, - type: Literal["worker"] | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + script_name: str | Omit = omit, + settings: consumer_create_params.MqWorkerConsumerSettings | Omit = omit, + type: Literal["worker"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: """ Creates a new consumer for a Queue @@ -446,15 +500,15 @@ async def create( queue_id: str, *, account_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - settings: consumer_create_params.MqHTTPConsumerSettings | NotGiven = NOT_GIVEN, - type: Literal["http_pull"] | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + settings: consumer_create_params.MqHTTPConsumerSettings | Omit = omit, + type: Literal["http_pull"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: """ Creates a new consumer for a Queue @@ -480,18 +534,18 @@ async def create( queue_id: str, *, account_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - script_name: str | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + script_name: str | Omit = omit, settings: consumer_create_params.MqWorkerConsumerSettings | consumer_create_params.MqHTTPConsumerSettings - | NotGiven = NOT_GIVEN, - type: Literal["worker"] | Literal["http_pull"] | NotGiven = NOT_GIVEN, + | Omit = omit, + type: Literal["worker"] | Literal["http_pull"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -530,16 +584,16 @@ async def update( *, account_id: str, queue_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - script_name: str | NotGiven = NOT_GIVEN, - settings: consumer_update_params.MqWorkerConsumerSettings | NotGiven = NOT_GIVEN, - type: Literal["worker"] | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + script_name: str | Omit = omit, + settings: consumer_update_params.MqWorkerConsumerSettings | Omit = omit, + type: Literal["worker"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -570,15 +624,15 @@ async def update( *, account_id: str, queue_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - settings: consumer_update_params.MqHTTPConsumerSettings | NotGiven = NOT_GIVEN, - type: Literal["http_pull"] | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + settings: consumer_update_params.MqHTTPConsumerSettings | Omit = omit, + type: Literal["http_pull"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -607,18 +661,18 @@ async def update( *, account_id: str, queue_id: str, - dead_letter_queue: str | NotGiven = NOT_GIVEN, - script_name: str | NotGiven = NOT_GIVEN, + dead_letter_queue: str | Omit = omit, + script_name: str | Omit = omit, settings: consumer_update_params.MqWorkerConsumerSettings | consumer_update_params.MqHTTPConsumerSettings - | NotGiven = NOT_GIVEN, - type: Literal["worker"] | Literal["http_pull"] | NotGiven = NOT_GIVEN, + | Omit = omit, + type: Literal["worker"] | Literal["http_pull"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -652,6 +706,47 @@ async def update( ), ) + def list( + self, + queue_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[Consumer, AsyncSinglePage[Consumer]]: + """ + Returns the consumers for a Queue + + Args: + account_id: A Resource identifier. + + queue_id: A Resource 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not queue_id: + raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/queues/{queue_id}/consumers", + page=AsyncSinglePage[Consumer], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=cast(Any, Consumer), # Union types cannot be passed in as arguments in the type system + ) + async def delete( self, consumer_id: str, @@ -663,7 +758,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConsumerDeleteResponse: """ Deletes the consumer for a queue. @@ -697,26 +792,29 @@ async def delete( cast_to=ConsumerDeleteResponse, ) - def get( + async def get( self, - queue_id: str, + consumer_id: str, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Consumer, AsyncSinglePage[Consumer]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[Consumer]: """ - Returns the consumers for a Queue + Fetches the consumer for a queue by consumer id Args: account_id: A Resource identifier. queue_id: A Resource identifier. + consumer_id: A Resource identifier. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -729,13 +827,23 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/queues/{queue_id}/consumers", - page=AsyncSinglePage[Consumer], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + if not consumer_id: + raise ValueError(f"Expected a non-empty value for `consumer_id` but received {consumer_id!r}") + return cast( + Optional[Consumer], + await self._get( + f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[Consumer] + ), # Union types cannot be passed in as arguments in the type system ), - model=cast(Any, Consumer), # Union types cannot be passed in as arguments in the type system ) @@ -749,6 +857,9 @@ def __init__(self, consumers: ConsumersResource) -> None: self.update = to_raw_response_wrapper( consumers.update, ) + self.list = to_raw_response_wrapper( + consumers.list, + ) self.delete = to_raw_response_wrapper( consumers.delete, ) @@ -767,6 +878,9 @@ def __init__(self, consumers: AsyncConsumersResource) -> None: self.update = async_to_raw_response_wrapper( consumers.update, ) + self.list = async_to_raw_response_wrapper( + consumers.list, + ) self.delete = async_to_raw_response_wrapper( consumers.delete, ) @@ -785,6 +899,9 @@ def __init__(self, consumers: ConsumersResource) -> None: self.update = to_streamed_response_wrapper( consumers.update, ) + self.list = to_streamed_response_wrapper( + consumers.list, + ) self.delete = to_streamed_response_wrapper( consumers.delete, ) @@ -803,6 +920,9 @@ def __init__(self, consumers: AsyncConsumersResource) -> None: self.update = async_to_streamed_response_wrapper( consumers.update, ) + self.list = async_to_streamed_response_wrapper( + consumers.list, + ) self.delete = async_to_streamed_response_wrapper( consumers.delete, ) diff --git a/src/cloudflare/resources/queues/messages.py b/src/cloudflare/resources/queues/messages.py index faad5789f8d..9148e296028 100644 --- a/src/cloudflare/resources/queues/messages.py +++ b/src/cloudflare/resources/queues/messages.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,14 +53,14 @@ def ack( queue_id: str, *, account_id: str, - acks: Iterable[message_ack_params.Ack] | NotGiven = NOT_GIVEN, - retries: Iterable[message_ack_params.Retry] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MessageAckResponse]: """ Acknowledge + Retry messages from a Queue @@ -106,14 +106,14 @@ def bulk_push( queue_id: str, *, account_id: str, - delay_seconds: float | NotGiven = NOT_GIVEN, - messages: Iterable[message_bulk_push_params.Message] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessageBulkPushResponse: """ Push a batch of message to a Queue @@ -157,14 +157,14 @@ def pull( queue_id: str, *, account_id: str, - batch_size: float | NotGiven = NOT_GIVEN, - visibility_timeout_ms: float | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MessagePullResponse]: """ Pull a batch of messages from a Queue @@ -216,15 +216,15 @@ def push( queue_id: str, *, account_id: str, - body: str | NotGiven = NOT_GIVEN, - content_type: Literal["text"] | NotGiven = NOT_GIVEN, - delay_seconds: float | NotGiven = NOT_GIVEN, + body: str | Omit = omit, + content_type: Literal["text"] | Omit = omit, + delay_seconds: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagePushResponse: """ Push a message to a Queue @@ -253,15 +253,15 @@ def push( queue_id: str, *, account_id: str, - body: object | NotGiven = NOT_GIVEN, - content_type: Literal["json"] | NotGiven = NOT_GIVEN, - delay_seconds: float | NotGiven = NOT_GIVEN, + body: object | Omit = omit, + content_type: Literal["json"] | Omit = omit, + delay_seconds: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagePushResponse: """ Push a message to a Queue @@ -290,15 +290,15 @@ def push( queue_id: str, *, account_id: str, - body: str | object | NotGiven = NOT_GIVEN, - content_type: Literal["text"] | Literal["json"] | NotGiven = NOT_GIVEN, - delay_seconds: float | NotGiven = NOT_GIVEN, + body: str | object | Omit = omit, + content_type: Literal["text"] | Literal["json"] | Omit = omit, + delay_seconds: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagePushResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -346,14 +346,14 @@ async def ack( queue_id: str, *, account_id: str, - acks: Iterable[message_ack_params.Ack] | NotGiven = NOT_GIVEN, - retries: Iterable[message_ack_params.Retry] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MessageAckResponse]: """ Acknowledge + Retry messages from a Queue @@ -399,14 +399,14 @@ async def bulk_push( queue_id: str, *, account_id: str, - delay_seconds: float | NotGiven = NOT_GIVEN, - messages: Iterable[message_bulk_push_params.Message] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessageBulkPushResponse: """ Push a batch of message to a Queue @@ -450,14 +450,14 @@ async def pull( queue_id: str, *, account_id: str, - batch_size: float | NotGiven = NOT_GIVEN, - visibility_timeout_ms: float | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MessagePullResponse]: """ Pull a batch of messages from a Queue @@ -509,15 +509,15 @@ async def push( queue_id: str, *, account_id: str, - body: str | NotGiven = NOT_GIVEN, - content_type: Literal["text"] | NotGiven = NOT_GIVEN, - delay_seconds: float | NotGiven = NOT_GIVEN, + body: str | Omit = omit, + content_type: Literal["text"] | Omit = omit, + delay_seconds: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagePushResponse: """ Push a message to a Queue @@ -546,15 +546,15 @@ async def push( queue_id: str, *, account_id: str, - body: object | NotGiven = NOT_GIVEN, - content_type: Literal["json"] | NotGiven = NOT_GIVEN, - delay_seconds: float | NotGiven = NOT_GIVEN, + body: object | Omit = omit, + content_type: Literal["json"] | Omit = omit, + delay_seconds: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagePushResponse: """ Push a message to a Queue @@ -583,15 +583,15 @@ async def push( queue_id: str, *, account_id: str, - body: str | object | NotGiven = NOT_GIVEN, - content_type: Literal["text"] | Literal["json"] | NotGiven = NOT_GIVEN, - delay_seconds: float | NotGiven = NOT_GIVEN, + body: str | object | Omit = omit, + content_type: Literal["text"] | Literal["json"] | Omit = omit, + delay_seconds: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagePushResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") diff --git a/src/cloudflare/resources/queues/purge.py b/src/cloudflare/resources/queues/purge.py index 4dd9403f888..01b13589546 100644 --- a/src/cloudflare/resources/queues/purge.py +++ b/src/cloudflare/resources/queues/purge.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,13 +50,13 @@ def start( queue_id: str, *, account_id: str, - delete_messages_permanently: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Queue]: """ Deletes all messages from the Queue. @@ -105,7 +105,7 @@ def status( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PurgeStatusResponse]: """ Get details about a Queue's purge status. @@ -165,13 +165,13 @@ async def start( queue_id: str, *, account_id: str, - delete_messages_permanently: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Queue]: """ Deletes all messages from the Queue. @@ -220,7 +220,7 @@ async def status( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PurgeStatusResponse]: """ Get details about a Queue's purge status. diff --git a/src/cloudflare/resources/queues/queues.py b/src/cloudflare/resources/queues/queues.py index 8c5c0e62b63..3e5d9cc27c0 100644 --- a/src/cloudflare/resources/queues/queues.py +++ b/src/cloudflare/resources/queues/queues.py @@ -14,7 +14,7 @@ PurgeResourceWithStreamingResponse, AsyncPurgeResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .messages import ( MessagesResource, @@ -42,6 +42,14 @@ ) from ..._wrappers import ResultWrapper from ...pagination import SyncSinglePage, AsyncSinglePage +from .subscriptions import ( + SubscriptionsResource, + AsyncSubscriptionsResource, + SubscriptionsResourceWithRawResponse, + AsyncSubscriptionsResourceWithRawResponse, + SubscriptionsResourceWithStreamingResponse, + AsyncSubscriptionsResourceWithStreamingResponse, +) from ..._base_client import AsyncPaginator, make_request_options from ...types.queues import queue_edit_params, queue_create_params, queue_update_params from ...types.queues.queue import Queue @@ -51,10 +59,6 @@ class QueuesResource(SyncAPIResource): - @cached_property - def consumers(self) -> ConsumersResource: - return ConsumersResource(self._client) - @cached_property def messages(self) -> MessagesResource: return MessagesResource(self._client) @@ -63,6 +67,14 @@ def messages(self) -> MessagesResource: def purge(self) -> PurgeResource: return PurgeResource(self._client) + @cached_property + def consumers(self) -> ConsumersResource: + return ConsumersResource(self._client) + + @cached_property + def subscriptions(self) -> SubscriptionsResource: + return SubscriptionsResource(self._client) + @cached_property def with_raw_response(self) -> QueuesResourceWithRawResponse: """ @@ -92,7 +104,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Queue]: """ Create a new queue @@ -128,14 +140,14 @@ def update( queue_id: str, *, account_id: str, - queue_name: str | NotGiven = NOT_GIVEN, - settings: queue_update_params.Settings | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Queue]: """Updates a Queue. @@ -188,7 +200,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Queue]: """ Returns the queues owned by an account. @@ -225,7 +237,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> QueueDeleteResponse: """ Deletes a queue @@ -260,14 +272,14 @@ def edit( queue_id: str, *, account_id: str, - queue_name: str | NotGiven = NOT_GIVEN, - settings: queue_edit_params.Settings | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Queue]: """ Updates a Queue. @@ -318,7 +330,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Queue]: """ Get details about a specific queue. @@ -354,10 +366,6 @@ def get( class AsyncQueuesResource(AsyncAPIResource): - @cached_property - def consumers(self) -> AsyncConsumersResource: - return AsyncConsumersResource(self._client) - @cached_property def messages(self) -> AsyncMessagesResource: return AsyncMessagesResource(self._client) @@ -366,6 +374,14 @@ def messages(self) -> AsyncMessagesResource: def purge(self) -> AsyncPurgeResource: return AsyncPurgeResource(self._client) + @cached_property + def consumers(self) -> AsyncConsumersResource: + return AsyncConsumersResource(self._client) + + @cached_property + def subscriptions(self) -> AsyncSubscriptionsResource: + return AsyncSubscriptionsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncQueuesResourceWithRawResponse: """ @@ -395,7 +411,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Queue]: """ Create a new queue @@ -431,14 +447,14 @@ async def update( queue_id: str, *, account_id: str, - queue_name: str | NotGiven = NOT_GIVEN, - settings: queue_update_params.Settings | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Queue]: """Updates a Queue. @@ -491,7 +507,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Queue, AsyncSinglePage[Queue]]: """ Returns the queues owned by an account. @@ -528,7 +544,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> QueueDeleteResponse: """ Deletes a queue @@ -563,14 +579,14 @@ async def edit( queue_id: str, *, account_id: str, - queue_name: str | NotGiven = NOT_GIVEN, - settings: queue_edit_params.Settings | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Queue]: """ Updates a Queue. @@ -621,7 +637,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Queue]: """ Get details about a specific queue. @@ -679,10 +695,6 @@ def __init__(self, queues: QueuesResource) -> None: queues.get, ) - @cached_property - def consumers(self) -> ConsumersResourceWithRawResponse: - return ConsumersResourceWithRawResponse(self._queues.consumers) - @cached_property def messages(self) -> MessagesResourceWithRawResponse: return MessagesResourceWithRawResponse(self._queues.messages) @@ -691,6 +703,14 @@ def messages(self) -> MessagesResourceWithRawResponse: def purge(self) -> PurgeResourceWithRawResponse: return PurgeResourceWithRawResponse(self._queues.purge) + @cached_property + def consumers(self) -> ConsumersResourceWithRawResponse: + return ConsumersResourceWithRawResponse(self._queues.consumers) + + @cached_property + def subscriptions(self) -> SubscriptionsResourceWithRawResponse: + return SubscriptionsResourceWithRawResponse(self._queues.subscriptions) + class AsyncQueuesResourceWithRawResponse: def __init__(self, queues: AsyncQueuesResource) -> None: @@ -715,10 +735,6 @@ def __init__(self, queues: AsyncQueuesResource) -> None: queues.get, ) - @cached_property - def consumers(self) -> AsyncConsumersResourceWithRawResponse: - return AsyncConsumersResourceWithRawResponse(self._queues.consumers) - @cached_property def messages(self) -> AsyncMessagesResourceWithRawResponse: return AsyncMessagesResourceWithRawResponse(self._queues.messages) @@ -727,6 +743,14 @@ def messages(self) -> AsyncMessagesResourceWithRawResponse: def purge(self) -> AsyncPurgeResourceWithRawResponse: return AsyncPurgeResourceWithRawResponse(self._queues.purge) + @cached_property + def consumers(self) -> AsyncConsumersResourceWithRawResponse: + return AsyncConsumersResourceWithRawResponse(self._queues.consumers) + + @cached_property + def subscriptions(self) -> AsyncSubscriptionsResourceWithRawResponse: + return AsyncSubscriptionsResourceWithRawResponse(self._queues.subscriptions) + class QueuesResourceWithStreamingResponse: def __init__(self, queues: QueuesResource) -> None: @@ -751,10 +775,6 @@ def __init__(self, queues: QueuesResource) -> None: queues.get, ) - @cached_property - def consumers(self) -> ConsumersResourceWithStreamingResponse: - return ConsumersResourceWithStreamingResponse(self._queues.consumers) - @cached_property def messages(self) -> MessagesResourceWithStreamingResponse: return MessagesResourceWithStreamingResponse(self._queues.messages) @@ -763,6 +783,14 @@ def messages(self) -> MessagesResourceWithStreamingResponse: def purge(self) -> PurgeResourceWithStreamingResponse: return PurgeResourceWithStreamingResponse(self._queues.purge) + @cached_property + def consumers(self) -> ConsumersResourceWithStreamingResponse: + return ConsumersResourceWithStreamingResponse(self._queues.consumers) + + @cached_property + def subscriptions(self) -> SubscriptionsResourceWithStreamingResponse: + return SubscriptionsResourceWithStreamingResponse(self._queues.subscriptions) + class AsyncQueuesResourceWithStreamingResponse: def __init__(self, queues: AsyncQueuesResource) -> None: @@ -787,10 +815,6 @@ def __init__(self, queues: AsyncQueuesResource) -> None: queues.get, ) - @cached_property - def consumers(self) -> AsyncConsumersResourceWithStreamingResponse: - return AsyncConsumersResourceWithStreamingResponse(self._queues.consumers) - @cached_property def messages(self) -> AsyncMessagesResourceWithStreamingResponse: return AsyncMessagesResourceWithStreamingResponse(self._queues.messages) @@ -798,3 +822,11 @@ def messages(self) -> AsyncMessagesResourceWithStreamingResponse: @cached_property def purge(self) -> AsyncPurgeResourceWithStreamingResponse: return AsyncPurgeResourceWithStreamingResponse(self._queues.purge) + + @cached_property + def consumers(self) -> AsyncConsumersResourceWithStreamingResponse: + return AsyncConsumersResourceWithStreamingResponse(self._queues.consumers) + + @cached_property + def subscriptions(self) -> AsyncSubscriptionsResourceWithStreamingResponse: + return AsyncSubscriptionsResourceWithStreamingResponse(self._queues.subscriptions) diff --git a/src/cloudflare/resources/queues/subscriptions.py b/src/cloudflare/resources/queues/subscriptions.py new file mode 100644 index 00000000000..14ec39cc5ce --- /dev/null +++ b/src/cloudflare/resources/queues/subscriptions.py @@ -0,0 +1,710 @@ +# 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 ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ..._base_client import AsyncPaginator, make_request_options +from ...types.queues import subscription_list_params, subscription_create_params, subscription_update_params +from ...types.queues.subscription_get_response import SubscriptionGetResponse +from ...types.queues.subscription_list_response import SubscriptionListResponse +from ...types.queues.subscription_create_response import SubscriptionCreateResponse +from ...types.queues.subscription_delete_response import SubscriptionDeleteResponse +from ...types.queues.subscription_update_response import SubscriptionUpdateResponse + +__all__ = ["SubscriptionsResource", "AsyncSubscriptionsResource"] + + +class SubscriptionsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SubscriptionsResourceWithRawResponse: + """ + 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 SubscriptionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SubscriptionsResourceWithStreamingResponse: + """ + 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 SubscriptionsResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + destination: subscription_create_params.Destination | Omit = omit, + enabled: bool | Omit = omit, + events: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, + source: subscription_create_params.Source | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[SubscriptionCreateResponse]: + """ + Create a new event subscription for a queue + + Args: + account_id: A Resource identifier. + + destination: Destination configuration for the subscription + + enabled: Whether the subscription is active + + events: List of event types this subscription handles + + name: Name of the subscription + + source: Source configuration for the subscription + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/event_subscriptions/subscriptions", + body=maybe_transform( + { + "destination": destination, + "enabled": enabled, + "events": events, + "name": name, + "source": source, + }, + subscription_create_params.SubscriptionCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[SubscriptionCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[SubscriptionCreateResponse]], ResultWrapper[SubscriptionCreateResponse]), + ) + + def update( + self, + subscription_id: str, + *, + account_id: str, + destination: subscription_update_params.Destination | Omit = omit, + enabled: bool | Omit = omit, + events: SequenceNotStr[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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[SubscriptionUpdateResponse]: + """ + Update an existing event subscription + + Args: + account_id: A Resource identifier. + + subscription_id: A Resource identifier. + + destination: Destination configuration for the subscription + + enabled: Whether the subscription is active + + events: List of event types this subscription handles + + name: Name of the subscription + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 subscription_id: + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") + return self._patch( + f"/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}", + body=maybe_transform( + { + "destination": destination, + "enabled": enabled, + "events": events, + "name": name, + }, + subscription_update_params.SubscriptionUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[SubscriptionUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[SubscriptionUpdateResponse]], ResultWrapper[SubscriptionUpdateResponse]), + ) + + def list( + self, + *, + account_id: str, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["created_at", "name", "enabled", "source"] | 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. + # The extra values given here take precedence over values defined on the client or passed to this 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[SubscriptionListResponse]: + """ + Get a paginated list of event subscriptions with optional sorting and filtering + + Args: + account_id: A Resource identifier. + + direction: Sort direction + + order: Field to sort by + + page: Page number for pagination + + per_page: Number of items 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 + """ + if 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}/event_subscriptions/subscriptions", + page=SyncV4PagePaginationArray[SubscriptionListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "direction": direction, + "order": order, + "page": page, + "per_page": per_page, + }, + subscription_list_params.SubscriptionListParams, + ), + ), + model=SubscriptionListResponse, + ) + + def delete( + self, + subscription_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, + ) -> Optional[SubscriptionDeleteResponse]: + """ + Delete an existing event subscription + + Args: + account_id: A Resource identifier. + + subscription_id: A Resource 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not subscription_id: + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") + return self._delete( + f"/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[SubscriptionDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[SubscriptionDeleteResponse]], ResultWrapper[SubscriptionDeleteResponse]), + ) + + def get( + self, + subscription_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, + ) -> Optional[SubscriptionGetResponse]: + """ + Get details about an existing event subscription + + Args: + account_id: A Resource identifier. + + subscription_id: A Resource 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not subscription_id: + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") + return self._get( + f"/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[SubscriptionGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[SubscriptionGetResponse]], ResultWrapper[SubscriptionGetResponse]), + ) + + +class AsyncSubscriptionsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSubscriptionsResourceWithRawResponse: + """ + 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 AsyncSubscriptionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSubscriptionsResourceWithStreamingResponse: + """ + 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 AsyncSubscriptionsResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + destination: subscription_create_params.Destination | Omit = omit, + enabled: bool | Omit = omit, + events: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, + source: subscription_create_params.Source | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[SubscriptionCreateResponse]: + """ + Create a new event subscription for a queue + + Args: + account_id: A Resource identifier. + + destination: Destination configuration for the subscription + + enabled: Whether the subscription is active + + events: List of event types this subscription handles + + name: Name of the subscription + + source: Source configuration for the subscription + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/event_subscriptions/subscriptions", + body=await async_maybe_transform( + { + "destination": destination, + "enabled": enabled, + "events": events, + "name": name, + "source": source, + }, + subscription_create_params.SubscriptionCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[SubscriptionCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[SubscriptionCreateResponse]], ResultWrapper[SubscriptionCreateResponse]), + ) + + async def update( + self, + subscription_id: str, + *, + account_id: str, + destination: subscription_update_params.Destination | Omit = omit, + enabled: bool | Omit = omit, + events: SequenceNotStr[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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[SubscriptionUpdateResponse]: + """ + Update an existing event subscription + + Args: + account_id: A Resource identifier. + + subscription_id: A Resource identifier. + + destination: Destination configuration for the subscription + + enabled: Whether the subscription is active + + events: List of event types this subscription handles + + name: Name of the subscription + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 subscription_id: + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") + return await self._patch( + f"/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}", + body=await async_maybe_transform( + { + "destination": destination, + "enabled": enabled, + "events": events, + "name": name, + }, + subscription_update_params.SubscriptionUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[SubscriptionUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[SubscriptionUpdateResponse]], ResultWrapper[SubscriptionUpdateResponse]), + ) + + def list( + self, + *, + account_id: str, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["created_at", "name", "enabled", "source"] | 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. + # The extra values given here take precedence over values defined on the client or passed to this 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[SubscriptionListResponse, AsyncV4PagePaginationArray[SubscriptionListResponse]]: + """ + Get a paginated list of event subscriptions with optional sorting and filtering + + Args: + account_id: A Resource identifier. + + direction: Sort direction + + order: Field to sort by + + page: Page number for pagination + + per_page: Number of items 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 + """ + if 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}/event_subscriptions/subscriptions", + page=AsyncV4PagePaginationArray[SubscriptionListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "direction": direction, + "order": order, + "page": page, + "per_page": per_page, + }, + subscription_list_params.SubscriptionListParams, + ), + ), + model=SubscriptionListResponse, + ) + + async def delete( + self, + subscription_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, + ) -> Optional[SubscriptionDeleteResponse]: + """ + Delete an existing event subscription + + Args: + account_id: A Resource identifier. + + subscription_id: A Resource 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not subscription_id: + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") + return await self._delete( + f"/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[SubscriptionDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[SubscriptionDeleteResponse]], ResultWrapper[SubscriptionDeleteResponse]), + ) + + async def get( + self, + subscription_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, + ) -> Optional[SubscriptionGetResponse]: + """ + Get details about an existing event subscription + + Args: + account_id: A Resource identifier. + + subscription_id: A Resource 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not subscription_id: + raise ValueError(f"Expected a non-empty value for `subscription_id` but received {subscription_id!r}") + return await self._get( + f"/accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[SubscriptionGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[SubscriptionGetResponse]], ResultWrapper[SubscriptionGetResponse]), + ) + + +class SubscriptionsResourceWithRawResponse: + def __init__(self, subscriptions: SubscriptionsResource) -> None: + self._subscriptions = subscriptions + + self.create = to_raw_response_wrapper( + subscriptions.create, + ) + self.update = to_raw_response_wrapper( + subscriptions.update, + ) + self.list = to_raw_response_wrapper( + subscriptions.list, + ) + self.delete = to_raw_response_wrapper( + subscriptions.delete, + ) + self.get = to_raw_response_wrapper( + subscriptions.get, + ) + + +class AsyncSubscriptionsResourceWithRawResponse: + def __init__(self, subscriptions: AsyncSubscriptionsResource) -> None: + self._subscriptions = subscriptions + + self.create = async_to_raw_response_wrapper( + subscriptions.create, + ) + self.update = async_to_raw_response_wrapper( + subscriptions.update, + ) + self.list = async_to_raw_response_wrapper( + subscriptions.list, + ) + self.delete = async_to_raw_response_wrapper( + subscriptions.delete, + ) + self.get = async_to_raw_response_wrapper( + subscriptions.get, + ) + + +class SubscriptionsResourceWithStreamingResponse: + def __init__(self, subscriptions: SubscriptionsResource) -> None: + self._subscriptions = subscriptions + + self.create = to_streamed_response_wrapper( + subscriptions.create, + ) + self.update = to_streamed_response_wrapper( + subscriptions.update, + ) + self.list = to_streamed_response_wrapper( + subscriptions.list, + ) + self.delete = to_streamed_response_wrapper( + subscriptions.delete, + ) + self.get = to_streamed_response_wrapper( + subscriptions.get, + ) + + +class AsyncSubscriptionsResourceWithStreamingResponse: + def __init__(self, subscriptions: AsyncSubscriptionsResource) -> None: + self._subscriptions = subscriptions + + self.create = async_to_streamed_response_wrapper( + subscriptions.create, + ) + self.update = async_to_streamed_response_wrapper( + subscriptions.update, + ) + self.list = async_to_streamed_response_wrapper( + subscriptions.list, + ) + self.delete = async_to_streamed_response_wrapper( + subscriptions.delete, + ) + self.get = async_to_streamed_response_wrapper( + subscriptions.get, + ) diff --git a/src/cloudflare/resources/r2/buckets/buckets.py b/src/cloudflare/resources/r2/buckets/buckets.py index 7f190d91955..5f7f5e1885d 100644 --- a/src/cloudflare/resources/r2/buckets/buckets.py +++ b/src/cloudflare/resources/r2/buckets/buckets.py @@ -39,7 +39,7 @@ MetricsResourceWithStreamingResponse, AsyncMetricsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from .lifecycle import ( LifecycleResource, @@ -135,15 +135,15 @@ def create( *, account_id: str, name: str, - location_hint: Literal["apac", "eeur", "enam", "weur", "wnam", "oc"] | NotGiven = NOT_GIVEN, - storage_class: Literal["Standard", "InfrequentAccess"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + location_hint: Literal["apac", "eeur", "enam", "weur", "wnam", "oc"] | Omit = omit, + storage_class: Literal["Standard", "InfrequentAccess"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Bucket: """ Creates a new R2 bucket. @@ -170,7 +170,7 @@ def create( 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({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._post( @@ -197,19 +197,19 @@ def list( self, *, account_id: str, - cursor: str | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - name_contains: str | NotGiven = NOT_GIVEN, - order: Literal["name"] | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - start_after: str | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cursor: str | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + name_contains: str | Omit = omit, + order: Literal["name"] | Omit = omit, + per_page: float | Omit = omit, + start_after: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BucketListResponse: """ Lists all R2 buckets on your account. @@ -244,7 +244,7 @@ def list( 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({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -275,13 +275,13 @@ def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an existing R2 bucket. @@ -306,7 +306,7 @@ def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._delete( @@ -327,13 +327,13 @@ def edit( *, account_id: str, storage_class: Literal["Standard", "InfrequentAccess"], - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Bucket: """ Updates properties of an existing R2 bucket. @@ -363,7 +363,7 @@ def edit( **strip_not_given( { "cf-r2-storage-class": str(storage_class), - "cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN, + "cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given, } ), **(extra_headers or {}), @@ -385,13 +385,13 @@ def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Bucket: """ Gets properties of an existing R2 bucket. @@ -416,7 +416,7 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -485,15 +485,15 @@ async def create( *, account_id: str, name: str, - location_hint: Literal["apac", "eeur", "enam", "weur", "wnam", "oc"] | NotGiven = NOT_GIVEN, - storage_class: Literal["Standard", "InfrequentAccess"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + location_hint: Literal["apac", "eeur", "enam", "weur", "wnam", "oc"] | Omit = omit, + storage_class: Literal["Standard", "InfrequentAccess"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Bucket: """ Creates a new R2 bucket. @@ -520,7 +520,7 @@ async def create( 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({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._post( @@ -547,19 +547,19 @@ async def list( self, *, account_id: str, - cursor: str | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - name_contains: str | NotGiven = NOT_GIVEN, - order: Literal["name"] | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - start_after: str | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + cursor: str | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + name_contains: str | Omit = omit, + order: Literal["name"] | Omit = omit, + per_page: float | Omit = omit, + start_after: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BucketListResponse: """ Lists all R2 buckets on your account. @@ -594,7 +594,7 @@ async def list( 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({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( @@ -625,13 +625,13 @@ async def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes an existing R2 bucket. @@ -656,7 +656,7 @@ async def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._delete( @@ -677,13 +677,13 @@ async def edit( *, account_id: str, storage_class: Literal["Standard", "InfrequentAccess"], - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Bucket: """ Updates properties of an existing R2 bucket. @@ -713,7 +713,7 @@ async def edit( **strip_not_given( { "cf-r2-storage-class": str(storage_class), - "cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN, + "cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given, } ), **(extra_headers or {}), @@ -735,13 +735,13 @@ async def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Bucket: """ Gets properties of an existing R2 bucket. @@ -766,7 +766,7 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/cors.py b/src/cloudflare/resources/r2/buckets/cors.py index ad83652f1f7..7868e6da1ce 100644 --- a/src/cloudflare/resources/r2/buckets/cors.py +++ b/src/cloudflare/resources/r2/buckets/cors.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -50,14 +50,14 @@ def update( bucket_name: str, *, account_id: str, - rules: Iterable[cors_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Set the CORS policy for a bucket. @@ -82,7 +82,7 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._put( @@ -103,13 +103,13 @@ def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete the CORS policy for a bucket. @@ -134,7 +134,7 @@ def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._delete( @@ -154,13 +154,13 @@ def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CORSGetResponse: """ Get the CORS policy for a bucket. @@ -185,7 +185,7 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -226,14 +226,14 @@ async def update( bucket_name: str, *, account_id: str, - rules: Iterable[cors_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Set the CORS policy for a bucket. @@ -258,7 +258,7 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._put( @@ -279,13 +279,13 @@ async def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete the CORS policy for a bucket. @@ -310,7 +310,7 @@ async def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._delete( @@ -330,13 +330,13 @@ async def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CORSGetResponse: """ Get the CORS policy for a bucket. @@ -361,7 +361,7 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/domains/custom.py b/src/cloudflare/resources/r2/buckets/domains/custom.py index 4fb3f0e15f9..800a8520141 100644 --- a/src/cloudflare/resources/r2/buckets/domains/custom.py +++ b/src/cloudflare/resources/r2/buckets/domains/custom.py @@ -7,7 +7,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ....._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -57,14 +57,15 @@ def create( domain: str, enabled: bool, zone_id: str, - min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + ciphers: SequenceNotStr[str] | Omit = omit, + min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomCreateResponse: """ Register a new custom domain for an existing R2 bucket. @@ -81,6 +82,9 @@ def create( zone_id: Zone ID of the custom domain. + ciphers: An allowlist of ciphers for TLS termination. These ciphers must be in the + BoringSSL format. + min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0. @@ -99,7 +103,7 @@ def create( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._post( @@ -109,6 +113,7 @@ def create( "domain": domain, "enabled": enabled, "zone_id": zone_id, + "ciphers": ciphers, "min_tls": min_tls, }, custom_create_params.CustomCreateParams, @@ -129,15 +134,16 @@ def update( *, account_id: str, bucket_name: str, - enabled: bool | NotGiven = NOT_GIVEN, - min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + ciphers: SequenceNotStr[str] | Omit = omit, + enabled: bool | Omit = omit, + min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomUpdateResponse: """ Edit the configuration for a custom domain on an existing R2 bucket. @@ -149,6 +155,9 @@ def update( domain: Name of the custom domain. + ciphers: An allowlist of ciphers for TLS termination. These ciphers must be in the + BoringSSL format. + enabled: Whether to enable public bucket access at the specified custom domain. min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If @@ -171,13 +180,14 @@ def update( if not domain: raise ValueError(f"Expected a non-empty value for `domain` but received {domain!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._put( f"/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}", body=maybe_transform( { + "ciphers": ciphers, "enabled": enabled, "min_tls": min_tls, }, @@ -198,13 +208,13 @@ def list( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomListResponse: """ Gets a list of all custom domains registered with an existing R2 bucket. @@ -229,7 +239,7 @@ def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -250,13 +260,13 @@ def delete( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomDeleteResponse: """ Remove custom domain registration from an existing R2 bucket. @@ -285,7 +295,7 @@ def delete( if not domain: raise ValueError(f"Expected a non-empty value for `domain` but received {domain!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._delete( @@ -306,13 +316,13 @@ def get( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomGetResponse: """ Get the configuration for a custom domain on an existing R2 bucket. @@ -341,7 +351,7 @@ def get( if not domain: raise ValueError(f"Expected a non-empty value for `domain` but received {domain!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -385,14 +395,15 @@ async def create( domain: str, enabled: bool, zone_id: str, - min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + ciphers: SequenceNotStr[str] | Omit = omit, + min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomCreateResponse: """ Register a new custom domain for an existing R2 bucket. @@ -409,6 +420,9 @@ async def create( zone_id: Zone ID of the custom domain. + ciphers: An allowlist of ciphers for TLS termination. These ciphers must be in the + BoringSSL format. + min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0. @@ -427,7 +441,7 @@ async def create( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._post( @@ -437,6 +451,7 @@ async def create( "domain": domain, "enabled": enabled, "zone_id": zone_id, + "ciphers": ciphers, "min_tls": min_tls, }, custom_create_params.CustomCreateParams, @@ -457,15 +472,16 @@ async def update( *, account_id: str, bucket_name: str, - enabled: bool | NotGiven = NOT_GIVEN, - min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + ciphers: SequenceNotStr[str] | Omit = omit, + enabled: bool | Omit = omit, + min_tls: Literal["1.0", "1.1", "1.2", "1.3"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomUpdateResponse: """ Edit the configuration for a custom domain on an existing R2 bucket. @@ -477,6 +493,9 @@ async def update( domain: Name of the custom domain. + ciphers: An allowlist of ciphers for TLS termination. These ciphers must be in the + BoringSSL format. + enabled: Whether to enable public bucket access at the specified custom domain. min_tls: Minimum TLS Version the custom domain will accept for incoming connections. If @@ -499,13 +518,14 @@ async def update( if not domain: raise ValueError(f"Expected a non-empty value for `domain` but received {domain!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._put( f"/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}", body=await async_maybe_transform( { + "ciphers": ciphers, "enabled": enabled, "min_tls": min_tls, }, @@ -526,13 +546,13 @@ async def list( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomListResponse: """ Gets a list of all custom domains registered with an existing R2 bucket. @@ -557,7 +577,7 @@ async def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( @@ -578,13 +598,13 @@ async def delete( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomDeleteResponse: """ Remove custom domain registration from an existing R2 bucket. @@ -613,7 +633,7 @@ async def delete( if not domain: raise ValueError(f"Expected a non-empty value for `domain` but received {domain!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._delete( @@ -634,13 +654,13 @@ async def get( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomGetResponse: """ Get the configuration for a custom domain on an existing R2 bucket. @@ -669,7 +689,7 @@ async def get( if not domain: raise ValueError(f"Expected a non-empty value for `domain` but received {domain!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/domains/managed.py b/src/cloudflare/resources/r2/buckets/domains/managed.py index b338a69c495..393631a44fa 100644 --- a/src/cloudflare/resources/r2/buckets/domains/managed.py +++ b/src/cloudflare/resources/r2/buckets/domains/managed.py @@ -7,7 +7,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -52,13 +52,13 @@ def update( *, account_id: str, enabled: bool, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ManagedUpdateResponse: """ Updates state of public access over the bucket's R2-managed (r2.dev) domain. @@ -85,7 +85,7 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._put( @@ -106,13 +106,13 @@ def list( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ManagedListResponse: """ Gets state of public access over the bucket's R2-managed (r2.dev) domain. @@ -137,7 +137,7 @@ def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -179,13 +179,13 @@ async def update( *, account_id: str, enabled: bool, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ManagedUpdateResponse: """ Updates state of public access over the bucket's R2-managed (r2.dev) domain. @@ -212,7 +212,7 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._put( @@ -233,13 +233,13 @@ async def list( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ManagedListResponse: """ Gets state of public access over the bucket's R2-managed (r2.dev) domain. @@ -264,7 +264,7 @@ async def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/event_notifications.py b/src/cloudflare/resources/r2/buckets/event_notifications.py index e902e7dd094..dae2a99ed1a 100644 --- a/src/cloudflare/resources/r2/buckets/event_notifications.py +++ b/src/cloudflare/resources/r2/buckets/event_notifications.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -52,14 +52,14 @@ def update( *, account_id: str, bucket_name: str, - rules: Iterable[event_notification_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + rules: Iterable[event_notification_update_params.Rule], + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Create event notification rule. @@ -90,7 +90,7 @@ def update( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._put( @@ -111,13 +111,13 @@ def list( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventNotificationListResponse: """ List all event notification rules for a bucket. @@ -142,7 +142,7 @@ def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -163,13 +163,13 @@ def delete( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Delete an event notification rule. @@ -200,7 +200,7 @@ def delete( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._delete( @@ -221,13 +221,13 @@ def get( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventNotificationGetResponse: """ Get a single event notification rule. @@ -256,7 +256,7 @@ def get( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -298,14 +298,14 @@ async def update( *, account_id: str, bucket_name: str, - rules: Iterable[event_notification_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + rules: Iterable[event_notification_update_params.Rule], + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Create event notification rule. @@ -336,7 +336,7 @@ async def update( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._put( @@ -359,13 +359,13 @@ async def list( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventNotificationListResponse: """ List all event notification rules for a bucket. @@ -390,7 +390,7 @@ async def list( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( @@ -411,13 +411,13 @@ async def delete( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Delete an event notification rule. @@ -448,7 +448,7 @@ async def delete( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._delete( @@ -469,13 +469,13 @@ async def get( *, account_id: str, bucket_name: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventNotificationGetResponse: """ Get a single event notification rule. @@ -504,7 +504,7 @@ async def get( if not queue_id: raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/lifecycle.py b/src/cloudflare/resources/r2/buckets/lifecycle.py index af65ae97817..03ec914c78c 100644 --- a/src/cloudflare/resources/r2/buckets/lifecycle.py +++ b/src/cloudflare/resources/r2/buckets/lifecycle.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -50,14 +50,14 @@ def update( bucket_name: str, *, account_id: str, - rules: Iterable[lifecycle_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Set the object lifecycle rules for a bucket. @@ -82,7 +82,7 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._put( @@ -103,13 +103,13 @@ def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LifecycleGetResponse: """ Get object lifecycle rules for a bucket. @@ -134,7 +134,7 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -175,14 +175,14 @@ async def update( bucket_name: str, *, account_id: str, - rules: Iterable[lifecycle_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Set the object lifecycle rules for a bucket. @@ -207,7 +207,7 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._put( @@ -228,13 +228,13 @@ async def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LifecycleGetResponse: """ Get object lifecycle rules for a bucket. @@ -259,7 +259,7 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/locks.py b/src/cloudflare/resources/r2/buckets/locks.py index 294ed30163d..27ddaf78b47 100644 --- a/src/cloudflare/resources/r2/buckets/locks.py +++ b/src/cloudflare/resources/r2/buckets/locks.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -50,14 +50,14 @@ def update( bucket_name: str, *, account_id: str, - rules: Iterable[lock_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Set lock rules for a bucket. @@ -82,7 +82,7 @@ def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._put( @@ -103,13 +103,13 @@ def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LockGetResponse: """ Get lock rules for a bucket. @@ -134,7 +134,7 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -175,14 +175,14 @@ async def update( bucket_name: str, *, account_id: str, - rules: Iterable[lock_update_params.Rule] | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Set lock rules for a bucket. @@ -207,7 +207,7 @@ async def update( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._put( @@ -228,13 +228,13 @@ async def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LockGetResponse: """ Get lock rules for a bucket. @@ -259,7 +259,7 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/metrics.py b/src/cloudflare/resources/r2/buckets/metrics.py index 236cca1158b..3be10e1dea6 100644 --- a/src/cloudflare/resources/r2/buckets/metrics.py +++ b/src/cloudflare/resources/r2/buckets/metrics.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,7 +51,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MetricListResponse: """Get Storage/Object Count Metrics across all buckets in your account. @@ -113,7 +113,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MetricListResponse: """Get Storage/Object Count Metrics across all buckets in your account. diff --git a/src/cloudflare/resources/r2/buckets/sippy.py b/src/cloudflare/resources/r2/buckets/sippy.py index 8513af8f8dd..ea2d5900783 100644 --- a/src/cloudflare/resources/r2/buckets/sippy.py +++ b/src/cloudflare/resources/r2/buckets/sippy.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import is_given, required_args, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -52,15 +52,15 @@ def update( bucket_name: str, *, account_id: str, - destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, - source: sippy_update_params.R2EnableSippyAwsSource | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + destination: sippy_update_params.R2EnableSippyAwsDestination | Omit = omit, + source: sippy_update_params.R2EnableSippyAwsSource | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Sippy: """ Sets configuration for Sippy for an existing R2 bucket. @@ -92,15 +92,15 @@ def update( bucket_name: str, *, account_id: str, - destination: sippy_update_params.R2EnableSippyGcsDestination | NotGiven = NOT_GIVEN, - source: sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + destination: sippy_update_params.R2EnableSippyGcsDestination | Omit = omit, + source: sippy_update_params.R2EnableSippyGcsSource | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Sippy: """ Sets configuration for Sippy for an existing R2 bucket. @@ -132,24 +132,24 @@ def update( bucket_name: str, *, account_id: str, - destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, - source: sippy_update_params.R2EnableSippyAwsSource - | sippy_update_params.R2EnableSippyGcsSource - | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + destination: sippy_update_params.R2EnableSippyAwsDestination + | sippy_update_params.R2EnableSippyGcsDestination + | Omit = omit, + source: sippy_update_params.R2EnableSippyAwsSource | sippy_update_params.R2EnableSippyGcsSource | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Sippy: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._put( @@ -176,13 +176,13 @@ def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SippyDeleteResponse: """ Disables Sippy on this bucket. @@ -207,7 +207,7 @@ def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._delete( @@ -227,13 +227,13 @@ def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Sippy: """ Gets configuration for Sippy for an existing R2 bucket. @@ -258,7 +258,7 @@ def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return self._get( @@ -300,15 +300,15 @@ async def update( bucket_name: str, *, account_id: str, - destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, - source: sippy_update_params.R2EnableSippyAwsSource | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + destination: sippy_update_params.R2EnableSippyAwsDestination | Omit = omit, + source: sippy_update_params.R2EnableSippyAwsSource | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Sippy: """ Sets configuration for Sippy for an existing R2 bucket. @@ -340,15 +340,15 @@ async def update( bucket_name: str, *, account_id: str, - destination: sippy_update_params.R2EnableSippyGcsDestination | NotGiven = NOT_GIVEN, - source: sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + destination: sippy_update_params.R2EnableSippyGcsDestination | Omit = omit, + source: sippy_update_params.R2EnableSippyGcsSource | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Sippy: """ Sets configuration for Sippy for an existing R2 bucket. @@ -380,24 +380,24 @@ async def update( bucket_name: str, *, account_id: str, - destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, - source: sippy_update_params.R2EnableSippyAwsSource - | sippy_update_params.R2EnableSippyGcsSource - | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + destination: sippy_update_params.R2EnableSippyAwsDestination + | sippy_update_params.R2EnableSippyGcsDestination + | Omit = omit, + source: sippy_update_params.R2EnableSippyAwsSource | sippy_update_params.R2EnableSippyGcsSource | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Sippy: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._put( @@ -424,13 +424,13 @@ async def delete( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SippyDeleteResponse: """ Disables Sippy on this bucket. @@ -455,7 +455,7 @@ async def delete( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._delete( @@ -475,13 +475,13 @@ async def get( bucket_name: str, *, account_id: str, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Sippy: """ Gets configuration for Sippy for an existing R2 bucket. @@ -506,7 +506,7 @@ async def get( if not bucket_name: raise ValueError(f"Expected a non-empty value for `bucket_name` but received {bucket_name!r}") extra_headers = { - **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else NOT_GIVEN}), + **strip_not_given({"cf-r2-jurisdiction": str(jurisdiction) if is_given(jurisdiction) else not_given}), **(extra_headers or {}), } return await self._get( diff --git a/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py b/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py index 21dcceef54f..2ea1083ea6f 100644 --- a/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py +++ b/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,16 +53,18 @@ def source( self, *, account_id: str, - bucket: str | NotGiven = NOT_GIVEN, - endpoint: Optional[str] | NotGiven = NOT_GIVEN, - secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret | NotGiven = NOT_GIVEN, - vendor: Literal["s3"] | NotGiven = NOT_GIVEN, + bucket: str, + secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret, + vendor: Literal["s3"], + endpoint: Optional[str] | Omit = omit, + path_prefix: Optional[str] | Omit = omit, + region: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckSourceResponse]: """ Check whether tokens are valid against the source bucket @@ -83,15 +85,16 @@ def source( self, *, account_id: str, - bucket: str | NotGiven = NOT_GIVEN, - secret: connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret | NotGiven = NOT_GIVEN, - vendor: Literal["gcs"] | NotGiven = NOT_GIVEN, + bucket: str, + secret: connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret, + vendor: Literal["gcs"], + path_prefix: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckSourceResponse]: """ Check whether tokens are valid against the source bucket @@ -112,16 +115,17 @@ def source( self, *, account_id: str, - bucket: str | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, - secret: connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret | NotGiven = NOT_GIVEN, - vendor: Provider | NotGiven = NOT_GIVEN, + bucket: str, + secret: connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret, + vendor: Provider, + jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, + path_prefix: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckSourceResponse]: """ Check whether tokens are valid against the source bucket @@ -137,24 +141,26 @@ def source( """ ... - @required_args(["account_id"]) + @required_args(["account_id", "bucket", "secret", "vendor"]) def source( self, *, account_id: str, - bucket: str | NotGiven = NOT_GIVEN, - endpoint: Optional[str] | NotGiven = NOT_GIVEN, + bucket: str, secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret | connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret - | NotGiven = NOT_GIVEN, - vendor: Literal["s3"] | Literal["gcs"] | Provider | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + | connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret, + vendor: Literal["s3"] | Literal["gcs"] | Provider, + endpoint: Optional[str] | Omit = omit, + path_prefix: Optional[str] | Omit = omit, + region: Optional[str] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckSourceResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -163,9 +169,11 @@ def source( body=maybe_transform( { "bucket": bucket, - "endpoint": endpoint, "secret": secret, "vendor": vendor, + "endpoint": endpoint, + "path_prefix": path_prefix, + "region": region, "jurisdiction": jurisdiction, }, connectivity_precheck_source_params.ConnectivityPrecheckSourceParams, @@ -186,16 +194,16 @@ def target( self, *, account_id: str, - bucket: str | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, - secret: connectivity_precheck_target_params.Secret | NotGiven = NOT_GIVEN, - vendor: Provider | NotGiven = NOT_GIVEN, + bucket: str, + secret: connectivity_precheck_target_params.Secret, + vendor: Provider, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckTargetResponse]: """ Check whether tokens are valid against the target bucket @@ -216,9 +224,9 @@ def target( body=maybe_transform( { "bucket": bucket, - "jurisdiction": jurisdiction, "secret": secret, "vendor": vendor, + "jurisdiction": jurisdiction, }, connectivity_precheck_target_params.ConnectivityPrecheckTargetParams, ), @@ -260,16 +268,18 @@ async def source( self, *, account_id: str, - bucket: str | NotGiven = NOT_GIVEN, - endpoint: Optional[str] | NotGiven = NOT_GIVEN, - secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret | NotGiven = NOT_GIVEN, - vendor: Literal["s3"] | NotGiven = NOT_GIVEN, + bucket: str, + secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret, + vendor: Literal["s3"], + endpoint: Optional[str] | Omit = omit, + path_prefix: Optional[str] | Omit = omit, + region: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckSourceResponse]: """ Check whether tokens are valid against the source bucket @@ -290,15 +300,16 @@ async def source( self, *, account_id: str, - bucket: str | NotGiven = NOT_GIVEN, - secret: connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret | NotGiven = NOT_GIVEN, - vendor: Literal["gcs"] | NotGiven = NOT_GIVEN, + bucket: str, + secret: connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret, + vendor: Literal["gcs"], + path_prefix: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckSourceResponse]: """ Check whether tokens are valid against the source bucket @@ -319,16 +330,17 @@ async def source( self, *, account_id: str, - bucket: str | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, - secret: connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret | NotGiven = NOT_GIVEN, - vendor: Provider | NotGiven = NOT_GIVEN, + bucket: str, + secret: connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret, + vendor: Provider, + jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, + path_prefix: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckSourceResponse]: """ Check whether tokens are valid against the source bucket @@ -344,24 +356,26 @@ async def source( """ ... - @required_args(["account_id"]) + @required_args(["account_id", "bucket", "secret", "vendor"]) async def source( self, *, account_id: str, - bucket: str | NotGiven = NOT_GIVEN, - endpoint: Optional[str] | NotGiven = NOT_GIVEN, + bucket: str, secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret | connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret - | NotGiven = NOT_GIVEN, - vendor: Literal["s3"] | Literal["gcs"] | Provider | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, + | connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret, + vendor: Literal["s3"] | Literal["gcs"] | Provider, + endpoint: Optional[str] | Omit = omit, + path_prefix: Optional[str] | Omit = omit, + region: Optional[str] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckSourceResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -370,9 +384,11 @@ async def source( body=await async_maybe_transform( { "bucket": bucket, - "endpoint": endpoint, "secret": secret, "vendor": vendor, + "endpoint": endpoint, + "path_prefix": path_prefix, + "region": region, "jurisdiction": jurisdiction, }, connectivity_precheck_source_params.ConnectivityPrecheckSourceParams, @@ -393,16 +409,16 @@ async def target( self, *, account_id: str, - bucket: str | NotGiven = NOT_GIVEN, - jurisdiction: Literal["default", "eu", "fedramp"] | NotGiven = NOT_GIVEN, - secret: connectivity_precheck_target_params.Secret | NotGiven = NOT_GIVEN, - vendor: Provider | NotGiven = NOT_GIVEN, + bucket: str, + secret: connectivity_precheck_target_params.Secret, + vendor: Provider, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckTargetResponse]: """ Check whether tokens are valid against the target bucket @@ -423,9 +439,9 @@ async def target( body=await async_maybe_transform( { "bucket": bucket, - "jurisdiction": jurisdiction, "secret": secret, "vendor": vendor, + "jurisdiction": jurisdiction, }, connectivity_precheck_target_params.ConnectivityPrecheckTargetParams, ), diff --git a/src/cloudflare/resources/r2/super_slurper/jobs/jobs.py b/src/cloudflare/resources/r2/super_slurper/jobs/jobs.py index d042956ecbc..f4911bfb249 100644 --- a/src/cloudflare/resources/r2/super_slurper/jobs/jobs.py +++ b/src/cloudflare/resources/r2/super_slurper/jobs/jobs.py @@ -14,7 +14,7 @@ LogsResourceWithStreamingResponse, AsyncLogsResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -68,15 +68,15 @@ def create( self, *, account_id: str, - overwrite: bool | NotGiven = NOT_GIVEN, - source: job_create_params.Source | NotGiven = NOT_GIVEN, - target: job_create_params.Target | NotGiven = NOT_GIVEN, + overwrite: bool | Omit = omit, + source: job_create_params.Source | Omit = omit, + target: job_create_params.Target | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[JobCreateResponse]: """ Create a job @@ -116,14 +116,14 @@ def list( self, *, account_id: str, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[JobListResponse]: """ List jobs @@ -168,7 +168,7 @@ def abort( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Abort a job @@ -207,7 +207,7 @@ def abort_all( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Abort all jobs @@ -245,7 +245,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[JobGetResponse]: """ Get job details @@ -285,7 +285,7 @@ def pause( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Pause a job @@ -325,7 +325,7 @@ def progress( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[JobProgressResponse]: """ Get job progress @@ -365,7 +365,7 @@ def resume( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Resume a job @@ -424,15 +424,15 @@ async def create( self, *, account_id: str, - overwrite: bool | NotGiven = NOT_GIVEN, - source: job_create_params.Source | NotGiven = NOT_GIVEN, - target: job_create_params.Target | NotGiven = NOT_GIVEN, + overwrite: bool | Omit = omit, + source: job_create_params.Source | Omit = omit, + target: job_create_params.Target | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[JobCreateResponse]: """ Create a job @@ -472,14 +472,14 @@ def list( self, *, account_id: str, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[JobListResponse, AsyncSinglePage[JobListResponse]]: """ List jobs @@ -524,7 +524,7 @@ async def abort( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Abort a job @@ -563,7 +563,7 @@ async def abort_all( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Abort all jobs @@ -601,7 +601,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[JobGetResponse]: """ Get job details @@ -641,7 +641,7 @@ async def pause( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Pause a job @@ -681,7 +681,7 @@ async def progress( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[JobProgressResponse]: """ Get job progress @@ -721,7 +721,7 @@ async def resume( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Resume a job diff --git a/src/cloudflare/resources/r2/super_slurper/jobs/logs.py b/src/cloudflare/resources/r2/super_slurper/jobs/logs.py index bb8d0886aa5..8204cbf5ab7 100644 --- a/src/cloudflare/resources/r2/super_slurper/jobs/logs.py +++ b/src/cloudflare/resources/r2/super_slurper/jobs/logs.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -47,14 +47,14 @@ def list( job_id: str, *, account_id: str, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[LogListResponse]: """ Get job logs @@ -117,14 +117,14 @@ def list( job_id: str, *, account_id: str, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[LogListResponse, AsyncSinglePage[LogListResponse]]: """ Get job logs diff --git a/src/cloudflare/resources/r2/temporary_credentials.py b/src/cloudflare/resources/r2/temporary_credentials.py index 95251e751d9..da82f727df8 100644 --- a/src/cloudflare/resources/r2/temporary_credentials.py +++ b/src/cloudflare/resources/r2/temporary_credentials.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import Type, cast from typing_extensions import Literal import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 ...types.r2 import temporary_credential_create_params @@ -53,14 +53,14 @@ def create( parent_access_key_id: str, permission: Literal["admin-read-write", "admin-read-only", "object-read-write", "object-read-only"], ttl_seconds: float, - objects: List[str] | NotGiven = NOT_GIVEN, - prefixes: List[str] | NotGiven = NOT_GIVEN, + objects: SequenceNotStr[str] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TemporaryCredentialCreateResponse: """ Creates temporary access credentials on a bucket that can be optionally scoped @@ -143,14 +143,14 @@ async def create( parent_access_key_id: str, permission: Literal["admin-read-write", "admin-read-only", "object-read-write", "object-read-only"], ttl_seconds: float, - objects: List[str] | NotGiven = NOT_GIVEN, - prefixes: List[str] | NotGiven = NOT_GIVEN, + objects: SequenceNotStr[str] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TemporaryCredentialCreateResponse: """ Creates temporary access credentials on a bucket that can be optionally scoped diff --git a/src/cloudflare/resources/radar/__init__.py b/src/cloudflare/resources/radar/__init__.py index 7be87145a2c..63b6d743345 100644 --- a/src/cloudflare/resources/radar/__init__.py +++ b/src/cloudflare/resources/radar/__init__.py @@ -8,6 +8,14 @@ AIResourceWithStreamingResponse, AsyncAIResourceWithStreamingResponse, ) +from .ct import ( + CtResource, + AsyncCtResource, + CtResourceWithRawResponse, + AsyncCtResourceWithRawResponse, + CtResourceWithStreamingResponse, + AsyncCtResourceWithStreamingResponse, +) from .bgp import ( BGPResource, AsyncBGPResource, @@ -24,6 +32,14 @@ DNSResourceWithStreamingResponse, AsyncDNSResourceWithStreamingResponse, ) +from .bots import ( + BotsResource, + AsyncBotsResource, + BotsResourceWithRawResponse, + AsyncBotsResourceWithRawResponse, + BotsResourceWithStreamingResponse, + AsyncBotsResourceWithStreamingResponse, +) from .http import ( HTTPResource, AsyncHTTPResource, @@ -128,6 +144,14 @@ AnnotationsResourceWithStreamingResponse, AsyncAnnotationsResourceWithStreamingResponse, ) +from .geolocations import ( + GeolocationsResource, + AsyncGeolocationsResource, + GeolocationsResourceWithRawResponse, + AsyncGeolocationsResourceWithRawResponse, + GeolocationsResourceWithStreamingResponse, + AsyncGeolocationsResourceWithStreamingResponse, +) from .verified_bots import ( VerifiedBotsResource, AsyncVerifiedBotsResource, @@ -168,6 +192,12 @@ "AsyncAIResourceWithRawResponse", "AIResourceWithStreamingResponse", "AsyncAIResourceWithStreamingResponse", + "CtResource", + "AsyncCtResource", + "CtResourceWithRawResponse", + "AsyncCtResourceWithRawResponse", + "CtResourceWithStreamingResponse", + "AsyncCtResourceWithStreamingResponse", "AnnotationsResource", "AsyncAnnotationsResource", "AnnotationsResourceWithRawResponse", @@ -180,6 +210,12 @@ "AsyncBGPResourceWithRawResponse", "BGPResourceWithStreamingResponse", "AsyncBGPResourceWithStreamingResponse", + "BotsResource", + "AsyncBotsResource", + "BotsResourceWithRawResponse", + "AsyncBotsResourceWithRawResponse", + "BotsResourceWithStreamingResponse", + "AsyncBotsResourceWithStreamingResponse", "DatasetsResource", "AsyncDatasetsResource", "DatasetsResourceWithRawResponse", @@ -234,6 +270,12 @@ "AsyncEntitiesResourceWithRawResponse", "EntitiesResourceWithStreamingResponse", "AsyncEntitiesResourceWithStreamingResponse", + "GeolocationsResource", + "AsyncGeolocationsResource", + "GeolocationsResourceWithRawResponse", + "AsyncGeolocationsResourceWithRawResponse", + "GeolocationsResourceWithStreamingResponse", + "AsyncGeolocationsResourceWithStreamingResponse", "HTTPResource", "AsyncHTTPResource", "HTTPResourceWithRawResponse", diff --git a/src/cloudflare/resources/radar/ai/bots/bots.py b/src/cloudflare/resources/radar/ai/bots/bots.py index 4f0e47f607f..71be23206f2 100644 --- a/src/cloudflare/resources/radar/ai/bots/bots.py +++ b/src/cloudflare/resources/radar/ai/bots/bots.py @@ -2,6 +2,12 @@ from __future__ import annotations +from typing import Type, Union, cast +from datetime import datetime +from typing_extensions import Literal + +import httpx + from .summary import ( SummaryResource, AsyncSummaryResource, @@ -10,8 +16,22 @@ SummaryResourceWithStreamingResponse, AsyncSummaryResourceWithStreamingResponse, ) +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.radar.ai import bot_summary_v2_params, bot_timeseries_params, bot_timeseries_groups_params +from .....types.radar.ai.bot_summary_v2_response import BotSummaryV2Response +from .....types.radar.ai.bot_timeseries_response import BotTimeseriesResponse +from .....types.radar.ai.bot_timeseries_groups_response import BotTimeseriesGroupsResponse __all__ = ["BotsResource", "AsyncBotsResource"] @@ -40,6 +60,333 @@ def with_streaming_response(self) -> BotsResourceWithStreamingResponse: """ return BotsResourceWithStreamingResponse(self) + def summary_v2( + self, + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> BotSummaryV2Response: + """ + Retrieves an aggregated summary of AI bots HTTP requests grouped by the + specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/ai/bots/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "vertical": vertical, + }, + bot_summary_v2_params.BotSummaryV2Params, + ), + post_parser=ResultWrapper[BotSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[BotSummaryV2Response], ResultWrapper[BotSummaryV2Response]), + ) + + def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> BotTimeseriesResponse: + """ + Retrieves AI bots HTTP request volume over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + user_agent: Filters results by user agent. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/ai/bots/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "user_agent": user_agent, + "vertical": vertical, + }, + bot_timeseries_params.BotTimeseriesParams, + ), + post_parser=ResultWrapper[BotTimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[BotTimeseriesResponse], ResultWrapper[BotTimeseriesResponse]), + ) + + def timeseries_groups( + self, + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + vertical: 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, + ) -> BotTimeseriesGroupsResponse: + """ + Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/ai/bots/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + "vertical": vertical, + }, + bot_timeseries_groups_params.BotTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[BotTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[BotTimeseriesGroupsResponse], ResultWrapper[BotTimeseriesGroupsResponse]), + ) + class AsyncBotsResource(AsyncAPIResource): @cached_property @@ -65,11 +412,348 @@ def with_streaming_response(self) -> AsyncBotsResourceWithStreamingResponse: """ return AsyncBotsResourceWithStreamingResponse(self) + async def summary_v2( + self, + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> BotSummaryV2Response: + """ + Retrieves an aggregated summary of AI bots HTTP requests grouped by the + specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/ai/bots/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "vertical": vertical, + }, + bot_summary_v2_params.BotSummaryV2Params, + ), + post_parser=ResultWrapper[BotSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[BotSummaryV2Response], ResultWrapper[BotSummaryV2Response]), + ) + + async def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> BotTimeseriesResponse: + """ + Retrieves AI bots HTTP request volume over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + user_agent: Filters results by user agent. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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._get( + "/radar/ai/bots/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "user_agent": user_agent, + "vertical": vertical, + }, + bot_timeseries_params.BotTimeseriesParams, + ), + post_parser=ResultWrapper[BotTimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[BotTimeseriesResponse], ResultWrapper[BotTimeseriesResponse]), + ) + + async def timeseries_groups( + self, + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + vertical: 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, + ) -> BotTimeseriesGroupsResponse: + """ + Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/ai/bots/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + "vertical": vertical, + }, + bot_timeseries_groups_params.BotTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[BotTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[BotTimeseriesGroupsResponse], ResultWrapper[BotTimeseriesGroupsResponse]), + ) + class BotsResourceWithRawResponse: def __init__(self, bots: BotsResource) -> None: self._bots = bots + self.summary_v2 = to_raw_response_wrapper( + bots.summary_v2, + ) + self.timeseries = to_raw_response_wrapper( + bots.timeseries, + ) + self.timeseries_groups = to_raw_response_wrapper( + bots.timeseries_groups, + ) + @cached_property def summary(self) -> SummaryResourceWithRawResponse: return SummaryResourceWithRawResponse(self._bots.summary) @@ -79,6 +763,16 @@ class AsyncBotsResourceWithRawResponse: def __init__(self, bots: AsyncBotsResource) -> None: self._bots = bots + self.summary_v2 = async_to_raw_response_wrapper( + bots.summary_v2, + ) + self.timeseries = async_to_raw_response_wrapper( + bots.timeseries, + ) + self.timeseries_groups = async_to_raw_response_wrapper( + bots.timeseries_groups, + ) + @cached_property def summary(self) -> AsyncSummaryResourceWithRawResponse: return AsyncSummaryResourceWithRawResponse(self._bots.summary) @@ -88,6 +782,16 @@ class BotsResourceWithStreamingResponse: def __init__(self, bots: BotsResource) -> None: self._bots = bots + self.summary_v2 = to_streamed_response_wrapper( + bots.summary_v2, + ) + self.timeseries = to_streamed_response_wrapper( + bots.timeseries, + ) + self.timeseries_groups = to_streamed_response_wrapper( + bots.timeseries_groups, + ) + @cached_property def summary(self) -> SummaryResourceWithStreamingResponse: return SummaryResourceWithStreamingResponse(self._bots.summary) @@ -97,6 +801,16 @@ class AsyncBotsResourceWithStreamingResponse: def __init__(self, bots: AsyncBotsResource) -> None: self._bots = bots + self.summary_v2 = async_to_streamed_response_wrapper( + bots.summary_v2, + ) + self.timeseries = async_to_streamed_response_wrapper( + bots.timeseries, + ) + self.timeseries_groups = async_to_streamed_response_wrapper( + bots.timeseries_groups, + ) + @cached_property def summary(self) -> AsyncSummaryResourceWithStreamingResponse: return AsyncSummaryResourceWithStreamingResponse(self._bots.summary) diff --git a/src/cloudflare/resources/radar/ai/bots/summary.py b/src/cloudflare/resources/radar/ai/bots/summary.py index ff3cb7c72c3..42de5e2d929 100644 --- a/src/cloudflare/resources/radar/ai/bots/summary.py +++ b/src/cloudflare/resources/radar/ai/bots/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List, Type, Union, cast +import typing_extensions +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -46,24 +47,27 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar AI Bots Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead." + ) def user_agent( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryUserAgentResponse: """ Retrieves the distribution of traffic by AI user agent. @@ -153,24 +157,27 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar AI Bots Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead." + ) async def user_agent( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryUserAgentResponse: """ Retrieves the distribution of traffic by AI user agent. @@ -244,8 +251,10 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.user_agent = to_raw_response_wrapper( - summary.user_agent, + self.user_agent = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.user_agent, # pyright: ignore[reportDeprecated], + ) ) @@ -253,8 +262,10 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.user_agent = async_to_raw_response_wrapper( - summary.user_agent, + self.user_agent = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.user_agent, # pyright: ignore[reportDeprecated], + ) ) @@ -262,8 +273,10 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.user_agent = to_streamed_response_wrapper( - summary.user_agent, + self.user_agent = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.user_agent, # pyright: ignore[reportDeprecated], + ) ) @@ -271,6 +284,8 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.user_agent = async_to_streamed_response_wrapper( - summary.user_agent, + self.user_agent = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.user_agent, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/ai/inference/inference.py b/src/cloudflare/resources/radar/ai/inference/inference.py index d72b4cc21cd..8a3e3da863e 100644 --- a/src/cloudflare/resources/radar/ai/inference/inference.py +++ b/src/cloudflare/resources/radar/ai/inference/inference.py @@ -2,6 +2,12 @@ from __future__ import annotations +from typing import Type, Union, cast +from datetime import datetime +from typing_extensions import Literal + +import httpx + from .summary import ( SummaryResource, AsyncSummaryResource, @@ -10,8 +16,19 @@ SummaryResourceWithStreamingResponse, AsyncSummaryResourceWithStreamingResponse, ) +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.radar.ai import inference_summary_v2_params, inference_timeseries_groups_v2_params from .timeseries_groups.timeseries_groups import ( TimeseriesGroupsResource, AsyncTimeseriesGroupsResource, @@ -20,6 +37,8 @@ TimeseriesGroupsResourceWithStreamingResponse, AsyncTimeseriesGroupsResourceWithStreamingResponse, ) +from .....types.radar.ai.inference_summary_v2_response import InferenceSummaryV2Response +from .....types.radar.ai.inference_timeseries_groups_v2_response import InferenceTimeseriesGroupsV2Response __all__ = ["InferenceResource", "AsyncInferenceResource"] @@ -52,6 +71,201 @@ def with_streaming_response(self) -> InferenceResourceWithStreamingResponse: """ return InferenceResourceWithStreamingResponse(self) + def summary_v2( + self, + dimension: Literal["MODEL", "TASK"], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + ) -> InferenceSummaryV2Response: + """ + Retrieves an aggregated summary of unique accounts using Workers AI inference + grouped by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/ai/inference/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + }, + inference_summary_v2_params.InferenceSummaryV2Params, + ), + post_parser=ResultWrapper[InferenceSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[InferenceSummaryV2Response], ResultWrapper[InferenceSummaryV2Response]), + ) + + def timeseries_groups_v2( + self, + dimension: Literal["MODEL", "TASK"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> InferenceTimeseriesGroupsV2Response: + """ + Retrieves the distribution of unique accounts using Workers AI inference, + grouped by the specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/ai/inference/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + }, + inference_timeseries_groups_v2_params.InferenceTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[InferenceTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[InferenceTimeseriesGroupsV2Response], ResultWrapper[InferenceTimeseriesGroupsV2Response]), + ) + class AsyncInferenceResource(AsyncAPIResource): @cached_property @@ -81,11 +295,213 @@ def with_streaming_response(self) -> AsyncInferenceResourceWithStreamingResponse """ return AsyncInferenceResourceWithStreamingResponse(self) + async def summary_v2( + self, + dimension: Literal["MODEL", "TASK"], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + ) -> InferenceSummaryV2Response: + """ + Retrieves an aggregated summary of unique accounts using Workers AI inference + grouped by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/ai/inference/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + }, + inference_summary_v2_params.InferenceSummaryV2Params, + ), + post_parser=ResultWrapper[InferenceSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[InferenceSummaryV2Response], ResultWrapper[InferenceSummaryV2Response]), + ) + + async def timeseries_groups_v2( + self, + dimension: Literal["MODEL", "TASK"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> InferenceTimeseriesGroupsV2Response: + """ + Retrieves the distribution of unique accounts using Workers AI inference, + grouped by the specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/ai/inference/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + }, + inference_timeseries_groups_v2_params.InferenceTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[InferenceTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[InferenceTimeseriesGroupsV2Response], ResultWrapper[InferenceTimeseriesGroupsV2Response]), + ) + class InferenceResourceWithRawResponse: def __init__(self, inference: InferenceResource) -> None: self._inference = inference + self.summary_v2 = to_raw_response_wrapper( + inference.summary_v2, + ) + self.timeseries_groups_v2 = to_raw_response_wrapper( + inference.timeseries_groups_v2, + ) + @cached_property def summary(self) -> SummaryResourceWithRawResponse: return SummaryResourceWithRawResponse(self._inference.summary) @@ -99,6 +515,13 @@ class AsyncInferenceResourceWithRawResponse: def __init__(self, inference: AsyncInferenceResource) -> None: self._inference = inference + self.summary_v2 = async_to_raw_response_wrapper( + inference.summary_v2, + ) + self.timeseries_groups_v2 = async_to_raw_response_wrapper( + inference.timeseries_groups_v2, + ) + @cached_property def summary(self) -> AsyncSummaryResourceWithRawResponse: return AsyncSummaryResourceWithRawResponse(self._inference.summary) @@ -112,6 +535,13 @@ class InferenceResourceWithStreamingResponse: def __init__(self, inference: InferenceResource) -> None: self._inference = inference + self.summary_v2 = to_streamed_response_wrapper( + inference.summary_v2, + ) + self.timeseries_groups_v2 = to_streamed_response_wrapper( + inference.timeseries_groups_v2, + ) + @cached_property def summary(self) -> SummaryResourceWithStreamingResponse: return SummaryResourceWithStreamingResponse(self._inference.summary) @@ -125,6 +555,13 @@ class AsyncInferenceResourceWithStreamingResponse: def __init__(self, inference: AsyncInferenceResource) -> None: self._inference = inference + self.summary_v2 = async_to_streamed_response_wrapper( + inference.summary_v2, + ) + self.timeseries_groups_v2 = async_to_streamed_response_wrapper( + inference.timeseries_groups_v2, + ) + @cached_property def summary(self) -> AsyncSummaryResourceWithStreamingResponse: return AsyncSummaryResourceWithStreamingResponse(self._inference.summary) diff --git a/src/cloudflare/resources/radar/ai/inference/summary.py b/src/cloudflare/resources/radar/ai/inference/summary.py index 54ee8ee8424..713876a908e 100644 --- a/src/cloudflare/resources/radar/ai/inference/summary.py +++ b/src/cloudflare/resources/radar/ai/inference/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List, Type, Union, cast +import typing_extensions +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -47,21 +48,24 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead." + ) def model( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryModelResponse: """ Retrieves the distribution of unique accounts by model. @@ -114,21 +118,24 @@ def model( cast_to=cast(Type[SummaryModelResponse], ResultWrapper[SummaryModelResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead." + ) def task( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryTaskResponse: """ Retrieves the distribution of unique accounts by task. @@ -202,21 +209,24 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead." + ) async def model( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryModelResponse: """ Retrieves the distribution of unique accounts by model. @@ -269,21 +279,24 @@ async def model( cast_to=cast(Type[SummaryModelResponse], ResultWrapper[SummaryModelResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AI Inference Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/summary_v2/) instead." + ) async def task( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryTaskResponse: """ Retrieves the distribution of unique accounts by task. @@ -341,11 +354,15 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.model = to_raw_response_wrapper( - summary.model, + self.model = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.model, # pyright: ignore[reportDeprecated], + ) ) - self.task = to_raw_response_wrapper( - summary.task, + self.task = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.task, # pyright: ignore[reportDeprecated], + ) ) @@ -353,11 +370,15 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.model = async_to_raw_response_wrapper( - summary.model, + self.model = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.model, # pyright: ignore[reportDeprecated], + ) ) - self.task = async_to_raw_response_wrapper( - summary.task, + self.task = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.task, # pyright: ignore[reportDeprecated], + ) ) @@ -365,11 +386,15 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.model = to_streamed_response_wrapper( - summary.model, + self.model = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.model, # pyright: ignore[reportDeprecated], + ) ) - self.task = to_streamed_response_wrapper( - summary.task, + self.task = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.task, # pyright: ignore[reportDeprecated], + ) ) @@ -377,9 +402,13 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.model = async_to_streamed_response_wrapper( - summary.model, + self.model = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.model, # pyright: ignore[reportDeprecated], + ) ) - self.task = async_to_streamed_response_wrapper( - summary.task, + self.task = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.task, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py index 4ea1a0856c6..3b660d9edb4 100644 --- a/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py +++ b/src/cloudflare/resources/radar/ai/inference/timeseries_groups/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List, Type, Union, cast +import typing_extensions +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -47,22 +48,25 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead." + ) def model( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryModelResponse: """ Retrieves the distribution of unique accounts by model over time. @@ -120,22 +124,25 @@ def model( cast_to=cast(Type[SummaryModelResponse], ResultWrapper[SummaryModelResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead." + ) def task( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryTaskResponse: """ Retrieves the distribution of unique accounts by task over time. @@ -214,22 +221,25 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead." + ) async def model( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryModelResponse: """ Retrieves the distribution of unique accounts by model over time. @@ -287,22 +297,25 @@ async def model( cast_to=cast(Type[SummaryModelResponse], ResultWrapper[SummaryModelResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AI Inference Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/inference/methods/timeseries_groups_v2/) instead." + ) async def task( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryTaskResponse: """ Retrieves the distribution of unique accounts by task over time. @@ -365,11 +378,15 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.model = to_raw_response_wrapper( - summary.model, + self.model = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.model, # pyright: ignore[reportDeprecated], + ) ) - self.task = to_raw_response_wrapper( - summary.task, + self.task = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.task, # pyright: ignore[reportDeprecated], + ) ) @@ -377,11 +394,15 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.model = async_to_raw_response_wrapper( - summary.model, + self.model = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.model, # pyright: ignore[reportDeprecated], + ) ) - self.task = async_to_raw_response_wrapper( - summary.task, + self.task = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.task, # pyright: ignore[reportDeprecated], + ) ) @@ -389,11 +410,15 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.model = to_streamed_response_wrapper( - summary.model, + self.model = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.model, # pyright: ignore[reportDeprecated], + ) ) - self.task = to_streamed_response_wrapper( - summary.task, + self.task = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.task, # pyright: ignore[reportDeprecated], + ) ) @@ -401,9 +426,13 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.model = async_to_streamed_response_wrapper( - summary.model, + self.model = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.model, # pyright: ignore[reportDeprecated], + ) ) - self.task = async_to_streamed_response_wrapper( - summary.task, + self.task = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.task, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/ai/timeseries_groups.py b/src/cloudflare/resources/radar/ai/timeseries_groups.py index 33af8075220..b956cf33749 100644 --- a/src/cloudflare/resources/radar/ai/timeseries_groups.py +++ b/src/cloudflare/resources/radar/ai/timeseries_groups.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List, Type, Union, cast +import typing_extensions +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -20,8 +21,16 @@ ) from ...._wrappers import ResultWrapper from ...._base_client import make_request_options -from ....types.radar.ai import timeseries_group_user_agent_params +from ....types.radar.ai import ( + timeseries_group_summary_params, + timeseries_group_timeseries_params, + timeseries_group_user_agent_params, + timeseries_group_timeseries_groups_params, +) +from ....types.radar.ai.timeseries_group_summary_response import TimeseriesGroupSummaryResponse +from ....types.radar.ai.timeseries_group_timeseries_response import TimeseriesGroupTimeseriesResponse from ....types.radar.ai.timeseries_group_user_agent_response import TimeseriesGroupUserAgentResponse +from ....types.radar.ai.timeseries_group_timeseries_groups_response import TimeseriesGroupTimeseriesGroupsResponse __all__ = ["TimeseriesGroupsResource", "AsyncTimeseriesGroupsResource"] @@ -46,25 +55,366 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon """ return TimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar > AI > Bots > Summary](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead." + ) + def summary( + self, + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> TimeseriesGroupSummaryResponse: + """ + Retrieves an aggregated summary of AI bots HTTP requests grouped by the + specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/ai/bots/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "vertical": vertical, + }, + timeseries_group_summary_params.TimeseriesGroupSummaryParams, + ), + post_parser=ResultWrapper[TimeseriesGroupSummaryResponse]._unwrapper, + ), + cast_to=cast(Type[TimeseriesGroupSummaryResponse], ResultWrapper[TimeseriesGroupSummaryResponse]), + ) + + @typing_extensions.deprecated( + "Use [Radar > AI > Bots > Timeseries](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries/) instead." + ) + def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> TimeseriesGroupTimeseriesResponse: + """ + Retrieves AI bots HTTP request volume over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + user_agent: Filters results by user agent. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/ai/bots/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "user_agent": user_agent, + "vertical": vertical, + }, + timeseries_group_timeseries_params.TimeseriesGroupTimeseriesParams, + ), + post_parser=ResultWrapper[TimeseriesGroupTimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[TimeseriesGroupTimeseriesResponse], ResultWrapper[TimeseriesGroupTimeseriesResponse]), + ) + + @typing_extensions.deprecated( + "Use [Radar > AI > Bots > Timeseries Groups](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead." + ) + def timeseries_groups( + self, + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + vertical: 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, + ) -> TimeseriesGroupTimeseriesGroupsResponse: + """ + Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/ai/bots/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + "vertical": vertical, + }, + timeseries_group_timeseries_groups_params.TimeseriesGroupTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[TimeseriesGroupTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast( + Type[TimeseriesGroupTimeseriesGroupsResponse], ResultWrapper[TimeseriesGroupTimeseriesGroupsResponse] + ), + ) + + @typing_extensions.deprecated( + "Use [Radar AI Bots Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead." + ) def user_agent( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupUserAgentResponse: """ Retrieves the distribution of traffic by AI user agent over time. @@ -159,25 +509,366 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR """ return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar > AI > Bots > Summary](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/summary_v2/) instead." + ) + async def summary( + self, + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> TimeseriesGroupSummaryResponse: + """ + Retrieves an aggregated summary of AI bots HTTP requests grouped by the + specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/ai/bots/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "vertical": vertical, + }, + timeseries_group_summary_params.TimeseriesGroupSummaryParams, + ), + post_parser=ResultWrapper[TimeseriesGroupSummaryResponse]._unwrapper, + ), + cast_to=cast(Type[TimeseriesGroupSummaryResponse], ResultWrapper[TimeseriesGroupSummaryResponse]), + ) + + @typing_extensions.deprecated( + "Use [Radar > AI > Bots > Timeseries](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries/) instead." + ) + async def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> TimeseriesGroupTimeseriesResponse: + """ + Retrieves AI bots HTTP request volume over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + user_agent: Filters results by user agent. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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._get( + "/radar/ai/bots/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "user_agent": user_agent, + "vertical": vertical, + }, + timeseries_group_timeseries_params.TimeseriesGroupTimeseriesParams, + ), + post_parser=ResultWrapper[TimeseriesGroupTimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[TimeseriesGroupTimeseriesResponse], ResultWrapper[TimeseriesGroupTimeseriesResponse]), + ) + + @typing_extensions.deprecated( + "Use [Radar > AI > Bots > Timeseries Groups](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead." + ) + async def timeseries_groups( + self, + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + crawl_purpose: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + vertical: 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, + ) -> TimeseriesGroupTimeseriesGroupsResponse: + """ + Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + crawl_purpose: Filters results by bot crawl purpose. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/ai/bots/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "crawl_purpose": crawl_purpose, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + "vertical": vertical, + }, + timeseries_group_timeseries_groups_params.TimeseriesGroupTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[TimeseriesGroupTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast( + Type[TimeseriesGroupTimeseriesGroupsResponse], ResultWrapper[TimeseriesGroupTimeseriesGroupsResponse] + ), + ) + + @typing_extensions.deprecated( + "Use [Radar AI Bots Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/ai/subresources/bots/methods/timeseries_groups/) instead." + ) async def user_agent( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupUserAgentResponse: """ Retrieves the distribution of traffic by AI user agent over time. @@ -256,8 +947,25 @@ class TimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.user_agent = to_raw_response_wrapper( - timeseries_groups.user_agent, + self.summary = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.summary, # pyright: ignore[reportDeprecated], + ) + ) + self.timeseries = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.timeseries, # pyright: ignore[reportDeprecated], + ) + ) + self.timeseries_groups = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.timeseries_groups, # pyright: ignore[reportDeprecated], + ) + ) + self.user_agent = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.user_agent, # pyright: ignore[reportDeprecated], + ) ) @@ -265,8 +973,25 @@ class AsyncTimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.user_agent = async_to_raw_response_wrapper( - timeseries_groups.user_agent, + self.summary = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.summary, # pyright: ignore[reportDeprecated], + ) + ) + self.timeseries = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.timeseries, # pyright: ignore[reportDeprecated], + ) + ) + self.timeseries_groups = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.timeseries_groups, # pyright: ignore[reportDeprecated], + ) + ) + self.user_agent = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.user_agent, # pyright: ignore[reportDeprecated], + ) ) @@ -274,8 +999,25 @@ class TimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.user_agent = to_streamed_response_wrapper( - timeseries_groups.user_agent, + self.summary = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.summary, # pyright: ignore[reportDeprecated], + ) + ) + self.timeseries = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.timeseries, # pyright: ignore[reportDeprecated], + ) + ) + self.timeseries_groups = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.timeseries_groups, # pyright: ignore[reportDeprecated], + ) + ) + self.user_agent = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.user_agent, # pyright: ignore[reportDeprecated], + ) ) @@ -283,6 +1025,23 @@ class AsyncTimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.user_agent = async_to_streamed_response_wrapper( - timeseries_groups.user_agent, + self.summary = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.summary, # pyright: ignore[reportDeprecated], + ) + ) + self.timeseries = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.timeseries, # pyright: ignore[reportDeprecated], + ) + ) + self.timeseries_groups = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.timeseries_groups, # pyright: ignore[reportDeprecated], + ) + ) + self.user_agent = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.user_agent, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/ai/to_markdown.py b/src/cloudflare/resources/radar/ai/to_markdown.py index c9261225ccd..e50ae619d4a 100644 --- a/src/cloudflare/resources/radar/ai/to_markdown.py +++ b/src/cloudflare/resources/radar/ai/to_markdown.py @@ -2,10 +2,12 @@ from __future__ import annotations +import typing_extensions + import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from ...._utils import maybe_transform +from ...._files import read_file_content +from ...._types import Body, Query, Headers, NotGiven, FileContent, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -16,7 +18,6 @@ ) from ....pagination import SyncSinglePage, AsyncSinglePage from ...._base_client import AsyncPaginator, make_request_options -from ....types.radar.ai import to_markdown_create_params from ....types.radar.ai.to_markdown_create_response import ToMarkdownCreateResponse __all__ = ["ToMarkdownResource", "AsyncToMarkdownResource"] @@ -42,17 +43,20 @@ def with_streaming_response(self) -> ToMarkdownResourceWithStreamingResponse: """ return ToMarkdownResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [AI > To Markdown](https://developers.cloudflare.com/api/resources/ai/subresources/to_markdown/) instead." + ) def create( self, + body: FileContent, *, account_id: str, - body: FileTypes | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ToMarkdownCreateResponse]: """ Convert Files into Markdown @@ -68,10 +72,11 @@ def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})} return self._get_api_list( f"/accounts/{account_id}/ai/tomarkdown", page=SyncSinglePage[ToMarkdownCreateResponse], - body=maybe_transform(body, to_markdown_create_params.ToMarkdownCreateParams), + body=read_file_content(body), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -100,17 +105,20 @@ def with_streaming_response(self) -> AsyncToMarkdownResourceWithStreamingRespons """ return AsyncToMarkdownResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [AI > To Markdown](https://developers.cloudflare.com/api/resources/ai/subresources/to_markdown/) instead." + ) def create( self, + body: FileContent, *, account_id: str, - body: FileTypes | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ToMarkdownCreateResponse, AsyncSinglePage[ToMarkdownCreateResponse]]: """ Convert Files into Markdown @@ -126,10 +134,11 @@ def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})} return self._get_api_list( f"/accounts/{account_id}/ai/tomarkdown", page=AsyncSinglePage[ToMarkdownCreateResponse], - body=maybe_transform(body, to_markdown_create_params.ToMarkdownCreateParams), + body=read_file_content(body), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -142,8 +151,10 @@ class ToMarkdownResourceWithRawResponse: def __init__(self, to_markdown: ToMarkdownResource) -> None: self._to_markdown = to_markdown - self.create = to_raw_response_wrapper( - to_markdown.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + to_markdown.create, # pyright: ignore[reportDeprecated], + ) ) @@ -151,8 +162,10 @@ class AsyncToMarkdownResourceWithRawResponse: def __init__(self, to_markdown: AsyncToMarkdownResource) -> None: self._to_markdown = to_markdown - self.create = async_to_raw_response_wrapper( - to_markdown.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + to_markdown.create, # pyright: ignore[reportDeprecated], + ) ) @@ -160,8 +173,10 @@ class ToMarkdownResourceWithStreamingResponse: def __init__(self, to_markdown: ToMarkdownResource) -> None: self._to_markdown = to_markdown - self.create = to_streamed_response_wrapper( - to_markdown.create, + self.create = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + to_markdown.create, # pyright: ignore[reportDeprecated], + ) ) @@ -169,6 +184,8 @@ class AsyncToMarkdownResourceWithStreamingResponse: def __init__(self, to_markdown: AsyncToMarkdownResource) -> None: self._to_markdown = to_markdown - self.create = async_to_streamed_response_wrapper( - to_markdown.create, + self.create = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + to_markdown.create, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/annotations/annotations.py b/src/cloudflare/resources/radar/annotations/annotations.py index 5d7306c21c6..0ac525da39e 100644 --- a/src/cloudflare/resources/radar/annotations/annotations.py +++ b/src/cloudflare/resources/radar/annotations/annotations.py @@ -16,7 +16,7 @@ OutagesResourceWithStreamingResponse, AsyncOutagesResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -61,20 +61,20 @@ def with_streaming_response(self) -> AnnotationsResourceWithStreamingResponse: def list( self, *, - asn: int | NotGiven = NOT_GIVEN, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + asn: int | Omit = omit, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AnnotationListResponse: """ Retrieves the latest annotations. @@ -158,20 +158,20 @@ def with_streaming_response(self) -> AsyncAnnotationsResourceWithStreamingRespon async def list( self, *, - asn: int | NotGiven = NOT_GIVEN, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + asn: int | Omit = omit, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AnnotationListResponse: """ Retrieves the latest annotations. diff --git a/src/cloudflare/resources/radar/annotations/outages.py b/src/cloudflare/resources/radar/annotations/outages.py index fbc6fde01b5..359eb073a29 100644 --- a/src/cloudflare/resources/radar/annotations/outages.py +++ b/src/cloudflare/resources/radar/annotations/outages.py @@ -8,7 +8,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,20 +50,20 @@ def with_streaming_response(self) -> OutagesResourceWithStreamingResponse: def get( self, *, - asn: int | NotGiven = NOT_GIVEN, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + asn: int | Omit = omit, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OutageGetResponse: """ Retrieves the latest Internet outages and anomalies. @@ -122,17 +122,17 @@ def get( def locations( self, *, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OutageLocationsResponse: """ Retrieves the number of outages by location. @@ -202,20 +202,20 @@ def with_streaming_response(self) -> AsyncOutagesResourceWithStreamingResponse: async def get( self, *, - asn: int | NotGiven = NOT_GIVEN, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + asn: int | Omit = omit, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OutageGetResponse: """ Retrieves the latest Internet outages and anomalies. @@ -274,17 +274,17 @@ async def get( async def locations( self, *, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OutageLocationsResponse: """ Retrieves the number of outages by location. diff --git a/src/cloudflare/resources/radar/as112/as112.py b/src/cloudflare/resources/radar/as112/as112.py index d74b4bd4619..c2023455fc7 100644 --- a/src/cloudflare/resources/radar/as112/as112.py +++ b/src/cloudflare/resources/radar/as112/as112.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +from typing import Type, Union, Optional, cast from datetime import datetime from typing_extensions import Literal @@ -24,7 +24,7 @@ SummaryResourceWithStreamingResponse, AsyncSummaryResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -35,7 +35,7 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....types.radar import as112_timeseries_params +from ....types.radar import as112_summary_v2_params, as112_timeseries_params, as112_timeseries_groups_v2_params from ...._base_client import make_request_options from .timeseries_groups import ( TimeseriesGroupsResource, @@ -45,7 +45,9 @@ TimeseriesGroupsResourceWithStreamingResponse, AsyncTimeseriesGroupsResourceWithStreamingResponse, ) +from ....types.radar.as112_summary_v2_response import AS112SummaryV2Response from ....types.radar.as112_timeseries_response import AS112TimeseriesResponse +from ....types.radar.as112_timeseries_groups_v2_response import AS112TimeseriesGroupsV2Response __all__ = ["AS112Resource", "AsyncAS112Resource"] @@ -82,18 +84,888 @@ def with_streaming_response(self) -> AS112ResourceWithStreamingResponse: """ return AS112ResourceWithStreamingResponse(self) + def summary_v2( + self, + dimension: Literal["DNSSEC", "EDNS", "IP_VERSION", "PROTOCOL", "QUERY_TYPE", "RESPONSE_CODE"], + *, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, + query_type: Optional[ + Literal[ + "A", + "AAAA", + "A6", + "AFSDB", + "ANY", + "APL", + "ATMA", + "AXFR", + "CAA", + "CDNSKEY", + "CDS", + "CERT", + "CNAME", + "CSYNC", + "DHCID", + "DLV", + "DNAME", + "DNSKEY", + "DOA", + "DS", + "EID", + "EUI48", + "EUI64", + "GPOS", + "GID", + "HINFO", + "HIP", + "HTTPS", + "IPSECKEY", + "ISDN", + "IXFR", + "KEY", + "KX", + "L32", + "L64", + "LOC", + "LP", + "MAILA", + "MAILB", + "MB", + "MD", + "MF", + "MG", + "MINFO", + "MR", + "MX", + "NAPTR", + "NB", + "NBSTAT", + "NID", + "NIMLOC", + "NINFO", + "NS", + "NSAP", + "NSEC", + "NSEC3", + "NSEC3PARAM", + "NULL", + "NXT", + "OPENPGPKEY", + "OPT", + "PTR", + "PX", + "RKEY", + "RP", + "RRSIG", + "RT", + "SIG", + "SINK", + "SMIMEA", + "SOA", + "SPF", + "SRV", + "SSHFP", + "SVCB", + "TA", + "TALINK", + "TKEY", + "TLSA", + "TSIG", + "TXT", + "UINFO", + "UID", + "UNSPEC", + "URI", + "WKS", + "X25", + "ZONEMD", + ] + ] + | Omit = omit, + response_code: Literal[ + "NOERROR", + "FORMERR", + "SERVFAIL", + "NXDOMAIN", + "NOTIMP", + "REFUSED", + "YXDOMAIN", + "YXRRSET", + "NXRRSET", + "NOTAUTH", + "NOTZONE", + "BADSIG", + "BADKEY", + "BADTIME", + "BADMODE", + "BADNAME", + "BADALG", + "BADTRUNC", + "BADCOOKIE", + ] + | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AS112SummaryV2Response: + """ + Retrieves the distribution of AS112 queries by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + protocol: Filters results by DNS transport protocol. + + query_type: Filters results by DNS query type. + + response_code: Filters results by DNS response code. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/as112/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "protocol": protocol, + "query_type": query_type, + "response_code": response_code, + }, + as112_summary_v2_params.AS112SummaryV2Params, + ), + post_parser=ResultWrapper[AS112SummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[AS112SummaryV2Response], ResultWrapper[AS112SummaryV2Response]), + ) + def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, + query_type: Optional[ + Literal[ + "A", + "AAAA", + "A6", + "AFSDB", + "ANY", + "APL", + "ATMA", + "AXFR", + "CAA", + "CDNSKEY", + "CDS", + "CERT", + "CNAME", + "CSYNC", + "DHCID", + "DLV", + "DNAME", + "DNSKEY", + "DOA", + "DS", + "EID", + "EUI48", + "EUI64", + "GPOS", + "GID", + "HINFO", + "HIP", + "HTTPS", + "IPSECKEY", + "ISDN", + "IXFR", + "KEY", + "KX", + "L32", + "L64", + "LOC", + "LP", + "MAILA", + "MAILB", + "MB", + "MD", + "MF", + "MG", + "MINFO", + "MR", + "MX", + "NAPTR", + "NB", + "NBSTAT", + "NID", + "NIMLOC", + "NINFO", + "NS", + "NSAP", + "NSEC", + "NSEC3", + "NSEC3PARAM", + "NULL", + "NXT", + "OPENPGPKEY", + "OPT", + "PTR", + "PX", + "RKEY", + "RP", + "RRSIG", + "RT", + "SIG", + "SINK", + "SMIMEA", + "SOA", + "SPF", + "SRV", + "SSHFP", + "SVCB", + "TA", + "TALINK", + "TKEY", + "TLSA", + "TSIG", + "TXT", + "UINFO", + "UID", + "UNSPEC", + "URI", + "WKS", + "X25", + "ZONEMD", + ] + ] + | Omit = omit, + response_code: Literal[ + "NOERROR", + "FORMERR", + "SERVFAIL", + "NXDOMAIN", + "NOTIMP", + "REFUSED", + "YXDOMAIN", + "YXRRSET", + "NXRRSET", + "NOTAUTH", + "NOTZONE", + "BADSIG", + "BADKEY", + "BADTIME", + "BADMODE", + "BADNAME", + "BADALG", + "BADTRUNC", + "BADCOOKIE", + ] + | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AS112TimeseriesResponse: + """ + Retrieves the AS112 DNS queries over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + protocol: Filters results by DNS transport protocol. + + query_type: Filters results by DNS query type. + + response_code: Filters results by DNS response code. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/as112/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "location": location, + "name": name, + "protocol": protocol, + "query_type": query_type, + "response_code": response_code, + }, + as112_timeseries_params.AS112TimeseriesParams, + ), + post_parser=ResultWrapper[AS112TimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[AS112TimeseriesResponse], ResultWrapper[AS112TimeseriesResponse]), + ) + + def timeseries_groups_v2( + self, + dimension: Literal["DNSSEC", "EDNS", "IP_VERSION", "PROTOCOL", "QUERY_TYPE", "RESPONSE_CODE"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, + query_type: Optional[ + Literal[ + "A", + "AAAA", + "A6", + "AFSDB", + "ANY", + "APL", + "ATMA", + "AXFR", + "CAA", + "CDNSKEY", + "CDS", + "CERT", + "CNAME", + "CSYNC", + "DHCID", + "DLV", + "DNAME", + "DNSKEY", + "DOA", + "DS", + "EID", + "EUI48", + "EUI64", + "GPOS", + "GID", + "HINFO", + "HIP", + "HTTPS", + "IPSECKEY", + "ISDN", + "IXFR", + "KEY", + "KX", + "L32", + "L64", + "LOC", + "LP", + "MAILA", + "MAILB", + "MB", + "MD", + "MF", + "MG", + "MINFO", + "MR", + "MX", + "NAPTR", + "NB", + "NBSTAT", + "NID", + "NIMLOC", + "NINFO", + "NS", + "NSAP", + "NSEC", + "NSEC3", + "NSEC3PARAM", + "NULL", + "NXT", + "OPENPGPKEY", + "OPT", + "PTR", + "PX", + "RKEY", + "RP", + "RRSIG", + "RT", + "SIG", + "SINK", + "SMIMEA", + "SOA", + "SPF", + "SRV", + "SSHFP", + "SVCB", + "TA", + "TALINK", + "TKEY", + "TLSA", + "TSIG", + "TXT", + "UINFO", + "UID", + "UNSPEC", + "URI", + "WKS", + "X25", + "ZONEMD", + ] + ] + | Omit = omit, + response_code: Literal[ + "NOERROR", + "FORMERR", + "SERVFAIL", + "NXDOMAIN", + "NOTIMP", + "REFUSED", + "YXDOMAIN", + "YXRRSET", + "NXRRSET", + "NOTAUTH", + "NOTZONE", + "BADSIG", + "BADKEY", + "BADTIME", + "BADMODE", + "BADNAME", + "BADALG", + "BADTRUNC", + "BADCOOKIE", + ] + | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AS112TimeseriesGroupsV2Response: + """ + Retrieves the distribution of AS112 queries grouped by dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + protocol: Filters results by DNS transport protocol. + + query_type: Filters results by DNS query type. + + response_code: Filters results by DNS response code. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/as112/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "protocol": protocol, + "query_type": query_type, + "response_code": response_code, + }, + as112_timeseries_groups_v2_params.AS112TimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[AS112TimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[AS112TimeseriesGroupsV2Response], ResultWrapper[AS112TimeseriesGroupsV2Response]), + ) + + +class AsyncAS112Resource(AsyncAPIResource): + @cached_property + def summary(self) -> AsyncSummaryResource: + return AsyncSummaryResource(self._client) + + @cached_property + def timeseries_groups(self) -> AsyncTimeseriesGroupsResource: + return AsyncTimeseriesGroupsResource(self._client) + + @cached_property + def top(self) -> AsyncTopResource: + return AsyncTopResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncAS112ResourceWithRawResponse: + """ + 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 AsyncAS112ResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAS112ResourceWithStreamingResponse: + """ + 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 AsyncAS112ResourceWithStreamingResponse(self) + + async def summary_v2( + self, + dimension: Literal["DNSSEC", "EDNS", "IP_VERSION", "PROTOCOL", "QUERY_TYPE", "RESPONSE_CODE"], + *, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, + query_type: Optional[ + Literal[ + "A", + "AAAA", + "A6", + "AFSDB", + "ANY", + "APL", + "ATMA", + "AXFR", + "CAA", + "CDNSKEY", + "CDS", + "CERT", + "CNAME", + "CSYNC", + "DHCID", + "DLV", + "DNAME", + "DNSKEY", + "DOA", + "DS", + "EID", + "EUI48", + "EUI64", + "GPOS", + "GID", + "HINFO", + "HIP", + "HTTPS", + "IPSECKEY", + "ISDN", + "IXFR", + "KEY", + "KX", + "L32", + "L64", + "LOC", + "LP", + "MAILA", + "MAILB", + "MB", + "MD", + "MF", + "MG", + "MINFO", + "MR", + "MX", + "NAPTR", + "NB", + "NBSTAT", + "NID", + "NIMLOC", + "NINFO", + "NS", + "NSAP", + "NSEC", + "NSEC3", + "NSEC3PARAM", + "NULL", + "NXT", + "OPENPGPKEY", + "OPT", + "PTR", + "PX", + "RKEY", + "RP", + "RRSIG", + "RT", + "SIG", + "SINK", + "SMIMEA", + "SOA", + "SPF", + "SRV", + "SSHFP", + "SVCB", + "TA", + "TALINK", + "TKEY", + "TLSA", + "TSIG", + "TXT", + "UINFO", + "UID", + "UNSPEC", + "URI", + "WKS", + "X25", + "ZONEMD", + ] + ] + | Omit = omit, + response_code: Literal[ + "NOERROR", + "FORMERR", + "SERVFAIL", + "NXDOMAIN", + "NOTIMP", + "REFUSED", + "YXDOMAIN", + "YXRRSET", + "NXRRSET", + "NOTAUTH", + "NOTZONE", + "BADSIG", + "BADKEY", + "BADTIME", + "BADMODE", + "BADNAME", + "BADALG", + "BADTRUNC", + "BADCOOKIE", + ] + | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AS112SummaryV2Response: + """ + Retrieves the distribution of AS112 queries by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + protocol: Filters results by DNS transport protocol. + + query_type: Filters results by DNS query type. + + response_code: Filters results by DNS response code. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/as112/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "protocol": protocol, + "query_type": query_type, + "response_code": response_code, + }, + as112_summary_v2_params.AS112SummaryV2Params, + ), + post_parser=ResultWrapper[AS112SummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[AS112SummaryV2Response], ResultWrapper[AS112SummaryV2Response]), + ) + + async def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -186,7 +1058,7 @@ def timeseries( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -208,13 +1080,13 @@ def timeseries( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AS112TimeseriesResponse: """ Retrieves the AS112 DNS queries over time. @@ -258,14 +1130,14 @@ def timeseries( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return await self._get( "/radar/as112/timeseries", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( + query=await async_maybe_transform( { "agg_interval": agg_interval, "continent": continent, @@ -286,51 +1158,20 @@ def timeseries( cast_to=cast(Type[AS112TimeseriesResponse], ResultWrapper[AS112TimeseriesResponse]), ) - -class AsyncAS112Resource(AsyncAPIResource): - @cached_property - def summary(self) -> AsyncSummaryResource: - return AsyncSummaryResource(self._client) - - @cached_property - def timeseries_groups(self) -> AsyncTimeseriesGroupsResource: - return AsyncTimeseriesGroupsResource(self._client) - - @cached_property - def top(self) -> AsyncTopResource: - return AsyncTopResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncAS112ResourceWithRawResponse: - """ - 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 AsyncAS112ResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAS112ResourceWithStreamingResponse: - """ - 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 AsyncAS112ResourceWithStreamingResponse(self) - - async def timeseries( + async def timeseries_groups_v2( self, + dimension: Literal["DNSSEC", "EDNS", "IP_VERSION", "PROTOCOL", "QUERY_TYPE", "RESPONSE_CODE"], *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -423,7 +1264,7 @@ async def timeseries( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -445,18 +1286,20 @@ async def timeseries( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AS112TimeseriesResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AS112TimeseriesGroupsV2Response: """ - Retrieves the AS112 DNS queries over time. + Retrieves the distribution of AS112 queries grouped by dimension over time. Args: + dimension: Specifies the attribute by which to group the results. + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). @@ -475,6 +1318,10 @@ async def timeseries( format: Format in which results will be returned. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude locations from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -495,8 +1342,10 @@ async def timeseries( timeout: Override the client-level default timeout for this request, in seconds """ + if not dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") return await self._get( - "/radar/as112/timeseries", + f"/radar/as112/timeseries_groups/{dimension}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -510,17 +1359,18 @@ async def timeseries( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, "protocol": protocol, "query_type": query_type, "response_code": response_code, }, - as112_timeseries_params.AS112TimeseriesParams, + as112_timeseries_groups_v2_params.AS112TimeseriesGroupsV2Params, ), - post_parser=ResultWrapper[AS112TimeseriesResponse]._unwrapper, + post_parser=ResultWrapper[AS112TimeseriesGroupsV2Response]._unwrapper, ), - cast_to=cast(Type[AS112TimeseriesResponse], ResultWrapper[AS112TimeseriesResponse]), + cast_to=cast(Type[AS112TimeseriesGroupsV2Response], ResultWrapper[AS112TimeseriesGroupsV2Response]), ) @@ -528,9 +1378,15 @@ class AS112ResourceWithRawResponse: def __init__(self, as112: AS112Resource) -> None: self._as112 = as112 + self.summary_v2 = to_raw_response_wrapper( + as112.summary_v2, + ) self.timeseries = to_raw_response_wrapper( as112.timeseries, ) + self.timeseries_groups_v2 = to_raw_response_wrapper( + as112.timeseries_groups_v2, + ) @cached_property def summary(self) -> SummaryResourceWithRawResponse: @@ -549,9 +1405,15 @@ class AsyncAS112ResourceWithRawResponse: def __init__(self, as112: AsyncAS112Resource) -> None: self._as112 = as112 + self.summary_v2 = async_to_raw_response_wrapper( + as112.summary_v2, + ) self.timeseries = async_to_raw_response_wrapper( as112.timeseries, ) + self.timeseries_groups_v2 = async_to_raw_response_wrapper( + as112.timeseries_groups_v2, + ) @cached_property def summary(self) -> AsyncSummaryResourceWithRawResponse: @@ -570,9 +1432,15 @@ class AS112ResourceWithStreamingResponse: def __init__(self, as112: AS112Resource) -> None: self._as112 = as112 + self.summary_v2 = to_streamed_response_wrapper( + as112.summary_v2, + ) self.timeseries = to_streamed_response_wrapper( as112.timeseries, ) + self.timeseries_groups_v2 = to_streamed_response_wrapper( + as112.timeseries_groups_v2, + ) @cached_property def summary(self) -> SummaryResourceWithStreamingResponse: @@ -591,9 +1459,15 @@ class AsyncAS112ResourceWithStreamingResponse: def __init__(self, as112: AsyncAS112Resource) -> None: self._as112 = as112 + self.summary_v2 = async_to_streamed_response_wrapper( + as112.summary_v2, + ) self.timeseries = async_to_streamed_response_wrapper( as112.timeseries, ) + self.timeseries_groups_v2 = async_to_streamed_response_wrapper( + as112.timeseries_groups_v2, + ) @cached_property def summary(self) -> AsyncSummaryResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/radar/as112/summary.py b/src/cloudflare/resources/radar/as112/summary.py index 11576a43d09..b730f25e544 100644 --- a/src/cloudflare/resources/radar/as112/summary.py +++ b/src/cloudflare/resources/radar/as112/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +import typing_extensions +from typing import Type, Union, Optional, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,17 +59,20 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) def dnssec( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -161,7 +165,7 @@ def dnssec( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -183,13 +187,13 @@ def dnssec( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDNSSECResponse: """ Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security @@ -257,17 +261,20 @@ def dnssec( cast_to=cast(Type[SummaryDNSSECResponse], ResultWrapper[SummaryDNSSECResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) def edns( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -360,7 +367,7 @@ def edns( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -382,13 +389,13 @@ def edns( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryEdnsResponse: """ Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms @@ -456,17 +463,20 @@ def edns( cast_to=cast(Type[SummaryEdnsResponse], ResultWrapper[SummaryEdnsResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) def ip_version( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -559,7 +569,7 @@ def ip_version( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -581,13 +591,13 @@ def ip_version( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of DNS queries to AS112 by IP version. @@ -654,16 +664,19 @@ def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) def protocol( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -756,7 +769,7 @@ def protocol( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -778,13 +791,13 @@ def protocol( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryProtocolResponse: """ Retrieves the distribution of DNS queries to AS112 by protocol. @@ -848,18 +861,21 @@ def protocol( cast_to=cast(Type[SummaryProtocolResponse], ResultWrapper[SummaryProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) def query_type( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -881,13 +897,13 @@ def query_type( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryQueryTypeResponse: """ Retrieves the distribution of DNS queries to AS112 by type. @@ -956,18 +972,21 @@ def query_type( cast_to=cast(Type[SummaryQueryTypeResponse], ResultWrapper[SummaryQueryTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) def response_codes( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1060,13 +1079,13 @@ def response_codes( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryResponseCodesResponse: """ Retrieves the distribution of AS112 DNS requests classified by response code. @@ -1156,17 +1175,20 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) async def dnssec( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1259,7 +1281,7 @@ async def dnssec( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1281,13 +1303,13 @@ async def dnssec( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDNSSECResponse: """ Retrieves the distribution of DNS queries to AS112 by DNSSEC (DNS Security @@ -1355,17 +1377,20 @@ async def dnssec( cast_to=cast(Type[SummaryDNSSECResponse], ResultWrapper[SummaryDNSSECResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) async def edns( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1458,7 +1483,7 @@ async def edns( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1480,13 +1505,13 @@ async def edns( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryEdnsResponse: """ Retrieves the distribution of DNS queries to AS112 by EDNS (Extension Mechanisms @@ -1554,17 +1579,20 @@ async def edns( cast_to=cast(Type[SummaryEdnsResponse], ResultWrapper[SummaryEdnsResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) async def ip_version( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1657,7 +1685,7 @@ async def ip_version( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1679,13 +1707,13 @@ async def ip_version( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of DNS queries to AS112 by IP version. @@ -1752,16 +1780,19 @@ async def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) async def protocol( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1854,7 +1885,7 @@ async def protocol( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1876,13 +1907,13 @@ async def protocol( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryProtocolResponse: """ Retrieves the distribution of DNS queries to AS112 by protocol. @@ -1946,18 +1977,21 @@ async def protocol( cast_to=cast(Type[SummaryProtocolResponse], ResultWrapper[SummaryProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) async def query_type( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1979,13 +2013,13 @@ async def query_type( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryQueryTypeResponse: """ Retrieves the distribution of DNS queries to AS112 by type. @@ -2054,18 +2088,21 @@ async def query_type( cast_to=cast(Type[SummaryQueryTypeResponse], ResultWrapper[SummaryQueryTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/summary_v2/) instead." + ) async def response_codes( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2158,13 +2195,13 @@ async def response_codes( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryResponseCodesResponse: """ Retrieves the distribution of AS112 DNS requests classified by response code. @@ -2238,23 +2275,35 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.dnssec = to_raw_response_wrapper( - summary.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.edns = to_raw_response_wrapper( - summary.edns, + self.edns = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.edns, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_raw_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = to_raw_response_wrapper( - summary.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_codes = to_raw_response_wrapper( - summary.response_codes, + self.response_codes = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.response_codes, # pyright: ignore[reportDeprecated], + ) ) @@ -2262,23 +2311,35 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.dnssec = async_to_raw_response_wrapper( - summary.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.edns = async_to_raw_response_wrapper( - summary.edns, + self.edns = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.edns, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_raw_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = async_to_raw_response_wrapper( - summary.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_codes = async_to_raw_response_wrapper( - summary.response_codes, + self.response_codes = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.response_codes, # pyright: ignore[reportDeprecated], + ) ) @@ -2286,23 +2347,35 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.dnssec = to_streamed_response_wrapper( - summary.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.edns = to_streamed_response_wrapper( - summary.edns, + self.edns = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.edns, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_streamed_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = to_streamed_response_wrapper( - summary.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_codes = to_streamed_response_wrapper( - summary.response_codes, + self.response_codes = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.response_codes, # pyright: ignore[reportDeprecated], + ) ) @@ -2310,21 +2383,33 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.dnssec = async_to_streamed_response_wrapper( - summary.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.edns = async_to_streamed_response_wrapper( - summary.edns, + self.edns = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.edns, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_streamed_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = async_to_streamed_response_wrapper( - summary.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_codes = async_to_streamed_response_wrapper( - summary.response_codes, + self.response_codes = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.response_codes, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/as112/timeseries_groups.py b/src/cloudflare/resources/radar/as112/timeseries_groups.py index 9d8b18e9138..a8d82cc49c5 100644 --- a/src/cloudflare/resources/radar/as112/timeseries_groups.py +++ b/src/cloudflare/resources/radar/as112/timeseries_groups.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +import typing_extensions +from typing import Type, Union, Optional, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,18 +59,21 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon """ return TimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) def dnssec( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -162,7 +166,7 @@ def dnssec( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -184,13 +188,13 @@ def dnssec( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDNSSECResponse: """ Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security @@ -263,18 +267,21 @@ def dnssec( cast_to=cast(Type[TimeseriesGroupDNSSECResponse], ResultWrapper[TimeseriesGroupDNSSECResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) def edns( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -367,7 +374,7 @@ def edns( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -389,13 +396,13 @@ def edns( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupEdnsResponse: """ Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms @@ -468,18 +475,21 @@ def edns( cast_to=cast(Type[TimeseriesGroupEdnsResponse], ResultWrapper[TimeseriesGroupEdnsResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -572,7 +582,7 @@ def ip_version( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -594,13 +604,13 @@ def ip_version( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of AS112 DNS queries by IP version over time. @@ -672,17 +682,20 @@ def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) def protocol( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -775,7 +788,7 @@ def protocol( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -797,13 +810,13 @@ def protocol( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupProtocolResponse: """ Retrieves the distribution of AS112 DNS requests classified by protocol over @@ -873,19 +886,22 @@ def protocol( cast_to=cast(Type[TimeseriesGroupProtocolResponse], ResultWrapper[TimeseriesGroupProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) def query_type( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -907,13 +923,13 @@ def query_type( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupQueryTypeResponse: """ Retrieves the distribution of AS112 DNS queries by type over time. @@ -987,19 +1003,22 @@ def query_type( cast_to=cast(Type[TimeseriesGroupQueryTypeResponse], ResultWrapper[TimeseriesGroupQueryTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) def response_codes( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1092,13 +1111,13 @@ def response_codes( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupResponseCodesResponse: """ Retrieves the distribution of AS112 DNS requests classified by response code @@ -1196,18 +1215,21 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR """ return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) async def dnssec( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1300,7 +1322,7 @@ async def dnssec( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1322,13 +1344,13 @@ async def dnssec( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDNSSECResponse: """ Retrieves the distribution of AS112 DNS queries by DNSSEC (DNS Security @@ -1401,18 +1423,21 @@ async def dnssec( cast_to=cast(Type[TimeseriesGroupDNSSECResponse], ResultWrapper[TimeseriesGroupDNSSECResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) async def edns( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1505,7 +1530,7 @@ async def edns( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1527,13 +1552,13 @@ async def edns( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupEdnsResponse: """ Retrieves the distribution of AS112 DNS queries by EDNS (Extension Mechanisms @@ -1606,18 +1631,21 @@ async def edns( cast_to=cast(Type[TimeseriesGroupEdnsResponse], ResultWrapper[TimeseriesGroupEdnsResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) async def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1710,7 +1738,7 @@ async def ip_version( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1732,13 +1760,13 @@ async def ip_version( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of AS112 DNS queries by IP version over time. @@ -1810,17 +1838,20 @@ async def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) async def protocol( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1913,7 +1944,7 @@ async def protocol( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1935,13 +1966,13 @@ async def protocol( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupProtocolResponse: """ Retrieves the distribution of AS112 DNS requests classified by protocol over @@ -2011,19 +2042,22 @@ async def protocol( cast_to=cast(Type[TimeseriesGroupProtocolResponse], ResultWrapper[TimeseriesGroupProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) async def query_type( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2045,13 +2079,13 @@ async def query_type( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupQueryTypeResponse: """ Retrieves the distribution of AS112 DNS queries by type over time. @@ -2125,19 +2159,22 @@ async def query_type( cast_to=cast(Type[TimeseriesGroupQueryTypeResponse], ResultWrapper[TimeseriesGroupQueryTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar AS112 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/as112/methods/timeseries_groups_v2/) instead." + ) async def response_codes( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2230,13 +2267,13 @@ async def response_codes( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupResponseCodesResponse: """ Retrieves the distribution of AS112 DNS requests classified by response code @@ -2318,23 +2355,35 @@ class TimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.dnssec = to_raw_response_wrapper( - timeseries_groups.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.edns = to_raw_response_wrapper( - timeseries_groups.edns, + self.edns = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.edns, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_raw_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = to_raw_response_wrapper( - timeseries_groups.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_codes = to_raw_response_wrapper( - timeseries_groups.response_codes, + self.response_codes = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.response_codes, # pyright: ignore[reportDeprecated], + ) ) @@ -2342,23 +2391,35 @@ class AsyncTimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.dnssec = async_to_raw_response_wrapper( - timeseries_groups.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.edns = async_to_raw_response_wrapper( - timeseries_groups.edns, + self.edns = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.edns, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_raw_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = async_to_raw_response_wrapper( - timeseries_groups.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_codes = async_to_raw_response_wrapper( - timeseries_groups.response_codes, + self.response_codes = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.response_codes, # pyright: ignore[reportDeprecated], + ) ) @@ -2366,23 +2427,35 @@ class TimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.dnssec = to_streamed_response_wrapper( - timeseries_groups.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.edns = to_streamed_response_wrapper( - timeseries_groups.edns, + self.edns = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.edns, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_streamed_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = to_streamed_response_wrapper( - timeseries_groups.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_codes = to_streamed_response_wrapper( - timeseries_groups.response_codes, + self.response_codes = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.response_codes, # pyright: ignore[reportDeprecated], + ) ) @@ -2390,21 +2463,33 @@ class AsyncTimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.dnssec = async_to_streamed_response_wrapper( - timeseries_groups.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.edns = async_to_streamed_response_wrapper( - timeseries_groups.edns, + self.edns = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.edns, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_streamed_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = async_to_streamed_response_wrapper( - timeseries_groups.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_codes = async_to_streamed_response_wrapper( - timeseries_groups.response_codes, + self.response_codes = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.response_codes, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/as112/top.py b/src/cloudflare/resources/radar/as112/top.py index 2d05eec759f..2d22f91c78e 100644 --- a/src/cloudflare/resources/radar/as112/top.py +++ b/src/cloudflare/resources/radar/as112/top.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,20 +53,20 @@ def dnssec( self, dnssec: Literal["SUPPORTED", "NOT_SUPPORTED"], *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopDNSSECResponse: """ Retrieves the top locations of DNS queries to AS112 with DNSSEC (DNS Security @@ -136,20 +136,20 @@ def edns( self, edns: Literal["SUPPORTED", "NOT_SUPPORTED"], *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopEdnsResponse: """ Retrieves the top locations of DNS queries to AS112 with EDNS (Extension @@ -219,20 +219,20 @@ def ip_version( self, ip_version: Literal["IPv4", "IPv6"], *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopIPVersionResponse: """ Retrieves the top locations of DNS queries to AS112 for an IP version. @@ -300,20 +300,20 @@ def ip_version( def locations( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopLocationsResponse: """ Retrieves the top locations by AS112 DNS queries. @@ -399,20 +399,20 @@ async def dnssec( self, dnssec: Literal["SUPPORTED", "NOT_SUPPORTED"], *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopDNSSECResponse: """ Retrieves the top locations of DNS queries to AS112 with DNSSEC (DNS Security @@ -482,20 +482,20 @@ async def edns( self, edns: Literal["SUPPORTED", "NOT_SUPPORTED"], *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopEdnsResponse: """ Retrieves the top locations of DNS queries to AS112 with EDNS (Extension @@ -565,20 +565,20 @@ async def ip_version( self, ip_version: Literal["IPv4", "IPv6"], *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopIPVersionResponse: """ Retrieves the top locations of DNS queries to AS112 for an IP version. @@ -646,20 +646,20 @@ async def ip_version( async def locations( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopLocationsResponse: """ Retrieves the top locations by AS112 DNS queries. diff --git a/src/cloudflare/resources/radar/attacks/layer3/layer3.py b/src/cloudflare/resources/radar/attacks/layer3/layer3.py index 28c16d32053..54e7fdffaef 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/layer3.py +++ b/src/cloudflare/resources/radar/attacks/layer3/layer3.py @@ -24,7 +24,7 @@ TopResourceWithStreamingResponse, AsyncTopResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -44,8 +44,14 @@ TimeseriesGroupsResourceWithStreamingResponse, AsyncTimeseriesGroupsResourceWithStreamingResponse, ) -from .....types.radar.attacks import layer3_timeseries_params +from .....types.radar.attacks import ( + layer3_summary_v2_params, + layer3_timeseries_params, + layer3_timeseries_groups_v2_params, +) +from .....types.radar.attacks.layer3_summary_v2_response import Layer3SummaryV2Response from .....types.radar.attacks.layer3_timeseries_response import Layer3TimeseriesResponse +from .....types.radar.attacks.layer3_timeseries_groups_v2_response import Layer3TimeseriesGroupsV2Response __all__ = ["Layer3Resource", "AsyncLayer3Resource"] @@ -82,29 +88,126 @@ def with_streaming_response(self) -> Layer3ResourceWithStreamingResponse: """ return Layer3ResourceWithStreamingResponse(self) + def summary_v2( + self, + dimension: Literal["PROTOCOL", "IP_VERSION", "VECTOR", "DURATION", "BITRATE", "VERTICAL", "INDUSTRY"], + *, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Layer3SummaryV2Response: + """ + Retrieves the distribution of layer 3 attacks by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + direction: Specifies whether the `location` filter applies to the source or target + location. + + format: Format in which results will be returned. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + protocol: Filters the results by layer 3/4 protocol. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/attacks/layer3/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "direction": direction, + "format": format, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "protocol": protocol, + }, + layer3_summary_v2_params.Layer3SummaryV2Params, + ), + post_parser=ResultWrapper[Layer3SummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[Layer3SummaryV2Response], ResultWrapper[Layer3SummaryV2Response]), + ) + def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - metric: Literal["BYTES", "BYTES_OLD"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + metric: Literal["BYTES", "BYTES_OLD"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Layer3TimeseriesResponse: """ Retrieves layer 3 attacks over time. @@ -190,6 +293,114 @@ def timeseries( cast_to=cast(Type[Layer3TimeseriesResponse], ResultWrapper[Layer3TimeseriesResponse]), ) + def timeseries_groups_v2( + self, + dimension: Literal["PROTOCOL", "IP_VERSION", "VECTOR", "DURATION", "BITRATE", "VERTICAL", "INDUSTRY"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Layer3TimeseriesGroupsV2Response: + """ + Retrieves the distribution of layer 3 attacks grouped by dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + direction: Specifies whether the `location` filter applies to the source or target + location. + + format: Format in which results will be returned. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + protocol: Filters the results by layer 3/4 protocol. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/attacks/layer3/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "direction": direction, + "format": format, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + "protocol": protocol, + }, + layer3_timeseries_groups_v2_params.Layer3TimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[Layer3TimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[Layer3TimeseriesGroupsV2Response], ResultWrapper[Layer3TimeseriesGroupsV2Response]), + ) + class AsyncLayer3Resource(AsyncAPIResource): @cached_property @@ -223,29 +434,126 @@ def with_streaming_response(self) -> AsyncLayer3ResourceWithStreamingResponse: """ return AsyncLayer3ResourceWithStreamingResponse(self) + async def summary_v2( + self, + dimension: Literal["PROTOCOL", "IP_VERSION", "VECTOR", "DURATION", "BITRATE", "VERTICAL", "INDUSTRY"], + *, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Layer3SummaryV2Response: + """ + Retrieves the distribution of layer 3 attacks by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + direction: Specifies whether the `location` filter applies to the source or target + location. + + format: Format in which results will be returned. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + protocol: Filters the results by layer 3/4 protocol. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/attacks/layer3/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "direction": direction, + "format": format, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "protocol": protocol, + }, + layer3_summary_v2_params.Layer3SummaryV2Params, + ), + post_parser=ResultWrapper[Layer3SummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[Layer3SummaryV2Response], ResultWrapper[Layer3SummaryV2Response]), + ) + async def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - metric: Literal["BYTES", "BYTES_OLD"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + metric: Literal["BYTES", "BYTES_OLD"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Layer3TimeseriesResponse: """ Retrieves layer 3 attacks over time. @@ -331,14 +639,128 @@ async def timeseries( cast_to=cast(Type[Layer3TimeseriesResponse], ResultWrapper[Layer3TimeseriesResponse]), ) + async def timeseries_groups_v2( + self, + dimension: Literal["PROTOCOL", "IP_VERSION", "VECTOR", "DURATION", "BITRATE", "VERTICAL", "INDUSTRY"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Layer3TimeseriesGroupsV2Response: + """ + Retrieves the distribution of layer 3 attacks grouped by dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + direction: Specifies whether the `location` filter applies to the source or target + location. + + format: Format in which results will be returned. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + protocol: Filters the results by layer 3/4 protocol. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/attacks/layer3/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "direction": direction, + "format": format, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + "protocol": protocol, + }, + layer3_timeseries_groups_v2_params.Layer3TimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[Layer3TimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[Layer3TimeseriesGroupsV2Response], ResultWrapper[Layer3TimeseriesGroupsV2Response]), + ) + class Layer3ResourceWithRawResponse: def __init__(self, layer3: Layer3Resource) -> None: self._layer3 = layer3 + self.summary_v2 = to_raw_response_wrapper( + layer3.summary_v2, + ) self.timeseries = to_raw_response_wrapper( layer3.timeseries, ) + self.timeseries_groups_v2 = to_raw_response_wrapper( + layer3.timeseries_groups_v2, + ) @cached_property def summary(self) -> SummaryResourceWithRawResponse: @@ -357,9 +779,15 @@ class AsyncLayer3ResourceWithRawResponse: def __init__(self, layer3: AsyncLayer3Resource) -> None: self._layer3 = layer3 + self.summary_v2 = async_to_raw_response_wrapper( + layer3.summary_v2, + ) self.timeseries = async_to_raw_response_wrapper( layer3.timeseries, ) + self.timeseries_groups_v2 = async_to_raw_response_wrapper( + layer3.timeseries_groups_v2, + ) @cached_property def summary(self) -> AsyncSummaryResourceWithRawResponse: @@ -378,9 +806,15 @@ class Layer3ResourceWithStreamingResponse: def __init__(self, layer3: Layer3Resource) -> None: self._layer3 = layer3 + self.summary_v2 = to_streamed_response_wrapper( + layer3.summary_v2, + ) self.timeseries = to_streamed_response_wrapper( layer3.timeseries, ) + self.timeseries_groups_v2 = to_streamed_response_wrapper( + layer3.timeseries_groups_v2, + ) @cached_property def summary(self) -> SummaryResourceWithStreamingResponse: @@ -399,9 +833,15 @@ class AsyncLayer3ResourceWithStreamingResponse: def __init__(self, layer3: AsyncLayer3Resource) -> None: self._layer3 = layer3 + self.summary_v2 = async_to_streamed_response_wrapper( + layer3.summary_v2, + ) self.timeseries = async_to_streamed_response_wrapper( layer3.timeseries, ) + self.timeseries_groups_v2 = async_to_streamed_response_wrapper( + layer3.timeseries_groups_v2, + ) @cached_property def summary(self) -> AsyncSummaryResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/radar/attacks/layer3/summary.py b/src/cloudflare/resources/radar/attacks/layer3/summary.py index ea5e8c79cb8..ef233d11a7a 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer3/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -60,25 +61,28 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) def bitrate( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryBitrateResponse: """ Retrieves the distribution of layer 3 attacks by bitrate. @@ -146,25 +150,28 @@ def bitrate( cast_to=cast(Type[SummaryBitrateResponse], ResultWrapper[SummaryBitrateResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) def duration( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDurationResponse: """ Retrieves the distribution of layer 3 attacks by duration. @@ -232,26 +239,29 @@ def duration( cast_to=cast(Type[SummaryDurationResponse], ResultWrapper[SummaryDurationResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) def industry( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIndustryResponse: """ Retrieves the distribution of layer 3 attacks by targeted industry. @@ -324,24 +334,27 @@ def industry( cast_to=cast(Type[SummaryIndustryResponse], ResultWrapper[SummaryIndustryResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) def ip_version( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of layer 3 attacks by IP version. @@ -406,24 +419,27 @@ def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) def protocol( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryProtocolResponse: """ Retrieves the distribution of layer 3 attacks by protocol. @@ -488,26 +504,29 @@ def protocol( cast_to=cast(Type[SummaryProtocolResponse], ResultWrapper[SummaryProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) def vector( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryVectorResponse: """ Retrieves the distribution of layer 3 attacks by vector. @@ -580,26 +599,29 @@ def vector( cast_to=cast(Type[SummaryVectorResponse], ResultWrapper[SummaryVectorResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) def vertical( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryVerticalResponse: """ Retrieves the distribution of layer 3 attacks by targeted vertical. @@ -693,25 +715,28 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) async def bitrate( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryBitrateResponse: """ Retrieves the distribution of layer 3 attacks by bitrate. @@ -779,25 +804,28 @@ async def bitrate( cast_to=cast(Type[SummaryBitrateResponse], ResultWrapper[SummaryBitrateResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) async def duration( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDurationResponse: """ Retrieves the distribution of layer 3 attacks by duration. @@ -865,26 +893,29 @@ async def duration( cast_to=cast(Type[SummaryDurationResponse], ResultWrapper[SummaryDurationResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) async def industry( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIndustryResponse: """ Retrieves the distribution of layer 3 attacks by targeted industry. @@ -957,24 +988,27 @@ async def industry( cast_to=cast(Type[SummaryIndustryResponse], ResultWrapper[SummaryIndustryResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) async def ip_version( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of layer 3 attacks by IP version. @@ -1039,24 +1073,27 @@ async def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) async def protocol( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryProtocolResponse: """ Retrieves the distribution of layer 3 attacks by protocol. @@ -1121,26 +1158,29 @@ async def protocol( cast_to=cast(Type[SummaryProtocolResponse], ResultWrapper[SummaryProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) async def vector( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryVectorResponse: """ Retrieves the distribution of layer 3 attacks by vector. @@ -1213,26 +1253,29 @@ async def vector( cast_to=cast(Type[SummaryVectorResponse], ResultWrapper[SummaryVectorResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) async def vertical( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryVerticalResponse: """ Retrieves the distribution of layer 3 attacks by targeted vertical. @@ -1310,26 +1353,40 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.bitrate = to_raw_response_wrapper( - summary.bitrate, + self.bitrate = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.bitrate, # pyright: ignore[reportDeprecated], + ) ) - self.duration = to_raw_response_wrapper( - summary.duration, + self.duration = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.duration, # pyright: ignore[reportDeprecated], + ) ) - self.industry = to_raw_response_wrapper( - summary.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_raw_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.vector = to_raw_response_wrapper( - summary.vector, + self.vector = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.vector, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_raw_response_wrapper( - summary.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -1337,26 +1394,40 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.bitrate = async_to_raw_response_wrapper( - summary.bitrate, + self.bitrate = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.bitrate, # pyright: ignore[reportDeprecated], + ) ) - self.duration = async_to_raw_response_wrapper( - summary.duration, + self.duration = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.duration, # pyright: ignore[reportDeprecated], + ) ) - self.industry = async_to_raw_response_wrapper( - summary.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_raw_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.vector = async_to_raw_response_wrapper( - summary.vector, + self.vector = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.vector, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_raw_response_wrapper( - summary.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -1364,26 +1435,40 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.bitrate = to_streamed_response_wrapper( - summary.bitrate, + self.bitrate = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.bitrate, # pyright: ignore[reportDeprecated], + ) ) - self.duration = to_streamed_response_wrapper( - summary.duration, + self.duration = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.duration, # pyright: ignore[reportDeprecated], + ) ) - self.industry = to_streamed_response_wrapper( - summary.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_streamed_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.vector = to_streamed_response_wrapper( - summary.vector, + self.vector = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.vector, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_streamed_response_wrapper( - summary.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -1391,24 +1476,38 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.bitrate = async_to_streamed_response_wrapper( - summary.bitrate, + self.bitrate = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.bitrate, # pyright: ignore[reportDeprecated], + ) ) - self.duration = async_to_streamed_response_wrapper( - summary.duration, + self.duration = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.duration, # pyright: ignore[reportDeprecated], + ) ) - self.industry = async_to_streamed_response_wrapper( - summary.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_streamed_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.vector = async_to_streamed_response_wrapper( - summary.vector, + self.vector = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.vector, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_streamed_response_wrapper( - summary.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.vertical, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py index 4cc642eb8de..67b4cfd8914 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer3/timeseries_groups.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -60,27 +61,30 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon """ return TimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) def bitrate( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupBitrateResponse: """ Retrieves the distribution of layer 3 attacks by bitrate over time. @@ -157,27 +161,30 @@ def bitrate( cast_to=cast(Type[TimeseriesGroupBitrateResponse], ResultWrapper[TimeseriesGroupBitrateResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) def duration( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDurationResponse: """ Retrieves the distribution of layer 3 attacks by duration over time. @@ -254,28 +261,31 @@ def duration( cast_to=cast(Type[TimeseriesGroupDurationResponse], ResultWrapper[TimeseriesGroupDurationResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) def industry( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIndustryResponse: """ Retrieves the distribution of layer 3 attacks by targeted industry over time. @@ -357,26 +367,29 @@ def industry( cast_to=cast(Type[TimeseriesGroupIndustryResponse], ResultWrapper[TimeseriesGroupIndustryResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of layer 3 attacks by IP version over time. @@ -450,26 +463,29 @@ def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) def protocol( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupProtocolResponse: """ Retrieves the distribution of layer 3 attacks by protocol over time. @@ -543,28 +559,31 @@ def protocol( cast_to=cast(Type[TimeseriesGroupProtocolResponse], ResultWrapper[TimeseriesGroupProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) def vector( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupVectorResponse: """ Retrieves the distribution of layer 3 attacks by vector over time. @@ -646,28 +665,31 @@ def vector( cast_to=cast(Type[TimeseriesGroupVectorResponse], ResultWrapper[TimeseriesGroupVectorResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) def vertical( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupVerticalResponse: """ Retrieves the distribution of layer 3 attacks by targeted vertical over time. @@ -770,27 +792,30 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR """ return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) async def bitrate( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupBitrateResponse: """ Retrieves the distribution of layer 3 attacks by bitrate over time. @@ -867,27 +892,30 @@ async def bitrate( cast_to=cast(Type[TimeseriesGroupBitrateResponse], ResultWrapper[TimeseriesGroupBitrateResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) async def duration( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDurationResponse: """ Retrieves the distribution of layer 3 attacks by duration over time. @@ -964,28 +992,31 @@ async def duration( cast_to=cast(Type[TimeseriesGroupDurationResponse], ResultWrapper[TimeseriesGroupDurationResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) async def industry( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIndustryResponse: """ Retrieves the distribution of layer 3 attacks by targeted industry over time. @@ -1067,26 +1098,29 @@ async def industry( cast_to=cast(Type[TimeseriesGroupIndustryResponse], ResultWrapper[TimeseriesGroupIndustryResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) async def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of layer 3 attacks by IP version over time. @@ -1160,26 +1194,29 @@ async def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) async def protocol( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupProtocolResponse: """ Retrieves the distribution of layer 3 attacks by protocol over time. @@ -1253,28 +1290,31 @@ async def protocol( cast_to=cast(Type[TimeseriesGroupProtocolResponse], ResultWrapper[TimeseriesGroupProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) async def vector( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupVectorResponse: """ Retrieves the distribution of layer 3 attacks by vector over time. @@ -1356,28 +1396,31 @@ async def vector( cast_to=cast(Type[TimeseriesGroupVectorResponse], ResultWrapper[TimeseriesGroupVectorResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/timeseries_groups_v2/) instead." + ) async def vertical( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupVerticalResponse: """ Retrieves the distribution of layer 3 attacks by targeted vertical over time. @@ -1464,26 +1507,40 @@ class TimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bitrate = to_raw_response_wrapper( - timeseries_groups.bitrate, + self.bitrate = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.bitrate, # pyright: ignore[reportDeprecated], + ) ) - self.duration = to_raw_response_wrapper( - timeseries_groups.duration, + self.duration = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.duration, # pyright: ignore[reportDeprecated], + ) ) - self.industry = to_raw_response_wrapper( - timeseries_groups.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_raw_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.vector = to_raw_response_wrapper( - timeseries_groups.vector, + self.vector = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.vector, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_raw_response_wrapper( - timeseries_groups.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -1491,26 +1548,40 @@ class AsyncTimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bitrate = async_to_raw_response_wrapper( - timeseries_groups.bitrate, + self.bitrate = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.bitrate, # pyright: ignore[reportDeprecated], + ) ) - self.duration = async_to_raw_response_wrapper( - timeseries_groups.duration, + self.duration = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.duration, # pyright: ignore[reportDeprecated], + ) ) - self.industry = async_to_raw_response_wrapper( - timeseries_groups.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_raw_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.vector = async_to_raw_response_wrapper( - timeseries_groups.vector, + self.vector = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.vector, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_raw_response_wrapper( - timeseries_groups.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -1518,26 +1589,40 @@ class TimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bitrate = to_streamed_response_wrapper( - timeseries_groups.bitrate, + self.bitrate = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.bitrate, # pyright: ignore[reportDeprecated], + ) ) - self.duration = to_streamed_response_wrapper( - timeseries_groups.duration, + self.duration = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.duration, # pyright: ignore[reportDeprecated], + ) ) - self.industry = to_streamed_response_wrapper( - timeseries_groups.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_streamed_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.vector = to_streamed_response_wrapper( - timeseries_groups.vector, + self.vector = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.vector, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_streamed_response_wrapper( - timeseries_groups.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -1545,24 +1630,38 @@ class AsyncTimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bitrate = async_to_streamed_response_wrapper( - timeseries_groups.bitrate, + self.bitrate = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.bitrate, # pyright: ignore[reportDeprecated], + ) ) - self.duration = async_to_streamed_response_wrapper( - timeseries_groups.duration, + self.duration = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.duration, # pyright: ignore[reportDeprecated], + ) ) - self.industry = async_to_streamed_response_wrapper( - timeseries_groups.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_streamed_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.vector = async_to_streamed_response_wrapper( - timeseries_groups.vector, + self.vector = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.vector, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_streamed_response_wrapper( - timeseries_groups.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.vertical, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/attacks/layer3/top/locations.py b/src/cloudflare/resources/radar/attacks/layer3/top/locations.py index d84c93716f1..09853414110 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/top/locations.py +++ b/src/cloudflare/resources/radar/attacks/layer3/top/locations.py @@ -8,7 +8,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,22 +50,22 @@ def with_streaming_response(self) -> LocationsResourceWithStreamingResponse: def origin( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationOriginResponse: """ Retrieves the origin locations of layer 3 attacks. @@ -135,22 +135,22 @@ def origin( def target( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationTargetResponse: """ Retrieves the target locations of layer 3 attacks. @@ -241,22 +241,22 @@ def with_streaming_response(self) -> AsyncLocationsResourceWithStreamingResponse async def origin( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationOriginResponse: """ Retrieves the origin locations of layer 3 attacks. @@ -326,22 +326,22 @@ async def origin( async def target( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationTargetResponse: """ Retrieves the target locations of layer 3 attacks. diff --git a/src/cloudflare/resources/radar/attacks/layer3/top/top.py b/src/cloudflare/resources/radar/attacks/layer3/top/top.py index 8a901841d66..6b72beabd4e 100644 --- a/src/cloudflare/resources/radar/attacks/layer3/top/top.py +++ b/src/cloudflare/resources/radar/attacks/layer3/top/top.py @@ -17,7 +17,7 @@ LocationsResourceWithStreamingResponse, AsyncLocationsResourceWithStreamingResponse, ) -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -64,26 +64,26 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse: def attacks( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - limit_direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - limit_per_location: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - magnitude: Literal["MITIGATED_BYTES", "MITIGATED_ATTACKS"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + limit_direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + limit_per_location: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + magnitude: Literal["MITIGATED_BYTES", "MITIGATED_ATTACKS"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopAttacksResponse: """Retrieves the top layer 3 attacks from origin to target location. @@ -170,26 +170,28 @@ def attacks( cast_to=cast(Type[TopAttacksResponse], ResultWrapper[TopAttacksResponse]), ) - @typing_extensions.deprecated("deprecated") + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) def industry( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopIndustryResponse: """This endpoint is deprecated. @@ -258,26 +260,28 @@ def industry( cast_to=cast(Type[TopIndustryResponse], ResultWrapper[TopIndustryResponse]), ) - @typing_extensions.deprecated("deprecated") + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) def vertical( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopVerticalResponse: """This endpoint is deprecated. @@ -374,26 +378,26 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: async def attacks( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - limit_direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - limit_per_location: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - magnitude: Literal["MITIGATED_BYTES", "MITIGATED_ATTACKS"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN_MAX"] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + limit_direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + limit_per_location: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + magnitude: Literal["MITIGATED_BYTES", "MITIGATED_ATTACKS"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN_MAX"] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopAttacksResponse: """Retrieves the top layer 3 attacks from origin to target location. @@ -480,26 +484,28 @@ async def attacks( cast_to=cast(Type[TopAttacksResponse], ResultWrapper[TopAttacksResponse]), ) - @typing_extensions.deprecated("deprecated") + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) async def industry( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopIndustryResponse: """This endpoint is deprecated. @@ -568,26 +574,28 @@ async def industry( cast_to=cast(Type[TopIndustryResponse], ResultWrapper[TopIndustryResponse]), ) - @typing_extensions.deprecated("deprecated") + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead." + ) async def vertical( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopVerticalResponse: """This endpoint is deprecated. @@ -666,12 +674,12 @@ def __init__(self, top: TopResource) -> None: ) self.industry = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - top.industry # pyright: ignore[reportDeprecated], + top.industry, # pyright: ignore[reportDeprecated], ) ) self.vertical = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - top.vertical # pyright: ignore[reportDeprecated], + top.vertical, # pyright: ignore[reportDeprecated], ) ) @@ -689,12 +697,12 @@ def __init__(self, top: AsyncTopResource) -> None: ) self.industry = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - top.industry # pyright: ignore[reportDeprecated], + top.industry, # pyright: ignore[reportDeprecated], ) ) self.vertical = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - top.vertical # pyright: ignore[reportDeprecated], + top.vertical, # pyright: ignore[reportDeprecated], ) ) @@ -712,12 +720,12 @@ def __init__(self, top: TopResource) -> None: ) self.industry = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - top.industry # pyright: ignore[reportDeprecated], + top.industry, # pyright: ignore[reportDeprecated], ) ) self.vertical = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - top.vertical # pyright: ignore[reportDeprecated], + top.vertical, # pyright: ignore[reportDeprecated], ) ) @@ -735,12 +743,12 @@ def __init__(self, top: AsyncTopResource) -> None: ) self.industry = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - top.industry # pyright: ignore[reportDeprecated], + top.industry, # pyright: ignore[reportDeprecated], ) ) self.vertical = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - top.vertical # pyright: ignore[reportDeprecated], + top.vertical, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/radar/attacks/layer7/layer7.py b/src/cloudflare/resources/radar/attacks/layer7/layer7.py index 48e123f913e..675d45fe24b 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/layer7.py +++ b/src/cloudflare/resources/radar/attacks/layer7/layer7.py @@ -24,7 +24,7 @@ TopResourceWithStreamingResponse, AsyncTopResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -44,54 +44,758 @@ TimeseriesGroupsResourceWithStreamingResponse, AsyncTimeseriesGroupsResourceWithStreamingResponse, ) -from .....types.radar.attacks import layer7_timeseries_params +from .....types.radar.attacks import ( + layer7_summary_v2_params, + layer7_timeseries_params, + layer7_timeseries_groups_v2_params, +) +from .....types.radar.attacks.layer7_summary_v2_response import Layer7SummaryV2Response from .....types.radar.attacks.layer7_timeseries_response import Layer7TimeseriesResponse +from .....types.radar.attacks.layer7_timeseries_groups_v2_response import Layer7TimeseriesGroupsV2Response + +__all__ = ["Layer7Resource", "AsyncLayer7Resource"] + + +class Layer7Resource(SyncAPIResource): + @cached_property + def summary(self) -> SummaryResource: + return SummaryResource(self._client) + + @cached_property + def timeseries_groups(self) -> TimeseriesGroupsResource: + return TimeseriesGroupsResource(self._client) + + @cached_property + def top(self) -> TopResource: + return TopResource(self._client) + + @cached_property + def with_raw_response(self) -> Layer7ResourceWithRawResponse: + """ + 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 Layer7ResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> Layer7ResourceWithStreamingResponse: + """ + 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 Layer7ResourceWithStreamingResponse(self) + + def summary_v2( + self, + dimension: Literal[ + "HTTP_METHOD", "HTTP_VERSION", "IP_VERSION", "MANAGED_RULES", "MITIGATION_PRODUCT", "VERTICAL", "INDUSTRY" + ], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + http_method: List[ + Literal[ + "GET", + "POST", + "DELETE", + "PUT", + "HEAD", + "PURGE", + "OPTIONS", + "PROPFIND", + "MKCOL", + "PATCH", + "ACL", + "BCOPY", + "BDELETE", + "BMOVE", + "BPROPFIND", + "BPROPPATCH", + "CHECKIN", + "CHECKOUT", + "CONNECT", + "COPY", + "LABEL", + "LOCK", + "MERGE", + "MKACTIVITY", + "MKWORKSPACE", + "MOVE", + "NOTIFY", + "ORDERPATCH", + "POLL", + "PROPPATCH", + "REPORT", + "SEARCH", + "SUBSCRIBE", + "TRACE", + "UNCHECKOUT", + "UNLOCK", + "UNSUBSCRIBE", + "UPDATE", + "VERSIONCONTROL", + "BASELINECONTROL", + "XMSENUMATTS", + "RPC_OUT_DATA", + "RPC_IN_DATA", + "JSON", + "COOK", + "TRACK", + ] + ] + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + mitigation_product: List[ + Literal[ + "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" + ] + ] + | Omit = omit, + name: 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, + ) -> Layer7SummaryV2Response: + """ + Retrieves the distribution of layer 7 attacks by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + http_method: Filters results by HTTP method. + + http_version: Filters results by HTTP version. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + mitigation_product: Filters the results by layer 7 mitigation product. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/attacks/layer7/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "http_method": http_method, + "http_version": http_version, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "mitigation_product": mitigation_product, + "name": name, + }, + layer7_summary_v2_params.Layer7SummaryV2Params, + ), + post_parser=ResultWrapper[Layer7SummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[Layer7SummaryV2Response], ResultWrapper[Layer7SummaryV2Response]), + ) + + def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + http_method: List[ + Literal[ + "GET", + "POST", + "DELETE", + "PUT", + "HEAD", + "PURGE", + "OPTIONS", + "PROPFIND", + "MKCOL", + "PATCH", + "ACL", + "BCOPY", + "BDELETE", + "BMOVE", + "BPROPFIND", + "BPROPPATCH", + "CHECKIN", + "CHECKOUT", + "CONNECT", + "COPY", + "LABEL", + "LOCK", + "MERGE", + "MKACTIVITY", + "MKWORKSPACE", + "MOVE", + "NOTIFY", + "ORDERPATCH", + "POLL", + "PROPPATCH", + "REPORT", + "SEARCH", + "SUBSCRIBE", + "TRACE", + "UNCHECKOUT", + "UNLOCK", + "UNSUBSCRIBE", + "UPDATE", + "VERSIONCONTROL", + "BASELINECONTROL", + "XMSENUMATTS", + "RPC_OUT_DATA", + "RPC_IN_DATA", + "JSON", + "COOK", + "TRACK", + ] + ] + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + mitigation_product: List[ + Literal[ + "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" + ] + ] + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Layer7TimeseriesResponse: + """ + Retrieves layer 7 attacks over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + http_method: Filters results by HTTP method. + + http_version: Filters results by HTTP version. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + mitigation_product: Filters the results by layer 7 mitigation product. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/attacks/layer7/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "http_method": http_method, + "http_version": http_version, + "ip_version": ip_version, + "location": location, + "mitigation_product": mitigation_product, + "name": name, + "normalization": normalization, + }, + layer7_timeseries_params.Layer7TimeseriesParams, + ), + post_parser=ResultWrapper[Layer7TimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[Layer7TimeseriesResponse], ResultWrapper[Layer7TimeseriesResponse]), + ) + + def timeseries_groups_v2( + self, + dimension: Literal[ + "HTTP_METHOD", "HTTP_VERSION", "IP_VERSION", "MANAGED_RULES", "MITIGATION_PRODUCT", "VERTICAL", "INDUSTRY" + ], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + http_method: List[ + Literal[ + "GET", + "POST", + "DELETE", + "PUT", + "HEAD", + "PURGE", + "OPTIONS", + "PROPFIND", + "MKCOL", + "PATCH", + "ACL", + "BCOPY", + "BDELETE", + "BMOVE", + "BPROPFIND", + "BPROPPATCH", + "CHECKIN", + "CHECKOUT", + "CONNECT", + "COPY", + "LABEL", + "LOCK", + "MERGE", + "MKACTIVITY", + "MKWORKSPACE", + "MOVE", + "NOTIFY", + "ORDERPATCH", + "POLL", + "PROPPATCH", + "REPORT", + "SEARCH", + "SUBSCRIBE", + "TRACE", + "UNCHECKOUT", + "UNLOCK", + "UNSUBSCRIBE", + "UPDATE", + "VERSIONCONTROL", + "BASELINECONTROL", + "XMSENUMATTS", + "RPC_OUT_DATA", + "RPC_IN_DATA", + "JSON", + "COOK", + "TRACK", + ] + ] + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + mitigation_product: List[ + Literal[ + "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" + ] + ] + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Layer7TimeseriesGroupsV2Response: + """ + Retrieves the distribution of layer 7 attacks grouped by dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + http_method: Filters results by HTTP method. + + http_version: Filters results by HTTP version. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. -__all__ = ["Layer7Resource", "AsyncLayer7Resource"] + mitigation_product: Filters the results by layer 7 mitigation product. + name: Array of names used to label the series in the response. -class Layer7Resource(SyncAPIResource): + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/attacks/layer7/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "http_method": http_method, + "http_version": http_version, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "mitigation_product": mitigation_product, + "name": name, + "normalization": normalization, + }, + layer7_timeseries_groups_v2_params.Layer7TimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[Layer7TimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[Layer7TimeseriesGroupsV2Response], ResultWrapper[Layer7TimeseriesGroupsV2Response]), + ) + + +class AsyncLayer7Resource(AsyncAPIResource): @cached_property - def summary(self) -> SummaryResource: - return SummaryResource(self._client) + def summary(self) -> AsyncSummaryResource: + return AsyncSummaryResource(self._client) @cached_property - def timeseries_groups(self) -> TimeseriesGroupsResource: - return TimeseriesGroupsResource(self._client) + def timeseries_groups(self) -> AsyncTimeseriesGroupsResource: + return AsyncTimeseriesGroupsResource(self._client) @cached_property - def top(self) -> TopResource: - return TopResource(self._client) + def top(self) -> AsyncTopResource: + return AsyncTopResource(self._client) @cached_property - def with_raw_response(self) -> Layer7ResourceWithRawResponse: + def with_raw_response(self) -> AsyncLayer7ResourceWithRawResponse: """ 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 Layer7ResourceWithRawResponse(self) + return AsyncLayer7ResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> Layer7ResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncLayer7ResourceWithStreamingResponse: """ 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 Layer7ResourceWithStreamingResponse(self) + return AsyncLayer7ResourceWithStreamingResponse(self) - def timeseries( + async def summary_v2( + self, + dimension: Literal[ + "HTTP_METHOD", "HTTP_VERSION", "IP_VERSION", "MANAGED_RULES", "MITIGATION_PRODUCT", "VERTICAL", "INDUSTRY" + ], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + http_method: List[ + Literal[ + "GET", + "POST", + "DELETE", + "PUT", + "HEAD", + "PURGE", + "OPTIONS", + "PROPFIND", + "MKCOL", + "PATCH", + "ACL", + "BCOPY", + "BDELETE", + "BMOVE", + "BPROPFIND", + "BPROPPATCH", + "CHECKIN", + "CHECKOUT", + "CONNECT", + "COPY", + "LABEL", + "LOCK", + "MERGE", + "MKACTIVITY", + "MKWORKSPACE", + "MOVE", + "NOTIFY", + "ORDERPATCH", + "POLL", + "PROPPATCH", + "REPORT", + "SEARCH", + "SUBSCRIBE", + "TRACE", + "UNCHECKOUT", + "UNLOCK", + "UNSUBSCRIBE", + "UPDATE", + "VERSIONCONTROL", + "BASELINECONTROL", + "XMSENUMATTS", + "RPC_OUT_DATA", + "RPC_IN_DATA", + "JSON", + "COOK", + "TRACK", + ] + ] + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + mitigation_product: List[ + Literal[ + "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" + ] + ] + | Omit = omit, + name: 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, + ) -> Layer7SummaryV2Response: + """ + Retrieves the distribution of layer 7 attacks by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + http_method: Filters results by HTTP method. + + http_version: Filters results by HTTP version. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + mitigation_product: Filters the results by layer 7 mitigation product. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/attacks/layer7/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "http_method": http_method, + "http_version": http_version, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "mitigation_product": mitigation_product, + "name": name, + }, + layer7_summary_v2_params.Layer7SummaryV2Params, + ), + post_parser=ResultWrapper[Layer7SummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[Layer7SummaryV2Response], ResultWrapper[Layer7SummaryV2Response]), + ) + + async def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -142,24 +846,24 @@ def timeseries( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Layer7TimeseriesResponse: """ Retrieves layer 7 attacks over time. @@ -213,14 +917,14 @@ def timeseries( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return await self._get( "/radar/attacks/layer7/timeseries", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( + query=await async_maybe_transform( { "agg_interval": agg_interval, "asn": asn, @@ -244,49 +948,19 @@ def timeseries( cast_to=cast(Type[Layer7TimeseriesResponse], ResultWrapper[Layer7TimeseriesResponse]), ) - -class AsyncLayer7Resource(AsyncAPIResource): - @cached_property - def summary(self) -> AsyncSummaryResource: - return AsyncSummaryResource(self._client) - - @cached_property - def timeseries_groups(self) -> AsyncTimeseriesGroupsResource: - return AsyncTimeseriesGroupsResource(self._client) - - @cached_property - def top(self) -> AsyncTopResource: - return AsyncTopResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncLayer7ResourceWithRawResponse: - """ - 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 AsyncLayer7ResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLayer7ResourceWithStreamingResponse: - """ - 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 AsyncLayer7ResourceWithStreamingResponse(self) - - async def timeseries( + async def timeseries_groups_v2( self, + dimension: Literal[ + "HTTP_METHOD", "HTTP_VERSION", "IP_VERSION", "MANAGED_RULES", "MITIGATION_PRODUCT", "VERTICAL", "INDUSTRY" + ], *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -337,29 +1011,32 @@ async def timeseries( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Layer7TimeseriesResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Layer7TimeseriesGroupsV2Response: """ - Retrieves layer 7 attacks over time. + Retrieves the distribution of layer 7 attacks grouped by dimension over time. Args: + dimension: Specifies the attribute by which to group the results. + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). @@ -389,6 +1066,10 @@ async def timeseries( ip_version: Filters results by IP version (Ipv4 vs. IPv6). + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude locations from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -408,8 +1089,10 @@ async def timeseries( timeout: Override the client-level default timeout for this request, in seconds """ + if not dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") return await self._get( - "/radar/attacks/layer7/timeseries", + f"/radar/attacks/layer7/timeseries_groups/{dimension}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -427,16 +1110,17 @@ async def timeseries( "http_method": http_method, "http_version": http_version, "ip_version": ip_version, + "limit_per_group": limit_per_group, "location": location, "mitigation_product": mitigation_product, "name": name, "normalization": normalization, }, - layer7_timeseries_params.Layer7TimeseriesParams, + layer7_timeseries_groups_v2_params.Layer7TimeseriesGroupsV2Params, ), - post_parser=ResultWrapper[Layer7TimeseriesResponse]._unwrapper, + post_parser=ResultWrapper[Layer7TimeseriesGroupsV2Response]._unwrapper, ), - cast_to=cast(Type[Layer7TimeseriesResponse], ResultWrapper[Layer7TimeseriesResponse]), + cast_to=cast(Type[Layer7TimeseriesGroupsV2Response], ResultWrapper[Layer7TimeseriesGroupsV2Response]), ) @@ -444,9 +1128,15 @@ class Layer7ResourceWithRawResponse: def __init__(self, layer7: Layer7Resource) -> None: self._layer7 = layer7 + self.summary_v2 = to_raw_response_wrapper( + layer7.summary_v2, + ) self.timeseries = to_raw_response_wrapper( layer7.timeseries, ) + self.timeseries_groups_v2 = to_raw_response_wrapper( + layer7.timeseries_groups_v2, + ) @cached_property def summary(self) -> SummaryResourceWithRawResponse: @@ -465,9 +1155,15 @@ class AsyncLayer7ResourceWithRawResponse: def __init__(self, layer7: AsyncLayer7Resource) -> None: self._layer7 = layer7 + self.summary_v2 = async_to_raw_response_wrapper( + layer7.summary_v2, + ) self.timeseries = async_to_raw_response_wrapper( layer7.timeseries, ) + self.timeseries_groups_v2 = async_to_raw_response_wrapper( + layer7.timeseries_groups_v2, + ) @cached_property def summary(self) -> AsyncSummaryResourceWithRawResponse: @@ -486,9 +1182,15 @@ class Layer7ResourceWithStreamingResponse: def __init__(self, layer7: Layer7Resource) -> None: self._layer7 = layer7 + self.summary_v2 = to_streamed_response_wrapper( + layer7.summary_v2, + ) self.timeseries = to_streamed_response_wrapper( layer7.timeseries, ) + self.timeseries_groups_v2 = to_streamed_response_wrapper( + layer7.timeseries_groups_v2, + ) @cached_property def summary(self) -> SummaryResourceWithStreamingResponse: @@ -507,9 +1209,15 @@ class AsyncLayer7ResourceWithStreamingResponse: def __init__(self, layer7: AsyncLayer7Resource) -> None: self._layer7 = layer7 + self.summary_v2 = async_to_streamed_response_wrapper( + layer7.summary_v2, + ) self.timeseries = async_to_streamed_response_wrapper( layer7.timeseries, ) + self.timeseries_groups_v2 = async_to_streamed_response_wrapper( + layer7.timeseries_groups_v2, + ) @cached_property def summary(self) -> AsyncSummaryResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/radar/attacks/layer7/summary.py b/src/cloudflare/resources/radar/attacks/layer7/summary.py index 6d63ed5bfcb..d3215e11321 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/summary.py +++ b/src/cloudflare/resources/radar/attacks/layer7/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -60,32 +61,35 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) def http_method( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryHTTPMethodResponse: """ Retrieves the distribution of layer 7 attacks by HTTP method. @@ -163,15 +167,18 @@ def http_method( cast_to=cast(Type[SummaryHTTPMethodResponse], ResultWrapper[SummaryHTTPMethodResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) def http_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -222,22 +229,22 @@ def http_version( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryHTTPVersionResponse: """ Retrieves the distribution of layer 7 attacks by HTTP version. @@ -310,15 +317,18 @@ def http_version( cast_to=cast(Type[SummaryHTTPVersionResponse], ResultWrapper[SummaryHTTPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) def industry( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -369,24 +379,24 @@ def industry( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIndustryResponse: """ Retrieves the distribution of layer 7 attacks by targeted industry. @@ -467,15 +477,18 @@ def industry( cast_to=cast(Type[SummaryIndustryResponse], ResultWrapper[SummaryIndustryResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) def ip_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -526,22 +539,22 @@ def ip_version( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of layer 7 attacks by IP version. @@ -614,15 +627,18 @@ def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) def managed_rules( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -673,24 +689,24 @@ def managed_rules( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryManagedRulesResponse: """ Retrieves the distribution of layer 7 attacks by managed rules. @@ -771,15 +787,18 @@ def managed_rules( cast_to=cast(Type[SummaryManagedRulesResponse], ResultWrapper[SummaryManagedRulesResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) def mitigation_product( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -830,18 +849,18 @@ def mitigation_product( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryMitigationProductResponse: """ Retrieves the distribution of layer 7 attacks by mitigation product. @@ -919,15 +938,18 @@ def mitigation_product( cast_to=cast(Type[SummaryMitigationProductResponse], ResultWrapper[SummaryMitigationProductResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) def vertical( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -978,24 +1000,24 @@ def vertical( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryVerticalResponse: """ Retrieves the distribution of layer 7 attacks by targeted vertical. @@ -1097,32 +1119,35 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) async def http_method( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryHTTPMethodResponse: """ Retrieves the distribution of layer 7 attacks by HTTP method. @@ -1200,15 +1225,18 @@ async def http_method( cast_to=cast(Type[SummaryHTTPMethodResponse], ResultWrapper[SummaryHTTPMethodResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) async def http_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -1259,22 +1287,22 @@ async def http_version( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryHTTPVersionResponse: """ Retrieves the distribution of layer 7 attacks by HTTP version. @@ -1347,15 +1375,18 @@ async def http_version( cast_to=cast(Type[SummaryHTTPVersionResponse], ResultWrapper[SummaryHTTPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) async def industry( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -1406,24 +1437,24 @@ async def industry( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIndustryResponse: """ Retrieves the distribution of layer 7 attacks by targeted industry. @@ -1504,15 +1535,18 @@ async def industry( cast_to=cast(Type[SummaryIndustryResponse], ResultWrapper[SummaryIndustryResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) async def ip_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -1563,22 +1597,22 @@ async def ip_version( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of layer 7 attacks by IP version. @@ -1651,15 +1685,18 @@ async def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) async def managed_rules( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -1710,24 +1747,24 @@ async def managed_rules( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryManagedRulesResponse: """ Retrieves the distribution of layer 7 attacks by managed rules. @@ -1808,15 +1845,18 @@ async def managed_rules( cast_to=cast(Type[SummaryManagedRulesResponse], ResultWrapper[SummaryManagedRulesResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) async def mitigation_product( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -1867,18 +1907,18 @@ async def mitigation_product( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryMitigationProductResponse: """ Retrieves the distribution of layer 7 attacks by mitigation product. @@ -1956,15 +1996,18 @@ async def mitigation_product( cast_to=cast(Type[SummaryMitigationProductResponse], ResultWrapper[SummaryMitigationProductResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) async def vertical( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -2015,24 +2058,24 @@ async def vertical( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryVerticalResponse: """ Retrieves the distribution of layer 7 attacks by targeted vertical. @@ -2118,26 +2161,40 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.http_method = to_raw_response_wrapper( - summary.http_method, + self.http_method = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.http_method, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = to_raw_response_wrapper( - summary.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.industry = to_raw_response_wrapper( - summary.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.managed_rules = to_raw_response_wrapper( - summary.managed_rules, + self.managed_rules = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.managed_rules, # pyright: ignore[reportDeprecated], + ) ) - self.mitigation_product = to_raw_response_wrapper( - summary.mitigation_product, + self.mitigation_product = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.mitigation_product, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_raw_response_wrapper( - summary.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -2145,26 +2202,40 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.http_method = async_to_raw_response_wrapper( - summary.http_method, + self.http_method = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.http_method, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = async_to_raw_response_wrapper( - summary.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.industry = async_to_raw_response_wrapper( - summary.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.managed_rules = async_to_raw_response_wrapper( - summary.managed_rules, + self.managed_rules = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.managed_rules, # pyright: ignore[reportDeprecated], + ) ) - self.mitigation_product = async_to_raw_response_wrapper( - summary.mitigation_product, + self.mitigation_product = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.mitigation_product, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_raw_response_wrapper( - summary.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -2172,26 +2243,40 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.http_method = to_streamed_response_wrapper( - summary.http_method, + self.http_method = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.http_method, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = to_streamed_response_wrapper( - summary.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.industry = to_streamed_response_wrapper( - summary.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.managed_rules = to_streamed_response_wrapper( - summary.managed_rules, + self.managed_rules = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.managed_rules, # pyright: ignore[reportDeprecated], + ) ) - self.mitigation_product = to_streamed_response_wrapper( - summary.mitigation_product, + self.mitigation_product = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.mitigation_product, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_streamed_response_wrapper( - summary.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -2199,24 +2284,38 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.http_method = async_to_streamed_response_wrapper( - summary.http_method, + self.http_method = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.http_method, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = async_to_streamed_response_wrapper( - summary.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.industry = async_to_streamed_response_wrapper( - summary.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.managed_rules = async_to_streamed_response_wrapper( - summary.managed_rules, + self.managed_rules = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.managed_rules, # pyright: ignore[reportDeprecated], + ) ) - self.mitigation_product = async_to_streamed_response_wrapper( - summary.mitigation_product, + self.mitigation_product = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.mitigation_product, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_streamed_response_wrapper( - summary.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.vertical, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py index 0170f285680..0928b6cb194 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py +++ b/src/cloudflare/resources/radar/attacks/layer7/timeseries_groups.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -62,34 +63,37 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon """ return TimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) def http_method( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupHTTPMethodResponse: """ Retrieves the distribution of layer 7 attacks by HTTP method over time. @@ -176,16 +180,19 @@ def http_method( cast_to=cast(Type[TimeseriesGroupHTTPMethodResponse], ResultWrapper[TimeseriesGroupHTTPMethodResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) def http_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -236,23 +243,23 @@ def http_version( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupHTTPVersionResponse: """ Retrieves the distribution of layer 7 attacks by HTTP version over time. @@ -334,16 +341,19 @@ def http_version( cast_to=cast(Type[TimeseriesGroupHTTPVersionResponse], ResultWrapper[TimeseriesGroupHTTPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) def industry( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -394,25 +404,25 @@ def industry( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIndustryResponse: """ Retrieves the distribution of layer 7 attacks by targeted industry over time. @@ -502,16 +512,19 @@ def industry( cast_to=cast(Type[TimeseriesGroupIndustryResponse], ResultWrapper[TimeseriesGroupIndustryResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -562,23 +575,23 @@ def ip_version( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of layer 7 attacks by IP version used over time. @@ -660,16 +673,19 @@ def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) def managed_rules( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -720,25 +736,25 @@ def managed_rules( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupManagedRulesResponse: """ Retrieves the distribution of layer 7 attacks by managed rules over time. @@ -828,16 +844,19 @@ def managed_rules( cast_to=cast(Type[TimeseriesGroupManagedRulesResponse], ResultWrapper[TimeseriesGroupManagedRulesResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) def mitigation_product( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -888,19 +907,19 @@ def mitigation_product( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupMitigationProductResponse: """ Retrieves the distribution of layer 7 attacks by mitigation product over time. @@ -989,16 +1008,19 @@ def mitigation_product( ), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) def vertical( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -1049,25 +1071,25 @@ def vertical( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupVerticalResponse: """ Retrieves the distribution of layer 7 attacks by targeted vertical over time. @@ -1178,34 +1200,37 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR """ return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) async def http_method( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupHTTPMethodResponse: """ Retrieves the distribution of layer 7 attacks by HTTP method over time. @@ -1292,16 +1317,19 @@ async def http_method( cast_to=cast(Type[TimeseriesGroupHTTPMethodResponse], ResultWrapper[TimeseriesGroupHTTPMethodResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) async def http_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -1352,23 +1380,23 @@ async def http_version( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupHTTPVersionResponse: """ Retrieves the distribution of layer 7 attacks by HTTP version over time. @@ -1450,16 +1478,19 @@ async def http_version( cast_to=cast(Type[TimeseriesGroupHTTPVersionResponse], ResultWrapper[TimeseriesGroupHTTPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) async def industry( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -1510,25 +1541,25 @@ async def industry( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIndustryResponse: """ Retrieves the distribution of layer 7 attacks by targeted industry over time. @@ -1618,16 +1649,19 @@ async def industry( cast_to=cast(Type[TimeseriesGroupIndustryResponse], ResultWrapper[TimeseriesGroupIndustryResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) async def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -1678,23 +1712,23 @@ async def ip_version( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of layer 7 attacks by IP version used over time. @@ -1776,16 +1810,19 @@ async def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) async def managed_rules( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -1836,25 +1873,25 @@ async def managed_rules( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupManagedRulesResponse: """ Retrieves the distribution of layer 7 attacks by managed rules over time. @@ -1944,16 +1981,19 @@ async def managed_rules( cast_to=cast(Type[TimeseriesGroupManagedRulesResponse], ResultWrapper[TimeseriesGroupManagedRulesResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) async def mitigation_product( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -2004,19 +2044,19 @@ async def mitigation_product( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupMitigationProductResponse: """ Retrieves the distribution of layer 7 attacks by mitigation product over time. @@ -2105,16 +2145,19 @@ async def mitigation_product( ), ) + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/timeseries_groups_v2/) instead." + ) async def vertical( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -2165,25 +2208,25 @@ async def vertical( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupVerticalResponse: """ Retrieves the distribution of layer 7 attacks by targeted vertical over time. @@ -2278,26 +2321,40 @@ class TimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.http_method = to_raw_response_wrapper( - timeseries_groups.http_method, + self.http_method = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.http_method, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = to_raw_response_wrapper( - timeseries_groups.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.industry = to_raw_response_wrapper( - timeseries_groups.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.managed_rules = to_raw_response_wrapper( - timeseries_groups.managed_rules, + self.managed_rules = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.managed_rules, # pyright: ignore[reportDeprecated], + ) ) - self.mitigation_product = to_raw_response_wrapper( - timeseries_groups.mitigation_product, + self.mitigation_product = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.mitigation_product, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_raw_response_wrapper( - timeseries_groups.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -2305,26 +2362,40 @@ class AsyncTimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.http_method = async_to_raw_response_wrapper( - timeseries_groups.http_method, + self.http_method = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.http_method, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = async_to_raw_response_wrapper( - timeseries_groups.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.industry = async_to_raw_response_wrapper( - timeseries_groups.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.managed_rules = async_to_raw_response_wrapper( - timeseries_groups.managed_rules, + self.managed_rules = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.managed_rules, # pyright: ignore[reportDeprecated], + ) ) - self.mitigation_product = async_to_raw_response_wrapper( - timeseries_groups.mitigation_product, + self.mitigation_product = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.mitigation_product, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_raw_response_wrapper( - timeseries_groups.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -2332,26 +2403,40 @@ class TimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.http_method = to_streamed_response_wrapper( - timeseries_groups.http_method, + self.http_method = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.http_method, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = to_streamed_response_wrapper( - timeseries_groups.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.industry = to_streamed_response_wrapper( - timeseries_groups.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.managed_rules = to_streamed_response_wrapper( - timeseries_groups.managed_rules, + self.managed_rules = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.managed_rules, # pyright: ignore[reportDeprecated], + ) ) - self.mitigation_product = to_streamed_response_wrapper( - timeseries_groups.mitigation_product, + self.mitigation_product = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.mitigation_product, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = to_streamed_response_wrapper( - timeseries_groups.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.vertical, # pyright: ignore[reportDeprecated], + ) ) @@ -2359,24 +2444,38 @@ class AsyncTimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.http_method = async_to_streamed_response_wrapper( - timeseries_groups.http_method, + self.http_method = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.http_method, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = async_to_streamed_response_wrapper( - timeseries_groups.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.industry = async_to_streamed_response_wrapper( - timeseries_groups.industry, + self.industry = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.industry, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.managed_rules = async_to_streamed_response_wrapper( - timeseries_groups.managed_rules, + self.managed_rules = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.managed_rules, # pyright: ignore[reportDeprecated], + ) ) - self.mitigation_product = async_to_streamed_response_wrapper( - timeseries_groups.mitigation_product, + self.mitigation_product = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.mitigation_product, # pyright: ignore[reportDeprecated], + ) ) - self.vertical = async_to_streamed_response_wrapper( - timeseries_groups.vertical, + self.vertical = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.vertical, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/attacks/layer7/top/ases.py b/src/cloudflare/resources/radar/attacks/layer7/top/ases.py index 888c66e7c9f..bc61c790e0c 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/top/ases.py +++ b/src/cloudflare/resources/radar/attacks/layer7/top/ases.py @@ -8,7 +8,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,11 +49,11 @@ def with_streaming_response(self) -> AsesResourceWithStreamingResponse: def origin( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -104,24 +104,24 @@ def origin( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AseOriginResponse: """Retrieves the top origin autonomous systems of layer 7 attacks. @@ -221,11 +221,11 @@ def with_streaming_response(self) -> AsyncAsesResourceWithStreamingResponse: async def origin( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -276,24 +276,24 @@ async def origin( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AseOriginResponse: """Retrieves the top origin autonomous systems of layer 7 attacks. diff --git a/src/cloudflare/resources/radar/attacks/layer7/top/locations.py b/src/cloudflare/resources/radar/attacks/layer7/top/locations.py index 5c020668215..80bdf41d29a 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/top/locations.py +++ b/src/cloudflare/resources/radar/attacks/layer7/top/locations.py @@ -8,7 +8,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,12 +50,12 @@ def with_streaming_response(self) -> LocationsResourceWithStreamingResponse: def origin( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -106,23 +106,23 @@ def origin( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationOriginResponse: """Retrieves the top origin locations of layer 7 attacks. @@ -202,25 +202,25 @@ def origin( def target( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationTargetResponse: """Retrieves the top target locations of and by layer 7 attacks. @@ -306,12 +306,12 @@ def with_streaming_response(self) -> AsyncLocationsResourceWithStreamingResponse async def origin( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -362,23 +362,23 @@ async def origin( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationOriginResponse: """Retrieves the top origin locations of layer 7 attacks. @@ -458,25 +458,25 @@ async def origin( async def target( self, *, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationTargetResponse: """Retrieves the top target locations of and by layer 7 attacks. diff --git a/src/cloudflare/resources/radar/attacks/layer7/top/top.py b/src/cloudflare/resources/radar/attacks/layer7/top/top.py index 30db6b97c5d..1425265b1a5 100644 --- a/src/cloudflare/resources/radar/attacks/layer7/top/top.py +++ b/src/cloudflare/resources/radar/attacks/layer7/top/top.py @@ -25,7 +25,7 @@ LocationsResourceWithStreamingResponse, AsyncLocationsResourceWithStreamingResponse, ) -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -76,31 +76,30 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse: def attacks( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - limit_direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - limit_per_location: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - magnitude: Literal["AFFECTED_ZONES", "MITIGATED_REQUESTS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + limit_direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + limit_per_location: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopAttacksResponse: """Retrieves the top attacks from origin to target location. @@ -142,9 +141,6 @@ def attacks( Prefix with `-` to exclude locations from results. For example, `-US,PT` excludes results from the US, but includes results from PT. - magnitude: Deprecated parameter. Future support includes only attack magnitude defined by - total mitigated requests (MITIGATED_REQUESTS). - mitigation_product: Filters the results by layer 7 mitigation product. name: Array of names used to label the series in the response. @@ -179,7 +175,6 @@ def attacks( "limit_direction": limit_direction, "limit_per_location": limit_per_location, "location": location, - "magnitude": magnitude, "mitigation_product": mitigation_product, "name": name, "normalization": normalization, @@ -191,16 +186,18 @@ def attacks( cast_to=cast(Type[TopAttacksResponse], ResultWrapper[TopAttacksResponse]), ) - @typing_extensions.deprecated("deprecated") + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) def industry( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -251,24 +248,24 @@ def industry( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopIndustryResponse: """This endpoint is deprecated. @@ -349,16 +346,18 @@ def industry( cast_to=cast(Type[TopIndustryResponse], ResultWrapper[TopIndustryResponse]), ) - @typing_extensions.deprecated("deprecated") + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) def vertical( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -409,24 +408,24 @@ def vertical( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopVerticalResponse: """This endpoint is deprecated. @@ -539,31 +538,30 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: async def attacks( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - limit_direction: Literal["ORIGIN", "TARGET"] | NotGiven = NOT_GIVEN, - limit_per_location: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - magnitude: Literal["AFFECTED_ZONES", "MITIGATED_REQUESTS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + limit_direction: Literal["ORIGIN", "TARGET"] | Omit = omit, + limit_per_location: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE", "MIN_MAX"] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN_MAX"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopAttacksResponse: """Retrieves the top attacks from origin to target location. @@ -605,9 +603,6 @@ async def attacks( Prefix with `-` to exclude locations from results. For example, `-US,PT` excludes results from the US, but includes results from PT. - magnitude: Deprecated parameter. Future support includes only attack magnitude defined by - total mitigated requests (MITIGATED_REQUESTS). - mitigation_product: Filters the results by layer 7 mitigation product. name: Array of names used to label the series in the response. @@ -642,7 +637,6 @@ async def attacks( "limit_direction": limit_direction, "limit_per_location": limit_per_location, "location": location, - "magnitude": magnitude, "mitigation_product": mitigation_product, "name": name, "normalization": normalization, @@ -654,16 +648,18 @@ async def attacks( cast_to=cast(Type[TopAttacksResponse], ResultWrapper[TopAttacksResponse]), ) - @typing_extensions.deprecated("deprecated") + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) async def industry( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -714,24 +710,24 @@ async def industry( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopIndustryResponse: """This endpoint is deprecated. @@ -812,16 +808,18 @@ async def industry( cast_to=cast(Type[TopIndustryResponse], ResultWrapper[TopIndustryResponse]), ) - @typing_extensions.deprecated("deprecated") + @typing_extensions.deprecated( + "Use [Radar Attacks Layer 7 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer7/methods/summary_v2/) instead." + ) async def vertical( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, http_method: List[ Literal[ "GET", @@ -872,24 +870,24 @@ async def vertical( "TRACK", ] ] - | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, mitigation_product: List[ Literal[ "DDOS", "WAF", "BOT_MANAGEMENT", "ACCESS_RULES", "IP_REPUTATION", "API_SHIELD", "DATA_LOSS_PREVENTION" ] ] - | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopVerticalResponse: """This endpoint is deprecated. @@ -980,12 +978,12 @@ def __init__(self, top: TopResource) -> None: ) self.industry = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - top.industry # pyright: ignore[reportDeprecated], + top.industry, # pyright: ignore[reportDeprecated], ) ) self.vertical = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - top.vertical # pyright: ignore[reportDeprecated], + top.vertical, # pyright: ignore[reportDeprecated], ) ) @@ -1007,12 +1005,12 @@ def __init__(self, top: AsyncTopResource) -> None: ) self.industry = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - top.industry # pyright: ignore[reportDeprecated], + top.industry, # pyright: ignore[reportDeprecated], ) ) self.vertical = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - top.vertical # pyright: ignore[reportDeprecated], + top.vertical, # pyright: ignore[reportDeprecated], ) ) @@ -1034,12 +1032,12 @@ def __init__(self, top: TopResource) -> None: ) self.industry = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - top.industry # pyright: ignore[reportDeprecated], + top.industry, # pyright: ignore[reportDeprecated], ) ) self.vertical = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - top.vertical # pyright: ignore[reportDeprecated], + top.vertical, # pyright: ignore[reportDeprecated], ) ) @@ -1061,12 +1059,12 @@ def __init__(self, top: AsyncTopResource) -> None: ) self.industry = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - top.industry # pyright: ignore[reportDeprecated], + top.industry, # pyright: ignore[reportDeprecated], ) ) self.vertical = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - top.vertical # pyright: ignore[reportDeprecated], + top.vertical, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/radar/bgp/bgp.py b/src/cloudflare/resources/radar/bgp/bgp.py index 0b4f1f2da41..b74b7fc715e 100644 --- a/src/cloudflare/resources/radar/bgp/bgp.py +++ b/src/cloudflare/resources/radar/bgp/bgp.py @@ -32,7 +32,7 @@ TopResourceWithStreamingResponse, AsyncTopResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .leaks.leaks import ( @@ -109,21 +109,21 @@ def with_streaming_response(self) -> BGPResourceWithStreamingResponse: def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - prefix: List[str] | NotGiven = NOT_GIVEN, - update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + prefix: SequenceNotStr[str] | Omit = omit, + update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BGPTimeseriesResponse: """Retrieves BGP updates over time. @@ -234,21 +234,21 @@ def with_streaming_response(self) -> AsyncBGPResourceWithStreamingResponse: async def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - prefix: List[str] | NotGiven = NOT_GIVEN, - update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + prefix: SequenceNotStr[str] | Omit = omit, + update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BGPTimeseriesResponse: """Retrieves BGP updates over time. diff --git a/src/cloudflare/resources/radar/bgp/hijacks/events.py b/src/cloudflare/resources/radar/bgp/hijacks/events.py index 1490364e3b7..7712368c60b 100644 --- a/src/cloudflare/resources/radar/bgp/hijacks/events.py +++ b/src/cloudflare/resources/radar/bgp/hijacks/events.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,28 +49,28 @@ def with_streaming_response(self) -> EventsResourceWithStreamingResponse: def list( self, *, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - event_id: int | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - hijacker_asn: int | NotGiven = NOT_GIVEN, - involved_asn: int | NotGiven = NOT_GIVEN, - involved_country: str | NotGiven = NOT_GIVEN, - max_confidence: int | NotGiven = NOT_GIVEN, - min_confidence: int | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - prefix: str | NotGiven = NOT_GIVEN, - sort_by: Literal["ID", "TIME", "CONFIDENCE"] | NotGiven = NOT_GIVEN, - sort_order: Literal["ASC", "DESC"] | NotGiven = NOT_GIVEN, - victim_asn: int | NotGiven = NOT_GIVEN, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + event_id: int | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + hijacker_asn: int | Omit = omit, + involved_asn: int | Omit = omit, + involved_country: str | Omit = omit, + max_confidence: int | Omit = omit, + min_confidence: int | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + prefix: str | Omit = omit, + sort_by: Literal["ID", "TIME", "CONFIDENCE"] | Omit = omit, + sort_order: Literal["ASC", "DESC"] | Omit = omit, + victim_asn: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[EventListResponse]: """ Retrieves the BGP hijack events. @@ -173,28 +173,28 @@ def with_streaming_response(self) -> AsyncEventsResourceWithStreamingResponse: def list( self, *, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - event_id: int | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - hijacker_asn: int | NotGiven = NOT_GIVEN, - involved_asn: int | NotGiven = NOT_GIVEN, - involved_country: str | NotGiven = NOT_GIVEN, - max_confidence: int | NotGiven = NOT_GIVEN, - min_confidence: int | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - prefix: str | NotGiven = NOT_GIVEN, - sort_by: Literal["ID", "TIME", "CONFIDENCE"] | NotGiven = NOT_GIVEN, - sort_order: Literal["ASC", "DESC"] | NotGiven = NOT_GIVEN, - victim_asn: int | NotGiven = NOT_GIVEN, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + event_id: int | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + hijacker_asn: int | Omit = omit, + involved_asn: int | Omit = omit, + involved_country: str | Omit = omit, + max_confidence: int | Omit = omit, + min_confidence: int | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + prefix: str | Omit = omit, + sort_by: Literal["ID", "TIME", "CONFIDENCE"] | Omit = omit, + sort_order: Literal["ASC", "DESC"] | Omit = omit, + victim_asn: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EventListResponse, AsyncV4PagePagination[EventListResponse]]: """ Retrieves the BGP hijack events. diff --git a/src/cloudflare/resources/radar/bgp/ips.py b/src/cloudflare/resources/radar/bgp/ips.py index cda263e3d1f..ed5d5aa4891 100644 --- a/src/cloudflare/resources/radar/bgp/ips.py +++ b/src/cloudflare/resources/radar/bgp/ips.py @@ -8,7 +8,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,21 +49,21 @@ def with_streaming_response(self) -> IPsResourceWithStreamingResponse: def timeseries( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - include_delay: bool | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + include_delay: bool | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPTimeseriesResponse: """ Retrieves time series data for the announced IP space count, represented as the @@ -152,21 +152,21 @@ def with_streaming_response(self) -> AsyncIPsResourceWithStreamingResponse: async def timeseries( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - include_delay: bool | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + include_delay: bool | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPTimeseriesResponse: """ Retrieves time series data for the announced IP space count, represented as the diff --git a/src/cloudflare/resources/radar/bgp/leaks/events.py b/src/cloudflare/resources/radar/bgp/leaks/events.py index e4901f80256..7805f10972f 100644 --- a/src/cloudflare/resources/radar/bgp/leaks/events.py +++ b/src/cloudflare/resources/radar/bgp/leaks/events.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,24 +49,24 @@ def with_streaming_response(self) -> EventsResourceWithStreamingResponse: def list( self, *, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - event_id: int | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - involved_asn: int | NotGiven = NOT_GIVEN, - involved_country: str | NotGiven = NOT_GIVEN, - leak_asn: int | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - sort_by: Literal["ID", "LEAKS", "PEERS", "PREFIXES", "ORIGINS", "TIME"] | NotGiven = NOT_GIVEN, - sort_order: Literal["ASC", "DESC"] | NotGiven = NOT_GIVEN, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + event_id: int | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + involved_asn: int | Omit = omit, + involved_country: str | Omit = omit, + leak_asn: int | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + sort_by: Literal["ID", "LEAKS", "PEERS", "PREFIXES", "ORIGINS", "TIME"] | Omit = omit, + sort_order: Literal["ASC", "DESC"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[EventListResponse]: """ Retrieves the BGP route leak events. @@ -157,24 +157,24 @@ def with_streaming_response(self) -> AsyncEventsResourceWithStreamingResponse: def list( self, *, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - event_id: int | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - involved_asn: int | NotGiven = NOT_GIVEN, - involved_country: str | NotGiven = NOT_GIVEN, - leak_asn: int | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - sort_by: Literal["ID", "LEAKS", "PEERS", "PREFIXES", "ORIGINS", "TIME"] | NotGiven = NOT_GIVEN, - sort_order: Literal["ASC", "DESC"] | NotGiven = NOT_GIVEN, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + event_id: int | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + involved_asn: int | Omit = omit, + involved_country: str | Omit = omit, + leak_asn: int | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + sort_by: Literal["ID", "LEAKS", "PEERS", "PREFIXES", "ORIGINS", "TIME"] | Omit = omit, + sort_order: Literal["ASC", "DESC"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EventListResponse, AsyncV4PagePagination[EventListResponse]]: """ Retrieves the BGP route leak events. diff --git a/src/cloudflare/resources/radar/bgp/routes.py b/src/cloudflare/resources/radar/bgp/routes.py index b975345445f..9d9a2f8d0a3 100644 --- a/src/cloudflare/resources/radar/bgp/routes.py +++ b/src/cloudflare/resources/radar/bgp/routes.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,18 +58,17 @@ def with_streaming_response(self) -> RoutesResourceWithStreamingResponse: def ases( self, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - sort_by: Literal["cone", "pfxs", "ipv4", "ipv6", "rpki_valid", "rpki_invalid", "rpki_unknown"] - | NotGiven = NOT_GIVEN, - sort_order: Literal["ASC", "DESC"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | Omit = omit, + sort_by: Literal["cone", "pfxs", "ipv4", "ipv6", "rpki_valid", "rpki_invalid", "rpki_unknown"] | Omit = omit, + sort_order: Literal["ASC", "DESC"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteAsesResponse: """ Retrieves all ASes in the current global routing tables with routing statistics. @@ -118,16 +117,16 @@ def ases( def moas( self, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - invalid_only: bool | NotGiven = NOT_GIVEN, - origin: int | NotGiven = NOT_GIVEN, - prefix: str | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, + invalid_only: bool | Omit = omit, + origin: int | Omit = omit, + prefix: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteMoasResponse: """ Retrieves all Multi-Origin AS (MOAS) prefixes in the global routing tables. @@ -173,17 +172,17 @@ def moas( def pfx2as( self, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - longest_prefix_match: bool | NotGiven = NOT_GIVEN, - origin: int | NotGiven = NOT_GIVEN, - prefix: str | NotGiven = NOT_GIVEN, - rpki_status: Literal["VALID", "INVALID", "UNKNOWN"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, + longest_prefix_match: bool | Omit = omit, + origin: int | Omit = omit, + prefix: str | Omit = omit, + rpki_status: Literal["VALID", "INVALID", "UNKNOWN"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RoutePfx2asResponse: """ Retrieves the prefix-to-ASN mapping from global routing tables. @@ -233,14 +232,14 @@ def pfx2as( def realtime( self, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - prefix: str | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, + prefix: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteRealtimeResponse: """ Retrieves real-time BGP routes for a prefix, using public real-time data @@ -281,15 +280,15 @@ def realtime( def stats( self, *, - asn: int | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, + asn: int | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteStatsResponse: """ Retrieves the BGP routing table stats. @@ -354,18 +353,17 @@ def with_streaming_response(self) -> AsyncRoutesResourceWithStreamingResponse: async def ases( self, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - sort_by: Literal["cone", "pfxs", "ipv4", "ipv6", "rpki_valid", "rpki_invalid", "rpki_unknown"] - | NotGiven = NOT_GIVEN, - sort_order: Literal["ASC", "DESC"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | Omit = omit, + sort_by: Literal["cone", "pfxs", "ipv4", "ipv6", "rpki_valid", "rpki_invalid", "rpki_unknown"] | Omit = omit, + sort_order: Literal["ASC", "DESC"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteAsesResponse: """ Retrieves all ASes in the current global routing tables with routing statistics. @@ -414,16 +412,16 @@ async def ases( async def moas( self, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - invalid_only: bool | NotGiven = NOT_GIVEN, - origin: int | NotGiven = NOT_GIVEN, - prefix: str | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, + invalid_only: bool | Omit = omit, + origin: int | Omit = omit, + prefix: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteMoasResponse: """ Retrieves all Multi-Origin AS (MOAS) prefixes in the global routing tables. @@ -469,17 +467,17 @@ async def moas( async def pfx2as( self, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - longest_prefix_match: bool | NotGiven = NOT_GIVEN, - origin: int | NotGiven = NOT_GIVEN, - prefix: str | NotGiven = NOT_GIVEN, - rpki_status: Literal["VALID", "INVALID", "UNKNOWN"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, + longest_prefix_match: bool | Omit = omit, + origin: int | Omit = omit, + prefix: str | Omit = omit, + rpki_status: Literal["VALID", "INVALID", "UNKNOWN"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RoutePfx2asResponse: """ Retrieves the prefix-to-ASN mapping from global routing tables. @@ -529,14 +527,14 @@ async def pfx2as( async def realtime( self, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - prefix: str | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, + prefix: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteRealtimeResponse: """ Retrieves real-time BGP routes for a prefix, using public real-time data @@ -577,15 +575,15 @@ async def realtime( async def stats( self, *, - asn: int | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, + asn: int | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteStatsResponse: """ Retrieves the BGP routing table stats. diff --git a/src/cloudflare/resources/radar/bgp/top/ases.py b/src/cloudflare/resources/radar/bgp/top/ases.py index f183582f10e..344ead212cc 100644 --- a/src/cloudflare/resources/radar/bgp/top/ases.py +++ b/src/cloudflare/resources/radar/bgp/top/ases.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,21 +50,21 @@ def with_streaming_response(self) -> AsesResourceWithStreamingResponse: def get( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - prefix: List[str] | NotGiven = NOT_GIVEN, - update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + prefix: SequenceNotStr[str] | Omit = omit, + update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AseGetResponse: """ Retrieves the top autonomous systems by BGP updates (announcements only). @@ -130,15 +130,15 @@ def get( def prefixes( self, *, - country: str | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, + country: str | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsePrefixesResponse: """ Retrieves the full list of autonomous systems on the global routing table @@ -204,21 +204,21 @@ def with_streaming_response(self) -> AsyncAsesResourceWithStreamingResponse: async def get( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - prefix: List[str] | NotGiven = NOT_GIVEN, - update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + prefix: SequenceNotStr[str] | Omit = omit, + update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AseGetResponse: """ Retrieves the top autonomous systems by BGP updates (announcements only). @@ -284,15 +284,15 @@ async def get( async def prefixes( self, *, - country: str | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, + country: str | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsePrefixesResponse: """ Retrieves the full list of autonomous systems on the global routing table diff --git a/src/cloudflare/resources/radar/bgp/top/top.py b/src/cloudflare/resources/radar/bgp/top/top.py index e3c1b39e255..3f811e385fe 100644 --- a/src/cloudflare/resources/radar/bgp/top/top.py +++ b/src/cloudflare/resources/radar/bgp/top/top.py @@ -16,7 +16,7 @@ AsesResourceWithStreamingResponse, AsyncAsesResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -61,20 +61,20 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse: def prefixes( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopPrefixesResponse: """ Retrieves the top network prefixes by BGP updates. @@ -162,20 +162,20 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: async def prefixes( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + update_type: List[Literal["ANNOUNCEMENT", "WITHDRAWAL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopPrefixesResponse: """ Retrieves the top network prefixes by BGP updates. diff --git a/src/cloudflare/resources/radar/bots/__init__.py b/src/cloudflare/resources/radar/bots/__init__.py new file mode 100644 index 00000000000..7d7fb66c90e --- /dev/null +++ b/src/cloudflare/resources/radar/bots/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .bots import ( + BotsResource, + AsyncBotsResource, + BotsResourceWithRawResponse, + AsyncBotsResourceWithRawResponse, + BotsResourceWithStreamingResponse, + AsyncBotsResourceWithStreamingResponse, +) +from .web_crawlers import ( + WebCrawlersResource, + AsyncWebCrawlersResource, + WebCrawlersResourceWithRawResponse, + AsyncWebCrawlersResourceWithRawResponse, + WebCrawlersResourceWithStreamingResponse, + AsyncWebCrawlersResourceWithStreamingResponse, +) + +__all__ = [ + "WebCrawlersResource", + "AsyncWebCrawlersResource", + "WebCrawlersResourceWithRawResponse", + "AsyncWebCrawlersResourceWithRawResponse", + "WebCrawlersResourceWithStreamingResponse", + "AsyncWebCrawlersResourceWithStreamingResponse", + "BotsResource", + "AsyncBotsResource", + "BotsResourceWithRawResponse", + "AsyncBotsResourceWithRawResponse", + "BotsResourceWithStreamingResponse", + "AsyncBotsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/radar/bots/bots.py b/src/cloudflare/resources/radar/bots/bots.py new file mode 100644 index 00000000000..3b891df90bc --- /dev/null +++ b/src/cloudflare/resources/radar/bots/bots.py @@ -0,0 +1,1242 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Union, cast +from datetime import datetime +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 .web_crawlers import ( + WebCrawlersResource, + AsyncWebCrawlersResource, + WebCrawlersResourceWithRawResponse, + AsyncWebCrawlersResourceWithRawResponse, + WebCrawlersResourceWithStreamingResponse, + AsyncWebCrawlersResourceWithStreamingResponse, +) +from ....types.radar import ( + bot_get_params, + bot_list_params, + bot_summary_params, + bot_timeseries_params, + bot_timeseries_groups_params, +) +from ...._base_client import make_request_options +from ....types.radar.bot_get_response import BotGetResponse +from ....types.radar.bot_list_response import BotListResponse +from ....types.radar.bot_summary_response import BotSummaryResponse +from ....types.radar.bot_timeseries_response import BotTimeseriesResponse +from ....types.radar.bot_timeseries_groups_response import BotTimeseriesGroupsResponse + +__all__ = ["BotsResource", "AsyncBotsResource"] + + +class BotsResource(SyncAPIResource): + @cached_property + def web_crawlers(self) -> WebCrawlersResource: + return WebCrawlersResource(self._client) + + @cached_property + def with_raw_response(self) -> BotsResourceWithRawResponse: + """ + 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 BotsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> BotsResourceWithStreamingResponse: + """ + 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 BotsResourceWithStreamingResponse(self) + + def list( + self, + *, + bot_category: Literal[ + "SEARCH_ENGINE_CRAWLER", + "SEARCH_ENGINE_OPTIMIZATION", + "MONITORING_AND_ANALYTICS", + "ADVERTISING_AND_MARKETING", + "SOCIAL_MEDIA_MARKETING", + "PAGE_PREVIEW", + "ACADEMIC_RESEARCH", + "SECURITY", + "ACCESSIBILITY", + "WEBHOOKS", + "FEED_FETCHER", + "AI_CRAWLER", + "AGGREGATOR", + "AI_ASSISTANT", + "AI_SEARCH", + "ARCHIVER", + ] + | Omit = omit, + bot_operator: str | Omit = omit, + bot_verification_status: Literal["VERIFIED"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + kind: Literal["AGENT", "BOT"] | Omit = omit, + 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BotListResponse: + """ + Retrieves a list of bots. + + Args: + bot_category: Filters results by bot category. + + bot_operator: Filters results by bot operator. + + bot_verification_status: Filters results by bot verification status. + + format: Format in which results will be returned. + + kind: Filters results by bot kind. + + limit: Limits the number of objects returned in the response. + + offset: Skips the specified number of objects before fetching the results. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/bots", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "bot_category": bot_category, + "bot_operator": bot_operator, + "bot_verification_status": bot_verification_status, + "format": format, + "kind": kind, + "limit": limit, + "offset": offset, + }, + bot_list_params.BotListParams, + ), + post_parser=ResultWrapper[BotListResponse]._unwrapper, + ), + cast_to=cast(Type[BotListResponse], ResultWrapper[BotListResponse]), + ) + + def get( + self, + bot_slug: str, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BotGetResponse: + """ + Retrieves the requested bot information. + + Args: + bot_slug: Bot slug. + + format: Format in which results will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 bot_slug: + raise ValueError(f"Expected a non-empty value for `bot_slug` but received {bot_slug!r}") + return self._get( + f"/radar/bots/{bot_slug}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"format": format}, bot_get_params.BotGetParams), + post_parser=ResultWrapper[BotGetResponse]._unwrapper, + ), + cast_to=cast(Type[BotGetResponse], ResultWrapper[BotGetResponse]), + ) + + def summary( + self, + dimension: Literal["BOT", "BOT_KIND", "BOT_OPERATOR", "BOT_CATEGORY"], + *, + asn: SequenceNotStr[str] | Omit = omit, + bot: SequenceNotStr[str] | Omit = omit, + bot_category: List[ + Literal[ + "SEARCH_ENGINE_CRAWLER", + "SEARCH_ENGINE_OPTIMIZATION", + "MONITORING_AND_ANALYTICS", + "ADVERTISING_AND_MARKETING", + "SOCIAL_MEDIA_MARKETING", + "PAGE_PREVIEW", + "ACADEMIC_RESEARCH", + "SECURITY", + "ACCESSIBILITY", + "WEBHOOKS", + "FEED_FETCHER", + "AI_CRAWLER", + "AGGREGATOR", + "AI_ASSISTANT", + "AI_SEARCH", + "ARCHIVER", + ] + ] + | Omit = omit, + bot_kind: List[Literal["AGENT", "BOT"]] | Omit = omit, + bot_operator: SequenceNotStr[str] | Omit = omit, + bot_verification_status: List[Literal["VERIFIED"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + ) -> BotSummaryResponse: + """ + Retrieves an aggregated summary of bots HTTP requests grouped by the specified + dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot: Filters results by bot name. + + bot_category: Filters results by bot category. + + bot_kind: Filters results by bot kind. + + bot_operator: Filters results by bot operator. + + bot_verification_status: Filters results by bot verification status (Verified vs. Unverified). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/bots/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "asn": asn, + "bot": bot, + "bot_category": bot_category, + "bot_kind": bot_kind, + "bot_operator": bot_operator, + "bot_verification_status": bot_verification_status, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + }, + bot_summary_params.BotSummaryParams, + ), + post_parser=ResultWrapper[BotSummaryResponse]._unwrapper, + ), + cast_to=cast(Type[BotSummaryResponse], ResultWrapper[BotSummaryResponse]), + ) + + def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot: SequenceNotStr[str] | Omit = omit, + bot_category: List[ + Literal[ + "SEARCH_ENGINE_CRAWLER", + "SEARCH_ENGINE_OPTIMIZATION", + "MONITORING_AND_ANALYTICS", + "ADVERTISING_AND_MARKETING", + "SOCIAL_MEDIA_MARKETING", + "PAGE_PREVIEW", + "ACADEMIC_RESEARCH", + "SECURITY", + "ACCESSIBILITY", + "WEBHOOKS", + "FEED_FETCHER", + "AI_CRAWLER", + "AGGREGATOR", + "AI_ASSISTANT", + "AI_SEARCH", + "ARCHIVER", + ] + ] + | Omit = omit, + bot_kind: List[Literal["AGENT", "BOT"]] | Omit = omit, + bot_operator: SequenceNotStr[str] | Omit = omit, + bot_verification_status: List[Literal["VERIFIED"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + ) -> BotTimeseriesResponse: + """ + Retrieves bots HTTP request volume over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot: Filters results by bot name. + + bot_category: Filters results by bot category. + + bot_kind: Filters results by bot kind. + + bot_operator: Filters results by bot operator. + + bot_verification_status: Filters results by bot verification status (Verified vs. Unverified). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/bots/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "bot": bot, + "bot_category": bot_category, + "bot_kind": bot_kind, + "bot_operator": bot_operator, + "bot_verification_status": bot_verification_status, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "location": location, + "name": name, + }, + bot_timeseries_params.BotTimeseriesParams, + ), + post_parser=ResultWrapper[BotTimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[BotTimeseriesResponse], ResultWrapper[BotTimeseriesResponse]), + ) + + def timeseries_groups( + self, + dimension: Literal["BOT", "BOT_KIND", "BOT_OPERATOR", "BOT_CATEGORY"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot: SequenceNotStr[str] | Omit = omit, + bot_category: List[ + Literal[ + "SEARCH_ENGINE_CRAWLER", + "SEARCH_ENGINE_OPTIMIZATION", + "MONITORING_AND_ANALYTICS", + "ADVERTISING_AND_MARKETING", + "SOCIAL_MEDIA_MARKETING", + "PAGE_PREVIEW", + "ACADEMIC_RESEARCH", + "SECURITY", + "ACCESSIBILITY", + "WEBHOOKS", + "FEED_FETCHER", + "AI_CRAWLER", + "AGGREGATOR", + "AI_ASSISTANT", + "AI_SEARCH", + "ARCHIVER", + ] + ] + | Omit = omit, + bot_kind: List[Literal["AGENT", "BOT"]] | Omit = omit, + bot_operator: SequenceNotStr[str] | Omit = omit, + bot_verification_status: List[Literal["VERIFIED"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + ) -> BotTimeseriesGroupsResponse: + """ + Retrieves the distribution of HTTP requests from bots, grouped by chosen the + specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot: Filters results by bot name. + + bot_category: Filters results by bot category. + + bot_kind: Filters results by bot kind. + + bot_operator: Filters results by bot operator. + + bot_verification_status: Filters results by bot verification status (Verified vs. Unverified). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/bots/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "bot": bot, + "bot_category": bot_category, + "bot_kind": bot_kind, + "bot_operator": bot_operator, + "bot_verification_status": bot_verification_status, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + }, + bot_timeseries_groups_params.BotTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[BotTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[BotTimeseriesGroupsResponse], ResultWrapper[BotTimeseriesGroupsResponse]), + ) + + +class AsyncBotsResource(AsyncAPIResource): + @cached_property + def web_crawlers(self) -> AsyncWebCrawlersResource: + return AsyncWebCrawlersResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncBotsResourceWithRawResponse: + """ + 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 AsyncBotsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncBotsResourceWithStreamingResponse: + """ + 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 AsyncBotsResourceWithStreamingResponse(self) + + async def list( + self, + *, + bot_category: Literal[ + "SEARCH_ENGINE_CRAWLER", + "SEARCH_ENGINE_OPTIMIZATION", + "MONITORING_AND_ANALYTICS", + "ADVERTISING_AND_MARKETING", + "SOCIAL_MEDIA_MARKETING", + "PAGE_PREVIEW", + "ACADEMIC_RESEARCH", + "SECURITY", + "ACCESSIBILITY", + "WEBHOOKS", + "FEED_FETCHER", + "AI_CRAWLER", + "AGGREGATOR", + "AI_ASSISTANT", + "AI_SEARCH", + "ARCHIVER", + ] + | Omit = omit, + bot_operator: str | Omit = omit, + bot_verification_status: Literal["VERIFIED"] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + kind: Literal["AGENT", "BOT"] | Omit = omit, + 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BotListResponse: + """ + Retrieves a list of bots. + + Args: + bot_category: Filters results by bot category. + + bot_operator: Filters results by bot operator. + + bot_verification_status: Filters results by bot verification status. + + format: Format in which results will be returned. + + kind: Filters results by bot kind. + + limit: Limits the number of objects returned in the response. + + offset: Skips the specified number of objects before fetching the results. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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._get( + "/radar/bots", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "bot_category": bot_category, + "bot_operator": bot_operator, + "bot_verification_status": bot_verification_status, + "format": format, + "kind": kind, + "limit": limit, + "offset": offset, + }, + bot_list_params.BotListParams, + ), + post_parser=ResultWrapper[BotListResponse]._unwrapper, + ), + cast_to=cast(Type[BotListResponse], ResultWrapper[BotListResponse]), + ) + + async def get( + self, + bot_slug: str, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BotGetResponse: + """ + Retrieves the requested bot information. + + Args: + bot_slug: Bot slug. + + format: Format in which results will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 bot_slug: + raise ValueError(f"Expected a non-empty value for `bot_slug` but received {bot_slug!r}") + return await self._get( + f"/radar/bots/{bot_slug}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"format": format}, bot_get_params.BotGetParams), + post_parser=ResultWrapper[BotGetResponse]._unwrapper, + ), + cast_to=cast(Type[BotGetResponse], ResultWrapper[BotGetResponse]), + ) + + async def summary( + self, + dimension: Literal["BOT", "BOT_KIND", "BOT_OPERATOR", "BOT_CATEGORY"], + *, + asn: SequenceNotStr[str] | Omit = omit, + bot: SequenceNotStr[str] | Omit = omit, + bot_category: List[ + Literal[ + "SEARCH_ENGINE_CRAWLER", + "SEARCH_ENGINE_OPTIMIZATION", + "MONITORING_AND_ANALYTICS", + "ADVERTISING_AND_MARKETING", + "SOCIAL_MEDIA_MARKETING", + "PAGE_PREVIEW", + "ACADEMIC_RESEARCH", + "SECURITY", + "ACCESSIBILITY", + "WEBHOOKS", + "FEED_FETCHER", + "AI_CRAWLER", + "AGGREGATOR", + "AI_ASSISTANT", + "AI_SEARCH", + "ARCHIVER", + ] + ] + | Omit = omit, + bot_kind: List[Literal["AGENT", "BOT"]] | Omit = omit, + bot_operator: SequenceNotStr[str] | Omit = omit, + bot_verification_status: List[Literal["VERIFIED"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + ) -> BotSummaryResponse: + """ + Retrieves an aggregated summary of bots HTTP requests grouped by the specified + dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot: Filters results by bot name. + + bot_category: Filters results by bot category. + + bot_kind: Filters results by bot kind. + + bot_operator: Filters results by bot operator. + + bot_verification_status: Filters results by bot verification status (Verified vs. Unverified). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/bots/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "asn": asn, + "bot": bot, + "bot_category": bot_category, + "bot_kind": bot_kind, + "bot_operator": bot_operator, + "bot_verification_status": bot_verification_status, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + }, + bot_summary_params.BotSummaryParams, + ), + post_parser=ResultWrapper[BotSummaryResponse]._unwrapper, + ), + cast_to=cast(Type[BotSummaryResponse], ResultWrapper[BotSummaryResponse]), + ) + + async def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot: SequenceNotStr[str] | Omit = omit, + bot_category: List[ + Literal[ + "SEARCH_ENGINE_CRAWLER", + "SEARCH_ENGINE_OPTIMIZATION", + "MONITORING_AND_ANALYTICS", + "ADVERTISING_AND_MARKETING", + "SOCIAL_MEDIA_MARKETING", + "PAGE_PREVIEW", + "ACADEMIC_RESEARCH", + "SECURITY", + "ACCESSIBILITY", + "WEBHOOKS", + "FEED_FETCHER", + "AI_CRAWLER", + "AGGREGATOR", + "AI_ASSISTANT", + "AI_SEARCH", + "ARCHIVER", + ] + ] + | Omit = omit, + bot_kind: List[Literal["AGENT", "BOT"]] | Omit = omit, + bot_operator: SequenceNotStr[str] | Omit = omit, + bot_verification_status: List[Literal["VERIFIED"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + ) -> BotTimeseriesResponse: + """ + Retrieves bots HTTP request volume over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot: Filters results by bot name. + + bot_category: Filters results by bot category. + + bot_kind: Filters results by bot kind. + + bot_operator: Filters results by bot operator. + + bot_verification_status: Filters results by bot verification status (Verified vs. Unverified). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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._get( + "/radar/bots/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "bot": bot, + "bot_category": bot_category, + "bot_kind": bot_kind, + "bot_operator": bot_operator, + "bot_verification_status": bot_verification_status, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "location": location, + "name": name, + }, + bot_timeseries_params.BotTimeseriesParams, + ), + post_parser=ResultWrapper[BotTimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[BotTimeseriesResponse], ResultWrapper[BotTimeseriesResponse]), + ) + + async def timeseries_groups( + self, + dimension: Literal["BOT", "BOT_KIND", "BOT_OPERATOR", "BOT_CATEGORY"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot: SequenceNotStr[str] | Omit = omit, + bot_category: List[ + Literal[ + "SEARCH_ENGINE_CRAWLER", + "SEARCH_ENGINE_OPTIMIZATION", + "MONITORING_AND_ANALYTICS", + "ADVERTISING_AND_MARKETING", + "SOCIAL_MEDIA_MARKETING", + "PAGE_PREVIEW", + "ACADEMIC_RESEARCH", + "SECURITY", + "ACCESSIBILITY", + "WEBHOOKS", + "FEED_FETCHER", + "AI_CRAWLER", + "AGGREGATOR", + "AI_ASSISTANT", + "AI_SEARCH", + "ARCHIVER", + ] + ] + | Omit = omit, + bot_kind: List[Literal["AGENT", "BOT"]] | Omit = omit, + bot_operator: SequenceNotStr[str] | Omit = omit, + bot_verification_status: List[Literal["VERIFIED"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + ) -> BotTimeseriesGroupsResponse: + """ + Retrieves the distribution of HTTP requests from bots, grouped by chosen the + specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot: Filters results by bot name. + + bot_category: Filters results by bot category. + + bot_kind: Filters results by bot kind. + + bot_operator: Filters results by bot operator. + + bot_verification_status: Filters results by bot verification status (Verified vs. Unverified). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/bots/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "bot": bot, + "bot_category": bot_category, + "bot_kind": bot_kind, + "bot_operator": bot_operator, + "bot_verification_status": bot_verification_status, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + }, + bot_timeseries_groups_params.BotTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[BotTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[BotTimeseriesGroupsResponse], ResultWrapper[BotTimeseriesGroupsResponse]), + ) + + +class BotsResourceWithRawResponse: + def __init__(self, bots: BotsResource) -> None: + self._bots = bots + + self.list = to_raw_response_wrapper( + bots.list, + ) + self.get = to_raw_response_wrapper( + bots.get, + ) + self.summary = to_raw_response_wrapper( + bots.summary, + ) + self.timeseries = to_raw_response_wrapper( + bots.timeseries, + ) + self.timeseries_groups = to_raw_response_wrapper( + bots.timeseries_groups, + ) + + @cached_property + def web_crawlers(self) -> WebCrawlersResourceWithRawResponse: + return WebCrawlersResourceWithRawResponse(self._bots.web_crawlers) + + +class AsyncBotsResourceWithRawResponse: + def __init__(self, bots: AsyncBotsResource) -> None: + self._bots = bots + + self.list = async_to_raw_response_wrapper( + bots.list, + ) + self.get = async_to_raw_response_wrapper( + bots.get, + ) + self.summary = async_to_raw_response_wrapper( + bots.summary, + ) + self.timeseries = async_to_raw_response_wrapper( + bots.timeseries, + ) + self.timeseries_groups = async_to_raw_response_wrapper( + bots.timeseries_groups, + ) + + @cached_property + def web_crawlers(self) -> AsyncWebCrawlersResourceWithRawResponse: + return AsyncWebCrawlersResourceWithRawResponse(self._bots.web_crawlers) + + +class BotsResourceWithStreamingResponse: + def __init__(self, bots: BotsResource) -> None: + self._bots = bots + + self.list = to_streamed_response_wrapper( + bots.list, + ) + self.get = to_streamed_response_wrapper( + bots.get, + ) + self.summary = to_streamed_response_wrapper( + bots.summary, + ) + self.timeseries = to_streamed_response_wrapper( + bots.timeseries, + ) + self.timeseries_groups = to_streamed_response_wrapper( + bots.timeseries_groups, + ) + + @cached_property + def web_crawlers(self) -> WebCrawlersResourceWithStreamingResponse: + return WebCrawlersResourceWithStreamingResponse(self._bots.web_crawlers) + + +class AsyncBotsResourceWithStreamingResponse: + def __init__(self, bots: AsyncBotsResource) -> None: + self._bots = bots + + self.list = async_to_streamed_response_wrapper( + bots.list, + ) + self.get = async_to_streamed_response_wrapper( + bots.get, + ) + self.summary = async_to_streamed_response_wrapper( + bots.summary, + ) + self.timeseries = async_to_streamed_response_wrapper( + bots.timeseries, + ) + self.timeseries_groups = async_to_streamed_response_wrapper( + bots.timeseries_groups, + ) + + @cached_property + def web_crawlers(self) -> AsyncWebCrawlersResourceWithStreamingResponse: + return AsyncWebCrawlersResourceWithStreamingResponse(self._bots.web_crawlers) diff --git a/src/cloudflare/resources/radar/bots/web_crawlers.py b/src/cloudflare/resources/radar/bots/web_crawlers.py new file mode 100644 index 00000000000..08d85d80e22 --- /dev/null +++ b/src/cloudflare/resources/radar/bots/web_crawlers.py @@ -0,0 +1,469 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Union, cast +from datetime import datetime +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 ...._base_client import make_request_options +from ....types.radar.bots import web_crawler_summary_params, web_crawler_timeseries_groups_params +from ....types.radar.bots.web_crawler_summary_response import WebCrawlerSummaryResponse +from ....types.radar.bots.web_crawler_timeseries_groups_response import WebCrawlerTimeseriesGroupsResponse + +__all__ = ["WebCrawlersResource", "AsyncWebCrawlersResource"] + + +class WebCrawlersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> WebCrawlersResourceWithRawResponse: + """ + 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 WebCrawlersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> WebCrawlersResourceWithStreamingResponse: + """ + 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 WebCrawlersResourceWithStreamingResponse(self) + + def summary( + self, + dimension: Literal["USER_AGENT", "REFERER", "CRAWL_REFER_RATIO", "VERTICAL", "INDUSTRY"], + *, + bot_operator: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> WebCrawlerSummaryResponse: + """ + Retrieves an aggregated summary of HTTP requests from crawlers, grouped by the + specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + bot_operator: Filters results by bot operator. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/bots/crawlers/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "bot_operator": bot_operator, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "name": name, + "vertical": vertical, + }, + web_crawler_summary_params.WebCrawlerSummaryParams, + ), + post_parser=ResultWrapper[WebCrawlerSummaryResponse]._unwrapper, + ), + cast_to=cast(Type[WebCrawlerSummaryResponse], ResultWrapper[WebCrawlerSummaryResponse]), + ) + + def timeseries_groups( + self, + dimension: Literal["USER_AGENT", "REFERER", "CRAWL_REFER_RATIO", "VERTICAL", "INDUSTRY"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + bot_operator: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> WebCrawlerTimeseriesGroupsResponse: + """ + Retrieves the distribution of HTTP requests from crawlers, grouped by chosen the + specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + bot_operator: Filters results by bot operator. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/bots/crawlers/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "bot_operator": bot_operator, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "name": name, + "vertical": vertical, + }, + web_crawler_timeseries_groups_params.WebCrawlerTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[WebCrawlerTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[WebCrawlerTimeseriesGroupsResponse], ResultWrapper[WebCrawlerTimeseriesGroupsResponse]), + ) + + +class AsyncWebCrawlersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncWebCrawlersResourceWithRawResponse: + """ + 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 AsyncWebCrawlersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncWebCrawlersResourceWithStreamingResponse: + """ + 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 AsyncWebCrawlersResourceWithStreamingResponse(self) + + async def summary( + self, + dimension: Literal["USER_AGENT", "REFERER", "CRAWL_REFER_RATIO", "VERTICAL", "INDUSTRY"], + *, + bot_operator: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> WebCrawlerSummaryResponse: + """ + Retrieves an aggregated summary of HTTP requests from crawlers, grouped by the + specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + bot_operator: Filters results by bot operator. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/bots/crawlers/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "bot_operator": bot_operator, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "name": name, + "vertical": vertical, + }, + web_crawler_summary_params.WebCrawlerSummaryParams, + ), + post_parser=ResultWrapper[WebCrawlerSummaryResponse]._unwrapper, + ), + cast_to=cast(Type[WebCrawlerSummaryResponse], ResultWrapper[WebCrawlerSummaryResponse]), + ) + + async def timeseries_groups( + self, + dimension: Literal["USER_AGENT", "REFERER", "CRAWL_REFER_RATIO", "VERTICAL", "INDUSTRY"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + bot_operator: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + industry: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + vertical: 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, + ) -> WebCrawlerTimeseriesGroupsResponse: + """ + Retrieves the distribution of HTTP requests from crawlers, grouped by chosen the + specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + bot_operator: Filters results by bot operator. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + industry: Filters results by industry. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + vertical: Filters results by vertical. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/bots/crawlers/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "bot_operator": bot_operator, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "industry": industry, + "limit_per_group": limit_per_group, + "name": name, + "vertical": vertical, + }, + web_crawler_timeseries_groups_params.WebCrawlerTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[WebCrawlerTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[WebCrawlerTimeseriesGroupsResponse], ResultWrapper[WebCrawlerTimeseriesGroupsResponse]), + ) + + +class WebCrawlersResourceWithRawResponse: + def __init__(self, web_crawlers: WebCrawlersResource) -> None: + self._web_crawlers = web_crawlers + + self.summary = to_raw_response_wrapper( + web_crawlers.summary, + ) + self.timeseries_groups = to_raw_response_wrapper( + web_crawlers.timeseries_groups, + ) + + +class AsyncWebCrawlersResourceWithRawResponse: + def __init__(self, web_crawlers: AsyncWebCrawlersResource) -> None: + self._web_crawlers = web_crawlers + + self.summary = async_to_raw_response_wrapper( + web_crawlers.summary, + ) + self.timeseries_groups = async_to_raw_response_wrapper( + web_crawlers.timeseries_groups, + ) + + +class WebCrawlersResourceWithStreamingResponse: + def __init__(self, web_crawlers: WebCrawlersResource) -> None: + self._web_crawlers = web_crawlers + + self.summary = to_streamed_response_wrapper( + web_crawlers.summary, + ) + self.timeseries_groups = to_streamed_response_wrapper( + web_crawlers.timeseries_groups, + ) + + +class AsyncWebCrawlersResourceWithStreamingResponse: + def __init__(self, web_crawlers: AsyncWebCrawlersResource) -> None: + self._web_crawlers = web_crawlers + + self.summary = async_to_streamed_response_wrapper( + web_crawlers.summary, + ) + self.timeseries_groups = async_to_streamed_response_wrapper( + web_crawlers.timeseries_groups, + ) diff --git a/src/cloudflare/resources/radar/ct/__init__.py b/src/cloudflare/resources/radar/ct/__init__.py new file mode 100644 index 00000000000..f27eef5e41e --- /dev/null +++ b/src/cloudflare/resources/radar/ct/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .ct import ( + CtResource, + AsyncCtResource, + CtResourceWithRawResponse, + AsyncCtResourceWithRawResponse, + CtResourceWithStreamingResponse, + AsyncCtResourceWithStreamingResponse, +) +from .logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) +from .authorities import ( + AuthoritiesResource, + AsyncAuthoritiesResource, + AuthoritiesResourceWithRawResponse, + AsyncAuthoritiesResourceWithRawResponse, + AuthoritiesResourceWithStreamingResponse, + AsyncAuthoritiesResourceWithStreamingResponse, +) + +__all__ = [ + "AuthoritiesResource", + "AsyncAuthoritiesResource", + "AuthoritiesResourceWithRawResponse", + "AsyncAuthoritiesResourceWithRawResponse", + "AuthoritiesResourceWithStreamingResponse", + "AsyncAuthoritiesResourceWithStreamingResponse", + "LogsResource", + "AsyncLogsResource", + "LogsResourceWithRawResponse", + "AsyncLogsResourceWithRawResponse", + "LogsResourceWithStreamingResponse", + "AsyncLogsResourceWithStreamingResponse", + "CtResource", + "AsyncCtResource", + "CtResourceWithRawResponse", + "AsyncCtResourceWithRawResponse", + "CtResourceWithStreamingResponse", + "AsyncCtResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/radar/ct/authorities.py b/src/cloudflare/resources/radar/ct/authorities.py new file mode 100644 index 00000000000..580466559d8 --- /dev/null +++ b/src/cloudflare/resources/radar/ct/authorities.py @@ -0,0 +1,304 @@ +# 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, 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.radar.ct import authority_get_params, authority_list_params +from ....types.radar.ct.authority_get_response import AuthorityGetResponse +from ....types.radar.ct.authority_list_response import AuthorityListResponse + +__all__ = ["AuthoritiesResource", "AsyncAuthoritiesResource"] + + +class AuthoritiesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AuthoritiesResourceWithRawResponse: + """ + 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 AuthoritiesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AuthoritiesResourceWithStreamingResponse: + """ + 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 AuthoritiesResourceWithStreamingResponse(self) + + def list( + self, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AuthorityListResponse: + """ + Retrieves a list of certificate authorities. + + Args: + format: Format in which results will be returned. + + limit: Limits the number of objects returned in the response. + + offset: Skips the specified number of objects before fetching the results. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/ct/authorities", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "format": format, + "limit": limit, + "offset": offset, + }, + authority_list_params.AuthorityListParams, + ), + post_parser=ResultWrapper[AuthorityListResponse]._unwrapper, + ), + cast_to=cast(Type[AuthorityListResponse], ResultWrapper[AuthorityListResponse]), + ) + + def get( + self, + ca_slug: str, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AuthorityGetResponse: + """ + Retrieves the requested CA information. + + Args: + ca_slug: Certificate authority SHA256 fingerprint. + + format: Format in which results will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 ca_slug: + raise ValueError(f"Expected a non-empty value for `ca_slug` but received {ca_slug!r}") + return self._get( + f"/radar/ct/authorities/{ca_slug}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"format": format}, authority_get_params.AuthorityGetParams), + post_parser=ResultWrapper[AuthorityGetResponse]._unwrapper, + ), + cast_to=cast(Type[AuthorityGetResponse], ResultWrapper[AuthorityGetResponse]), + ) + + +class AsyncAuthoritiesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAuthoritiesResourceWithRawResponse: + """ + 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 AsyncAuthoritiesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAuthoritiesResourceWithStreamingResponse: + """ + 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 AsyncAuthoritiesResourceWithStreamingResponse(self) + + async def list( + self, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AuthorityListResponse: + """ + Retrieves a list of certificate authorities. + + Args: + format: Format in which results will be returned. + + limit: Limits the number of objects returned in the response. + + offset: Skips the specified number of objects before fetching the results. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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._get( + "/radar/ct/authorities", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "format": format, + "limit": limit, + "offset": offset, + }, + authority_list_params.AuthorityListParams, + ), + post_parser=ResultWrapper[AuthorityListResponse]._unwrapper, + ), + cast_to=cast(Type[AuthorityListResponse], ResultWrapper[AuthorityListResponse]), + ) + + async def get( + self, + ca_slug: str, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AuthorityGetResponse: + """ + Retrieves the requested CA information. + + Args: + ca_slug: Certificate authority SHA256 fingerprint. + + format: Format in which results will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 ca_slug: + raise ValueError(f"Expected a non-empty value for `ca_slug` but received {ca_slug!r}") + return await self._get( + f"/radar/ct/authorities/{ca_slug}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"format": format}, authority_get_params.AuthorityGetParams), + post_parser=ResultWrapper[AuthorityGetResponse]._unwrapper, + ), + cast_to=cast(Type[AuthorityGetResponse], ResultWrapper[AuthorityGetResponse]), + ) + + +class AuthoritiesResourceWithRawResponse: + def __init__(self, authorities: AuthoritiesResource) -> None: + self._authorities = authorities + + self.list = to_raw_response_wrapper( + authorities.list, + ) + self.get = to_raw_response_wrapper( + authorities.get, + ) + + +class AsyncAuthoritiesResourceWithRawResponse: + def __init__(self, authorities: AsyncAuthoritiesResource) -> None: + self._authorities = authorities + + self.list = async_to_raw_response_wrapper( + authorities.list, + ) + self.get = async_to_raw_response_wrapper( + authorities.get, + ) + + +class AuthoritiesResourceWithStreamingResponse: + def __init__(self, authorities: AuthoritiesResource) -> None: + self._authorities = authorities + + self.list = to_streamed_response_wrapper( + authorities.list, + ) + self.get = to_streamed_response_wrapper( + authorities.get, + ) + + +class AsyncAuthoritiesResourceWithStreamingResponse: + def __init__(self, authorities: AsyncAuthoritiesResource) -> None: + self._authorities = authorities + + self.list = async_to_streamed_response_wrapper( + authorities.list, + ) + self.get = async_to_streamed_response_wrapper( + authorities.get, + ) diff --git a/src/cloudflare/resources/radar/ct/ct.py b/src/cloudflare/resources/radar/ct/ct.py new file mode 100644 index 00000000000..5bbc48e8e41 --- /dev/null +++ b/src/cloudflare/resources/radar/ct/ct.py @@ -0,0 +1,1264 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Type, Union, Iterable, cast +from datetime import datetime +from typing_extensions import Literal + +import httpx + +from .logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) +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 .authorities import ( + AuthoritiesResource, + AsyncAuthoritiesResource, + AuthoritiesResourceWithRawResponse, + AsyncAuthoritiesResourceWithRawResponse, + AuthoritiesResourceWithStreamingResponse, + AsyncAuthoritiesResourceWithStreamingResponse, +) +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.radar import ct_summary_params, ct_timeseries_params, ct_timeseries_groups_params +from ...._base_client import make_request_options +from ....types.radar.ct_summary_response import CtSummaryResponse +from ....types.radar.ct_timeseries_response import CtTimeseriesResponse +from ....types.radar.ct_timeseries_groups_response import CtTimeseriesGroupsResponse + +__all__ = ["CtResource", "AsyncCtResource"] + + +class CtResource(SyncAPIResource): + @cached_property + def authorities(self) -> AuthoritiesResource: + return AuthoritiesResource(self._client) + + @cached_property + def logs(self) -> LogsResource: + return LogsResource(self._client) + + @cached_property + def with_raw_response(self) -> CtResourceWithRawResponse: + """ + 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 CtResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CtResourceWithStreamingResponse: + """ + 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 CtResourceWithStreamingResponse(self) + + def summary( + self, + dimension: Literal[ + "CA", + "CA_OWNER", + "DURATION", + "ENTRY_TYPE", + "EXPIRATION_STATUS", + "HAS_IPS", + "HAS_WILDCARDS", + "LOG", + "LOG_API", + "LOG_OPERATOR", + "PUBLIC_KEY_ALGORITHM", + "SIGNATURE_ALGORITHM", + "TLD", + "VALIDATION_LEVEL", + ], + *, + ca: SequenceNotStr[str] | Omit = omit, + ca_owner: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + duration: List[ + Literal[ + "LTE_3D", + "GT_3D_LTE_7D", + "GT_7D_LTE_10D", + "GT_10D_LTE_47D", + "GT_47D_LTE_100D", + "GT_100D_LTE_200D", + "GT_200D", + ] + ] + | Omit = omit, + entry_type: List[Literal["PRECERTIFICATE", "CERTIFICATE"]] | Omit = omit, + expiration_status: List[Literal["EXPIRED", "VALID"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + has_ips: Iterable[bool] | Omit = omit, + has_wildcards: Iterable[bool] | Omit = omit, + limit_per_group: int | Omit = omit, + log: SequenceNotStr[str] | Omit = omit, + log_api: List[Literal["RFC6962", "STATIC"]] | Omit = omit, + log_operator: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["RAW_VALUES", "PERCENTAGE"] | Omit = omit, + public_key_algorithm: List[Literal["DSA", "ECDSA", "RSA"]] | Omit = omit, + signature_algorithm: List[ + Literal[ + "DSA_SHA_1", + "DSA_SHA_256", + "ECDSA_SHA_1", + "ECDSA_SHA_256", + "ECDSA_SHA_384", + "ECDSA_SHA_512", + "PSS_SHA_256", + "PSS_SHA_384", + "PSS_SHA_512", + "RSA_MD2", + "RSA_MD5", + "RSA_SHA_1", + "RSA_SHA_256", + "RSA_SHA_384", + "RSA_SHA_512", + ] + ] + | Omit = omit, + tld: SequenceNotStr[str] | Omit = omit, + unique_entries: List[Literal["true", "false"]] | Omit = omit, + validation_level: List[Literal["DOMAIN", "ORGANIZATION", "EXTENDED"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CtSummaryResponse: + """ + Retrieves an aggregated summary of certificates grouped by the specified + dimension. + + Args: + dimension: Specifies the certificate attribute by which to group the results. + + ca: Filters results by certificate authority. + + ca_owner: Filters results by certificate authority owner. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + duration: Filters results by certificate duration. + + entry_type: Filters results by entry type (certificate vs. pre-certificate). + + expiration_status: Filters results by expiration status (expired vs. valid). + + format: Format in which results will be returned. + + has_ips: Filters results based on whether the certificates are bound to specific IP + addresses. + + has_wildcards: Filters results based on whether the certificates contain wildcard domains. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + log: Filters results by certificate log. + + log_api: Filters results by certificate log API (RFC6962 vs. static). + + log_operator: Filters results by certificate log operator. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + public_key_algorithm: Filters results by public key algorithm. + + signature_algorithm: Filters results by signature algorithm. + + tld: Filters results by top-level domain. + + unique_entries: Specifies whether to filter out duplicate certificates and pre-certificates. Set + to true for unique entries only. + + validation_level: Filters results by validation level. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/ct/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "ca": ca, + "ca_owner": ca_owner, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "duration": duration, + "entry_type": entry_type, + "expiration_status": expiration_status, + "format": format, + "has_ips": has_ips, + "has_wildcards": has_wildcards, + "limit_per_group": limit_per_group, + "log": log, + "log_api": log_api, + "log_operator": log_operator, + "name": name, + "normalization": normalization, + "public_key_algorithm": public_key_algorithm, + "signature_algorithm": signature_algorithm, + "tld": tld, + "unique_entries": unique_entries, + "validation_level": validation_level, + }, + ct_summary_params.CtSummaryParams, + ), + post_parser=ResultWrapper[CtSummaryResponse]._unwrapper, + ), + cast_to=cast(Type[CtSummaryResponse], ResultWrapper[CtSummaryResponse]), + ) + + def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + ca: SequenceNotStr[str] | Omit = omit, + ca_owner: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + duration: List[ + Literal[ + "LTE_3D", + "GT_3D_LTE_7D", + "GT_7D_LTE_10D", + "GT_10D_LTE_47D", + "GT_47D_LTE_100D", + "GT_100D_LTE_200D", + "GT_200D", + ] + ] + | Omit = omit, + entry_type: List[Literal["PRECERTIFICATE", "CERTIFICATE"]] | Omit = omit, + expiration_status: List[Literal["EXPIRED", "VALID"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + has_ips: Iterable[bool] | Omit = omit, + has_wildcards: Iterable[bool] | Omit = omit, + log: SequenceNotStr[str] | Omit = omit, + log_api: List[Literal["RFC6962", "STATIC"]] | Omit = omit, + log_operator: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + public_key_algorithm: List[Literal["DSA", "ECDSA", "RSA"]] | Omit = omit, + signature_algorithm: List[ + Literal[ + "DSA_SHA_1", + "DSA_SHA_256", + "ECDSA_SHA_1", + "ECDSA_SHA_256", + "ECDSA_SHA_384", + "ECDSA_SHA_512", + "PSS_SHA_256", + "PSS_SHA_384", + "PSS_SHA_512", + "RSA_MD2", + "RSA_MD5", + "RSA_SHA_1", + "RSA_SHA_256", + "RSA_SHA_384", + "RSA_SHA_512", + ] + ] + | Omit = omit, + tld: SequenceNotStr[str] | Omit = omit, + unique_entries: List[Literal["true", "false"]] | Omit = omit, + validation_level: List[Literal["DOMAIN", "ORGANIZATION", "EXTENDED"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CtTimeseriesResponse: + """ + Retrieves certificate volume over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + ca: Filters results by certificate authority. + + ca_owner: Filters results by certificate authority owner. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + duration: Filters results by certificate duration. + + entry_type: Filters results by entry type (certificate vs. pre-certificate). + + expiration_status: Filters results by expiration status (expired vs. valid). + + format: Format in which results will be returned. + + has_ips: Filters results based on whether the certificates are bound to specific IP + addresses. + + has_wildcards: Filters results based on whether the certificates contain wildcard domains. + + log: Filters results by certificate log. + + log_api: Filters results by certificate log API (RFC6962 vs. static). + + log_operator: Filters results by certificate log operator. + + name: Array of names used to label the series in the response. + + public_key_algorithm: Filters results by public key algorithm. + + signature_algorithm: Filters results by signature algorithm. + + tld: Filters results by top-level domain. + + unique_entries: Specifies whether to filter out duplicate certificates and pre-certificates. Set + to true for unique entries only. + + validation_level: Filters results by validation level. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/ct/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "ca": ca, + "ca_owner": ca_owner, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "duration": duration, + "entry_type": entry_type, + "expiration_status": expiration_status, + "format": format, + "has_ips": has_ips, + "has_wildcards": has_wildcards, + "log": log, + "log_api": log_api, + "log_operator": log_operator, + "name": name, + "public_key_algorithm": public_key_algorithm, + "signature_algorithm": signature_algorithm, + "tld": tld, + "unique_entries": unique_entries, + "validation_level": validation_level, + }, + ct_timeseries_params.CtTimeseriesParams, + ), + post_parser=ResultWrapper[CtTimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[CtTimeseriesResponse], ResultWrapper[CtTimeseriesResponse]), + ) + + def timeseries_groups( + self, + dimension: Literal[ + "CA", + "CA_OWNER", + "DURATION", + "ENTRY_TYPE", + "EXPIRATION_STATUS", + "HAS_IPS", + "HAS_WILDCARDS", + "LOG", + "LOG_API", + "LOG_OPERATOR", + "PUBLIC_KEY_ALGORITHM", + "SIGNATURE_ALGORITHM", + "TLD", + "VALIDATION_LEVEL", + ], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + ca: SequenceNotStr[str] | Omit = omit, + ca_owner: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + duration: List[ + Literal[ + "LTE_3D", + "GT_3D_LTE_7D", + "GT_7D_LTE_10D", + "GT_10D_LTE_47D", + "GT_47D_LTE_100D", + "GT_100D_LTE_200D", + "GT_200D", + ] + ] + | Omit = omit, + entry_type: List[Literal["PRECERTIFICATE", "CERTIFICATE"]] | Omit = omit, + expiration_status: List[Literal["EXPIRED", "VALID"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + has_ips: Iterable[bool] | Omit = omit, + has_wildcards: Iterable[bool] | Omit = omit, + limit_per_group: int | Omit = omit, + log: SequenceNotStr[str] | Omit = omit, + log_api: List[Literal["RFC6962", "STATIC"]] | Omit = omit, + log_operator: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["RAW_VALUES", "PERCENTAGE"] | Omit = omit, + public_key_algorithm: List[Literal["DSA", "ECDSA", "RSA"]] | Omit = omit, + signature_algorithm: List[ + Literal[ + "DSA_SHA_1", + "DSA_SHA_256", + "ECDSA_SHA_1", + "ECDSA_SHA_256", + "ECDSA_SHA_384", + "ECDSA_SHA_512", + "PSS_SHA_256", + "PSS_SHA_384", + "PSS_SHA_512", + "RSA_MD2", + "RSA_MD5", + "RSA_SHA_1", + "RSA_SHA_256", + "RSA_SHA_384", + "RSA_SHA_512", + ] + ] + | Omit = omit, + tld: SequenceNotStr[str] | Omit = omit, + unique_entries: List[Literal["true", "false"]] | Omit = omit, + validation_level: List[Literal["DOMAIN", "ORGANIZATION", "EXTENDED"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CtTimeseriesGroupsResponse: + """ + Retrieves the distribution of certificates grouped by chosen the specified + dimension over time. + + Args: + dimension: Specifies the certificate attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + ca: Filters results by certificate authority. + + ca_owner: Filters results by certificate authority owner. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + duration: Filters results by certificate duration. + + entry_type: Filters results by entry type (certificate vs. pre-certificate). + + expiration_status: Filters results by expiration status (expired vs. valid). + + format: Format in which results will be returned. + + has_ips: Filters results based on whether the certificates are bound to specific IP + addresses. + + has_wildcards: Filters results based on whether the certificates contain wildcard domains. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + log: Filters results by certificate log. + + log_api: Filters results by certificate log API (RFC6962 vs. static). + + log_operator: Filters results by certificate log operator. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + public_key_algorithm: Filters results by public key algorithm. + + signature_algorithm: Filters results by signature algorithm. + + tld: Filters results by top-level domain. + + unique_entries: Specifies whether to filter out duplicate certificates and pre-certificates. Set + to true for unique entries only. + + validation_level: Filters results by validation level. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/ct/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "ca": ca, + "ca_owner": ca_owner, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "duration": duration, + "entry_type": entry_type, + "expiration_status": expiration_status, + "format": format, + "has_ips": has_ips, + "has_wildcards": has_wildcards, + "limit_per_group": limit_per_group, + "log": log, + "log_api": log_api, + "log_operator": log_operator, + "name": name, + "normalization": normalization, + "public_key_algorithm": public_key_algorithm, + "signature_algorithm": signature_algorithm, + "tld": tld, + "unique_entries": unique_entries, + "validation_level": validation_level, + }, + ct_timeseries_groups_params.CtTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[CtTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[CtTimeseriesGroupsResponse], ResultWrapper[CtTimeseriesGroupsResponse]), + ) + + +class AsyncCtResource(AsyncAPIResource): + @cached_property + def authorities(self) -> AsyncAuthoritiesResource: + return AsyncAuthoritiesResource(self._client) + + @cached_property + def logs(self) -> AsyncLogsResource: + return AsyncLogsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncCtResourceWithRawResponse: + """ + 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 AsyncCtResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCtResourceWithStreamingResponse: + """ + 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 AsyncCtResourceWithStreamingResponse(self) + + async def summary( + self, + dimension: Literal[ + "CA", + "CA_OWNER", + "DURATION", + "ENTRY_TYPE", + "EXPIRATION_STATUS", + "HAS_IPS", + "HAS_WILDCARDS", + "LOG", + "LOG_API", + "LOG_OPERATOR", + "PUBLIC_KEY_ALGORITHM", + "SIGNATURE_ALGORITHM", + "TLD", + "VALIDATION_LEVEL", + ], + *, + ca: SequenceNotStr[str] | Omit = omit, + ca_owner: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + duration: List[ + Literal[ + "LTE_3D", + "GT_3D_LTE_7D", + "GT_7D_LTE_10D", + "GT_10D_LTE_47D", + "GT_47D_LTE_100D", + "GT_100D_LTE_200D", + "GT_200D", + ] + ] + | Omit = omit, + entry_type: List[Literal["PRECERTIFICATE", "CERTIFICATE"]] | Omit = omit, + expiration_status: List[Literal["EXPIRED", "VALID"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + has_ips: Iterable[bool] | Omit = omit, + has_wildcards: Iterable[bool] | Omit = omit, + limit_per_group: int | Omit = omit, + log: SequenceNotStr[str] | Omit = omit, + log_api: List[Literal["RFC6962", "STATIC"]] | Omit = omit, + log_operator: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["RAW_VALUES", "PERCENTAGE"] | Omit = omit, + public_key_algorithm: List[Literal["DSA", "ECDSA", "RSA"]] | Omit = omit, + signature_algorithm: List[ + Literal[ + "DSA_SHA_1", + "DSA_SHA_256", + "ECDSA_SHA_1", + "ECDSA_SHA_256", + "ECDSA_SHA_384", + "ECDSA_SHA_512", + "PSS_SHA_256", + "PSS_SHA_384", + "PSS_SHA_512", + "RSA_MD2", + "RSA_MD5", + "RSA_SHA_1", + "RSA_SHA_256", + "RSA_SHA_384", + "RSA_SHA_512", + ] + ] + | Omit = omit, + tld: SequenceNotStr[str] | Omit = omit, + unique_entries: List[Literal["true", "false"]] | Omit = omit, + validation_level: List[Literal["DOMAIN", "ORGANIZATION", "EXTENDED"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CtSummaryResponse: + """ + Retrieves an aggregated summary of certificates grouped by the specified + dimension. + + Args: + dimension: Specifies the certificate attribute by which to group the results. + + ca: Filters results by certificate authority. + + ca_owner: Filters results by certificate authority owner. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + duration: Filters results by certificate duration. + + entry_type: Filters results by entry type (certificate vs. pre-certificate). + + expiration_status: Filters results by expiration status (expired vs. valid). + + format: Format in which results will be returned. + + has_ips: Filters results based on whether the certificates are bound to specific IP + addresses. + + has_wildcards: Filters results based on whether the certificates contain wildcard domains. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + log: Filters results by certificate log. + + log_api: Filters results by certificate log API (RFC6962 vs. static). + + log_operator: Filters results by certificate log operator. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + public_key_algorithm: Filters results by public key algorithm. + + signature_algorithm: Filters results by signature algorithm. + + tld: Filters results by top-level domain. + + unique_entries: Specifies whether to filter out duplicate certificates and pre-certificates. Set + to true for unique entries only. + + validation_level: Filters results by validation level. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/ct/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "ca": ca, + "ca_owner": ca_owner, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "duration": duration, + "entry_type": entry_type, + "expiration_status": expiration_status, + "format": format, + "has_ips": has_ips, + "has_wildcards": has_wildcards, + "limit_per_group": limit_per_group, + "log": log, + "log_api": log_api, + "log_operator": log_operator, + "name": name, + "normalization": normalization, + "public_key_algorithm": public_key_algorithm, + "signature_algorithm": signature_algorithm, + "tld": tld, + "unique_entries": unique_entries, + "validation_level": validation_level, + }, + ct_summary_params.CtSummaryParams, + ), + post_parser=ResultWrapper[CtSummaryResponse]._unwrapper, + ), + cast_to=cast(Type[CtSummaryResponse], ResultWrapper[CtSummaryResponse]), + ) + + async def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + ca: SequenceNotStr[str] | Omit = omit, + ca_owner: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + duration: List[ + Literal[ + "LTE_3D", + "GT_3D_LTE_7D", + "GT_7D_LTE_10D", + "GT_10D_LTE_47D", + "GT_47D_LTE_100D", + "GT_100D_LTE_200D", + "GT_200D", + ] + ] + | Omit = omit, + entry_type: List[Literal["PRECERTIFICATE", "CERTIFICATE"]] | Omit = omit, + expiration_status: List[Literal["EXPIRED", "VALID"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + has_ips: Iterable[bool] | Omit = omit, + has_wildcards: Iterable[bool] | Omit = omit, + log: SequenceNotStr[str] | Omit = omit, + log_api: List[Literal["RFC6962", "STATIC"]] | Omit = omit, + log_operator: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + public_key_algorithm: List[Literal["DSA", "ECDSA", "RSA"]] | Omit = omit, + signature_algorithm: List[ + Literal[ + "DSA_SHA_1", + "DSA_SHA_256", + "ECDSA_SHA_1", + "ECDSA_SHA_256", + "ECDSA_SHA_384", + "ECDSA_SHA_512", + "PSS_SHA_256", + "PSS_SHA_384", + "PSS_SHA_512", + "RSA_MD2", + "RSA_MD5", + "RSA_SHA_1", + "RSA_SHA_256", + "RSA_SHA_384", + "RSA_SHA_512", + ] + ] + | Omit = omit, + tld: SequenceNotStr[str] | Omit = omit, + unique_entries: List[Literal["true", "false"]] | Omit = omit, + validation_level: List[Literal["DOMAIN", "ORGANIZATION", "EXTENDED"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CtTimeseriesResponse: + """ + Retrieves certificate volume over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + ca: Filters results by certificate authority. + + ca_owner: Filters results by certificate authority owner. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + duration: Filters results by certificate duration. + + entry_type: Filters results by entry type (certificate vs. pre-certificate). + + expiration_status: Filters results by expiration status (expired vs. valid). + + format: Format in which results will be returned. + + has_ips: Filters results based on whether the certificates are bound to specific IP + addresses. + + has_wildcards: Filters results based on whether the certificates contain wildcard domains. + + log: Filters results by certificate log. + + log_api: Filters results by certificate log API (RFC6962 vs. static). + + log_operator: Filters results by certificate log operator. + + name: Array of names used to label the series in the response. + + public_key_algorithm: Filters results by public key algorithm. + + signature_algorithm: Filters results by signature algorithm. + + tld: Filters results by top-level domain. + + unique_entries: Specifies whether to filter out duplicate certificates and pre-certificates. Set + to true for unique entries only. + + validation_level: Filters results by validation level. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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._get( + "/radar/ct/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "ca": ca, + "ca_owner": ca_owner, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "duration": duration, + "entry_type": entry_type, + "expiration_status": expiration_status, + "format": format, + "has_ips": has_ips, + "has_wildcards": has_wildcards, + "log": log, + "log_api": log_api, + "log_operator": log_operator, + "name": name, + "public_key_algorithm": public_key_algorithm, + "signature_algorithm": signature_algorithm, + "tld": tld, + "unique_entries": unique_entries, + "validation_level": validation_level, + }, + ct_timeseries_params.CtTimeseriesParams, + ), + post_parser=ResultWrapper[CtTimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[CtTimeseriesResponse], ResultWrapper[CtTimeseriesResponse]), + ) + + async def timeseries_groups( + self, + dimension: Literal[ + "CA", + "CA_OWNER", + "DURATION", + "ENTRY_TYPE", + "EXPIRATION_STATUS", + "HAS_IPS", + "HAS_WILDCARDS", + "LOG", + "LOG_API", + "LOG_OPERATOR", + "PUBLIC_KEY_ALGORITHM", + "SIGNATURE_ALGORITHM", + "TLD", + "VALIDATION_LEVEL", + ], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + ca: SequenceNotStr[str] | Omit = omit, + ca_owner: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + duration: List[ + Literal[ + "LTE_3D", + "GT_3D_LTE_7D", + "GT_7D_LTE_10D", + "GT_10D_LTE_47D", + "GT_47D_LTE_100D", + "GT_100D_LTE_200D", + "GT_200D", + ] + ] + | Omit = omit, + entry_type: List[Literal["PRECERTIFICATE", "CERTIFICATE"]] | Omit = omit, + expiration_status: List[Literal["EXPIRED", "VALID"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + has_ips: Iterable[bool] | Omit = omit, + has_wildcards: Iterable[bool] | Omit = omit, + limit_per_group: int | Omit = omit, + log: SequenceNotStr[str] | Omit = omit, + log_api: List[Literal["RFC6962", "STATIC"]] | Omit = omit, + log_operator: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["RAW_VALUES", "PERCENTAGE"] | Omit = omit, + public_key_algorithm: List[Literal["DSA", "ECDSA", "RSA"]] | Omit = omit, + signature_algorithm: List[ + Literal[ + "DSA_SHA_1", + "DSA_SHA_256", + "ECDSA_SHA_1", + "ECDSA_SHA_256", + "ECDSA_SHA_384", + "ECDSA_SHA_512", + "PSS_SHA_256", + "PSS_SHA_384", + "PSS_SHA_512", + "RSA_MD2", + "RSA_MD5", + "RSA_SHA_1", + "RSA_SHA_256", + "RSA_SHA_384", + "RSA_SHA_512", + ] + ] + | Omit = omit, + tld: SequenceNotStr[str] | Omit = omit, + unique_entries: List[Literal["true", "false"]] | Omit = omit, + validation_level: List[Literal["DOMAIN", "ORGANIZATION", "EXTENDED"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> CtTimeseriesGroupsResponse: + """ + Retrieves the distribution of certificates grouped by chosen the specified + dimension over time. + + Args: + dimension: Specifies the certificate attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + ca: Filters results by certificate authority. + + ca_owner: Filters results by certificate authority owner. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + duration: Filters results by certificate duration. + + entry_type: Filters results by entry type (certificate vs. pre-certificate). + + expiration_status: Filters results by expiration status (expired vs. valid). + + format: Format in which results will be returned. + + has_ips: Filters results based on whether the certificates are bound to specific IP + addresses. + + has_wildcards: Filters results based on whether the certificates contain wildcard domains. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + log: Filters results by certificate log. + + log_api: Filters results by certificate log API (RFC6962 vs. static). + + log_operator: Filters results by certificate log operator. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + public_key_algorithm: Filters results by public key algorithm. + + signature_algorithm: Filters results by signature algorithm. + + tld: Filters results by top-level domain. + + unique_entries: Specifies whether to filter out duplicate certificates and pre-certificates. Set + to true for unique entries only. + + validation_level: Filters results by validation level. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/ct/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "ca": ca, + "ca_owner": ca_owner, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "duration": duration, + "entry_type": entry_type, + "expiration_status": expiration_status, + "format": format, + "has_ips": has_ips, + "has_wildcards": has_wildcards, + "limit_per_group": limit_per_group, + "log": log, + "log_api": log_api, + "log_operator": log_operator, + "name": name, + "normalization": normalization, + "public_key_algorithm": public_key_algorithm, + "signature_algorithm": signature_algorithm, + "tld": tld, + "unique_entries": unique_entries, + "validation_level": validation_level, + }, + ct_timeseries_groups_params.CtTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[CtTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[CtTimeseriesGroupsResponse], ResultWrapper[CtTimeseriesGroupsResponse]), + ) + + +class CtResourceWithRawResponse: + def __init__(self, ct: CtResource) -> None: + self._ct = ct + + self.summary = to_raw_response_wrapper( + ct.summary, + ) + self.timeseries = to_raw_response_wrapper( + ct.timeseries, + ) + self.timeseries_groups = to_raw_response_wrapper( + ct.timeseries_groups, + ) + + @cached_property + def authorities(self) -> AuthoritiesResourceWithRawResponse: + return AuthoritiesResourceWithRawResponse(self._ct.authorities) + + @cached_property + def logs(self) -> LogsResourceWithRawResponse: + return LogsResourceWithRawResponse(self._ct.logs) + + +class AsyncCtResourceWithRawResponse: + def __init__(self, ct: AsyncCtResource) -> None: + self._ct = ct + + self.summary = async_to_raw_response_wrapper( + ct.summary, + ) + self.timeseries = async_to_raw_response_wrapper( + ct.timeseries, + ) + self.timeseries_groups = async_to_raw_response_wrapper( + ct.timeseries_groups, + ) + + @cached_property + def authorities(self) -> AsyncAuthoritiesResourceWithRawResponse: + return AsyncAuthoritiesResourceWithRawResponse(self._ct.authorities) + + @cached_property + def logs(self) -> AsyncLogsResourceWithRawResponse: + return AsyncLogsResourceWithRawResponse(self._ct.logs) + + +class CtResourceWithStreamingResponse: + def __init__(self, ct: CtResource) -> None: + self._ct = ct + + self.summary = to_streamed_response_wrapper( + ct.summary, + ) + self.timeseries = to_streamed_response_wrapper( + ct.timeseries, + ) + self.timeseries_groups = to_streamed_response_wrapper( + ct.timeseries_groups, + ) + + @cached_property + def authorities(self) -> AuthoritiesResourceWithStreamingResponse: + return AuthoritiesResourceWithStreamingResponse(self._ct.authorities) + + @cached_property + def logs(self) -> LogsResourceWithStreamingResponse: + return LogsResourceWithStreamingResponse(self._ct.logs) + + +class AsyncCtResourceWithStreamingResponse: + def __init__(self, ct: AsyncCtResource) -> None: + self._ct = ct + + self.summary = async_to_streamed_response_wrapper( + ct.summary, + ) + self.timeseries = async_to_streamed_response_wrapper( + ct.timeseries, + ) + self.timeseries_groups = async_to_streamed_response_wrapper( + ct.timeseries_groups, + ) + + @cached_property + def authorities(self) -> AsyncAuthoritiesResourceWithStreamingResponse: + return AsyncAuthoritiesResourceWithStreamingResponse(self._ct.authorities) + + @cached_property + def logs(self) -> AsyncLogsResourceWithStreamingResponse: + return AsyncLogsResourceWithStreamingResponse(self._ct.logs) diff --git a/src/cloudflare/resources/radar/ct/logs.py b/src/cloudflare/resources/radar/ct/logs.py new file mode 100644 index 00000000000..bbd1e8bc52e --- /dev/null +++ b/src/cloudflare/resources/radar/ct/logs.py @@ -0,0 +1,304 @@ +# 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, 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.radar.ct import log_get_params, log_list_params +from ....types.radar.ct.log_get_response import LogGetResponse +from ....types.radar.ct.log_list_response import LogListResponse + +__all__ = ["LogsResource", "AsyncLogsResource"] + + +class LogsResource(SyncAPIResource): + @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) + + def list( + self, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LogListResponse: + """ + Retrieves a list of certificate logs. + + Args: + format: Format in which results will be returned. + + limit: Limits the number of objects returned in the response. + + offset: Skips the specified number of objects before fetching the results. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/ct/logs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "format": format, + "limit": limit, + "offset": offset, + }, + log_list_params.LogListParams, + ), + post_parser=ResultWrapper[LogListResponse]._unwrapper, + ), + cast_to=cast(Type[LogListResponse], ResultWrapper[LogListResponse]), + ) + + def get( + self, + log_slug: str, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LogGetResponse: + """ + Retrieves the requested certificate log information. + + Args: + log_slug: Certificate log slug. + + format: Format in which results will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 log_slug: + raise ValueError(f"Expected a non-empty value for `log_slug` but received {log_slug!r}") + return self._get( + f"/radar/ct/logs/{log_slug}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"format": format}, log_get_params.LogGetParams), + post_parser=ResultWrapper[LogGetResponse]._unwrapper, + ), + cast_to=cast(Type[LogGetResponse], ResultWrapper[LogGetResponse]), + ) + + +class AsyncLogsResource(AsyncAPIResource): + @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) + + async def list( + self, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LogListResponse: + """ + Retrieves a list of certificate logs. + + Args: + format: Format in which results will be returned. + + limit: Limits the number of objects returned in the response. + + offset: Skips the specified number of objects before fetching the results. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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._get( + "/radar/ct/logs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "format": format, + "limit": limit, + "offset": offset, + }, + log_list_params.LogListParams, + ), + post_parser=ResultWrapper[LogListResponse]._unwrapper, + ), + cast_to=cast(Type[LogListResponse], ResultWrapper[LogListResponse]), + ) + + async def get( + self, + log_slug: str, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LogGetResponse: + """ + Retrieves the requested certificate log information. + + Args: + log_slug: Certificate log slug. + + format: Format in which results will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 log_slug: + raise ValueError(f"Expected a non-empty value for `log_slug` but received {log_slug!r}") + return await self._get( + f"/radar/ct/logs/{log_slug}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"format": format}, log_get_params.LogGetParams), + post_parser=ResultWrapper[LogGetResponse]._unwrapper, + ), + cast_to=cast(Type[LogGetResponse], ResultWrapper[LogGetResponse]), + ) + + +class LogsResourceWithRawResponse: + def __init__(self, logs: LogsResource) -> None: + self._logs = logs + + self.list = to_raw_response_wrapper( + logs.list, + ) + self.get = to_raw_response_wrapper( + logs.get, + ) + + +class AsyncLogsResourceWithRawResponse: + def __init__(self, logs: AsyncLogsResource) -> None: + self._logs = logs + + self.list = async_to_raw_response_wrapper( + logs.list, + ) + self.get = async_to_raw_response_wrapper( + logs.get, + ) + + +class LogsResourceWithStreamingResponse: + def __init__(self, logs: LogsResource) -> None: + self._logs = logs + + self.list = to_streamed_response_wrapper( + logs.list, + ) + self.get = to_streamed_response_wrapper( + logs.get, + ) + + +class AsyncLogsResourceWithStreamingResponse: + def __init__(self, logs: AsyncLogsResource) -> None: + self._logs = logs + + self.list = async_to_streamed_response_wrapper( + logs.list, + ) + self.get = async_to_streamed_response_wrapper( + logs.get, + ) diff --git a/src/cloudflare/resources/radar/datasets.py b/src/cloudflare/resources/radar/datasets.py index 79d96382808..1b387e46fa6 100644 --- a/src/cloudflare/resources/radar/datasets.py +++ b/src/cloudflare/resources/radar/datasets.py @@ -8,7 +8,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,17 +50,17 @@ def with_streaming_response(self) -> DatasetsResourceWithStreamingResponse: def list( self, *, - dataset_type: Literal["RANKING_BUCKET", "REPORT"] | NotGiven = NOT_GIVEN, - date: Union[str, date] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + dataset_type: Literal["RANKING_BUCKET", "REPORT"] | Omit = omit, + date: Union[str, date] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetListResponse: """ Retrieves a list of datasets. @@ -110,13 +110,13 @@ def download( self, *, dataset_id: int, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetDownloadResponse: """ Retrieves an URL to download a single dataset. @@ -155,7 +155,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Retrieves the CSV content of a given dataset by alias or ID. @@ -209,17 +209,17 @@ def with_streaming_response(self) -> AsyncDatasetsResourceWithStreamingResponse: async def list( self, *, - dataset_type: Literal["RANKING_BUCKET", "REPORT"] | NotGiven = NOT_GIVEN, - date: Union[str, date] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + dataset_type: Literal["RANKING_BUCKET", "REPORT"] | Omit = omit, + date: Union[str, date] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetListResponse: """ Retrieves a list of datasets. @@ -269,13 +269,13 @@ async def download( self, *, dataset_id: int, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetDownloadResponse: """ Retrieves an URL to download a single dataset. @@ -314,7 +314,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Retrieves the CSV content of a given dataset by alias or ID. diff --git a/src/cloudflare/resources/radar/dns/dns.py b/src/cloudflare/resources/radar/dns/dns.py index a99f88a76fe..a8d36f2bf72 100644 --- a/src/cloudflare/resources/radar/dns/dns.py +++ b/src/cloudflare/resources/radar/dns/dns.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +from typing import Type, Union, Optional, cast from datetime import datetime from typing_extensions import Literal @@ -24,7 +24,7 @@ SummaryResourceWithStreamingResponse, AsyncSummaryResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -35,7 +35,7 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....types.radar import dns_timeseries_params +from ....types.radar import dns_summary_v2_params, dns_timeseries_params, dns_timeseries_groups_v2_params from ...._base_client import make_request_options from .timeseries_groups import ( TimeseriesGroupsResource, @@ -45,7 +45,9 @@ TimeseriesGroupsResourceWithStreamingResponse, AsyncTimeseriesGroupsResourceWithStreamingResponse, ) +from ....types.radar.dns_summary_v2_response import DNSSummaryV2Response from ....types.radar.dns_timeseries_response import DNSTimeseriesResponse +from ....types.radar.dns_timeseries_groups_v2_response import DNSTimeseriesGroupsV2Response __all__ = ["DNSResource", "AsyncDNSResource"] @@ -82,20 +84,983 @@ def with_streaming_response(self) -> DNSResourceWithStreamingResponse: """ return DNSResourceWithStreamingResponse(self) + def summary_v2( + self, + dimension: Literal[ + "IP_VERSION", + "CACHE_HIT", + "DNSSEC", + "DNSSEC_AWARE", + "DNSSEC_E2E", + "MATCHING_ANSWER", + "PROTOCOL", + "QUERY_TYPE", + "RESPONSE_CODE", + "RESPONSE_TTL", + ], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, + query_type: Optional[ + Literal[ + "A", + "AAAA", + "A6", + "AFSDB", + "ANY", + "APL", + "ATMA", + "AXFR", + "CAA", + "CDNSKEY", + "CDS", + "CERT", + "CNAME", + "CSYNC", + "DHCID", + "DLV", + "DNAME", + "DNSKEY", + "DOA", + "DS", + "EID", + "EUI48", + "EUI64", + "GPOS", + "GID", + "HINFO", + "HIP", + "HTTPS", + "IPSECKEY", + "ISDN", + "IXFR", + "KEY", + "KX", + "L32", + "L64", + "LOC", + "LP", + "MAILA", + "MAILB", + "MB", + "MD", + "MF", + "MG", + "MINFO", + "MR", + "MX", + "NAPTR", + "NB", + "NBSTAT", + "NID", + "NIMLOC", + "NINFO", + "NS", + "NSAP", + "NSEC", + "NSEC3", + "NSEC3PARAM", + "NULL", + "NXT", + "OPENPGPKEY", + "OPT", + "PTR", + "PX", + "RKEY", + "RP", + "RRSIG", + "RT", + "SIG", + "SINK", + "SMIMEA", + "SOA", + "SPF", + "SRV", + "SSHFP", + "SVCB", + "TA", + "TALINK", + "TKEY", + "TLSA", + "TSIG", + "TXT", + "UINFO", + "UID", + "UNSPEC", + "URI", + "WKS", + "X25", + "ZONEMD", + ] + ] + | Omit = omit, + response_code: Literal[ + "NOERROR", + "FORMERR", + "SERVFAIL", + "NXDOMAIN", + "NOTIMP", + "REFUSED", + "YXDOMAIN", + "YXRRSET", + "NXRRSET", + "NOTAUTH", + "NOTZONE", + "BADSIG", + "BADKEY", + "BADTIME", + "BADMODE", + "BADNAME", + "BADALG", + "BADTRUNC", + "BADCOOKIE", + ] + | Omit = omit, + tld: 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, + ) -> DNSSummaryV2Response: + """ + Retrieves the distribution of DNS queries by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + nodata: Specifies whether the response includes empty DNS responses (NODATA). + + protocol: Filters results by DNS transport protocol. + + query_type: Filters results by DNS query type. + + response_code: Filters results by DNS response code. + + tld: Filters results by country code top-level domain (ccTLD). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/dns/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "nodata": nodata, + "protocol": protocol, + "query_type": query_type, + "response_code": response_code, + "tld": tld, + }, + dns_summary_v2_params.DNSSummaryV2Params, + ), + post_parser=ResultWrapper[DNSSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[DNSSummaryV2Response], ResultWrapper[DNSSummaryV2Response]), + ) + def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, + query_type: Optional[ + Literal[ + "A", + "AAAA", + "A6", + "AFSDB", + "ANY", + "APL", + "ATMA", + "AXFR", + "CAA", + "CDNSKEY", + "CDS", + "CERT", + "CNAME", + "CSYNC", + "DHCID", + "DLV", + "DNAME", + "DNSKEY", + "DOA", + "DS", + "EID", + "EUI48", + "EUI64", + "GPOS", + "GID", + "HINFO", + "HIP", + "HTTPS", + "IPSECKEY", + "ISDN", + "IXFR", + "KEY", + "KX", + "L32", + "L64", + "LOC", + "LP", + "MAILA", + "MAILB", + "MB", + "MD", + "MF", + "MG", + "MINFO", + "MR", + "MX", + "NAPTR", + "NB", + "NBSTAT", + "NID", + "NIMLOC", + "NINFO", + "NS", + "NSAP", + "NSEC", + "NSEC3", + "NSEC3PARAM", + "NULL", + "NXT", + "OPENPGPKEY", + "OPT", + "PTR", + "PX", + "RKEY", + "RP", + "RRSIG", + "RT", + "SIG", + "SINK", + "SMIMEA", + "SOA", + "SPF", + "SRV", + "SSHFP", + "SVCB", + "TA", + "TALINK", + "TKEY", + "TLSA", + "TSIG", + "TXT", + "UINFO", + "UID", + "UNSPEC", + "URI", + "WKS", + "X25", + "ZONEMD", + ] + ] + | Omit = omit, + response_code: Literal[ + "NOERROR", + "FORMERR", + "SERVFAIL", + "NXDOMAIN", + "NOTIMP", + "REFUSED", + "YXDOMAIN", + "YXRRSET", + "NXRRSET", + "NOTAUTH", + "NOTZONE", + "BADSIG", + "BADKEY", + "BADTIME", + "BADMODE", + "BADNAME", + "BADALG", + "BADTRUNC", + "BADCOOKIE", + ] + | Omit = omit, + tld: 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, + ) -> DNSTimeseriesResponse: + """ + Retrieves normalized query volume to the 1.1.1.1 DNS resolver over time. + + Args: + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + nodata: Specifies whether the response includes empty DNS responses (NODATA). + + protocol: Filters results by DNS transport protocol. + + query_type: Filters results by DNS query type. + + response_code: Filters results by DNS response code. + + tld: Filters results by country code top-level domain (ccTLD). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/dns/timeseries", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "location": location, + "name": name, + "nodata": nodata, + "protocol": protocol, + "query_type": query_type, + "response_code": response_code, + "tld": tld, + }, + dns_timeseries_params.DNSTimeseriesParams, + ), + post_parser=ResultWrapper[DNSTimeseriesResponse]._unwrapper, + ), + cast_to=cast(Type[DNSTimeseriesResponse], ResultWrapper[DNSTimeseriesResponse]), + ) + + def timeseries_groups_v2( + self, + dimension: Literal[ + "IP_VERSION", + "CACHE_HIT", + "DNSSEC", + "DNSSEC_AWARE", + "DNSSEC_E2E", + "MATCHING_ANSWER", + "PROTOCOL", + "QUERY_TYPE", + "RESPONSE_CODE", + "RESPONSE_TTL", + ], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, + query_type: Optional[ + Literal[ + "A", + "AAAA", + "A6", + "AFSDB", + "ANY", + "APL", + "ATMA", + "AXFR", + "CAA", + "CDNSKEY", + "CDS", + "CERT", + "CNAME", + "CSYNC", + "DHCID", + "DLV", + "DNAME", + "DNSKEY", + "DOA", + "DS", + "EID", + "EUI48", + "EUI64", + "GPOS", + "GID", + "HINFO", + "HIP", + "HTTPS", + "IPSECKEY", + "ISDN", + "IXFR", + "KEY", + "KX", + "L32", + "L64", + "LOC", + "LP", + "MAILA", + "MAILB", + "MB", + "MD", + "MF", + "MG", + "MINFO", + "MR", + "MX", + "NAPTR", + "NB", + "NBSTAT", + "NID", + "NIMLOC", + "NINFO", + "NS", + "NSAP", + "NSEC", + "NSEC3", + "NSEC3PARAM", + "NULL", + "NXT", + "OPENPGPKEY", + "OPT", + "PTR", + "PX", + "RKEY", + "RP", + "RRSIG", + "RT", + "SIG", + "SINK", + "SMIMEA", + "SOA", + "SPF", + "SRV", + "SSHFP", + "SVCB", + "TA", + "TALINK", + "TKEY", + "TLSA", + "TSIG", + "TXT", + "UINFO", + "UID", + "UNSPEC", + "URI", + "WKS", + "X25", + "ZONEMD", + ] + ] + | Omit = omit, + response_code: Literal[ + "NOERROR", + "FORMERR", + "SERVFAIL", + "NXDOMAIN", + "NOTIMP", + "REFUSED", + "YXDOMAIN", + "YXRRSET", + "NXRRSET", + "NOTAUTH", + "NOTZONE", + "BADSIG", + "BADKEY", + "BADTIME", + "BADMODE", + "BADNAME", + "BADALG", + "BADTRUNC", + "BADCOOKIE", + ] + | Omit = omit, + tld: 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, + ) -> DNSTimeseriesGroupsV2Response: + """ + Retrieves the distribution of DNS queries grouped by dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + nodata: Specifies whether the response includes empty DNS responses (NODATA). + + protocol: Filters results by DNS transport protocol. + + query_type: Filters results by DNS query type. + + response_code: Filters results by DNS response code. + + tld: Filters results by country code top-level domain (ccTLD). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/dns/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "nodata": nodata, + "protocol": protocol, + "query_type": query_type, + "response_code": response_code, + "tld": tld, + }, + dns_timeseries_groups_v2_params.DNSTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[DNSTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[DNSTimeseriesGroupsV2Response], ResultWrapper[DNSTimeseriesGroupsV2Response]), + ) + + +class AsyncDNSResource(AsyncAPIResource): + @cached_property + def top(self) -> AsyncTopResource: + return AsyncTopResource(self._client) + + @cached_property + def summary(self) -> AsyncSummaryResource: + return AsyncSummaryResource(self._client) + + @cached_property + def timeseries_groups(self) -> AsyncTimeseriesGroupsResource: + return AsyncTimeseriesGroupsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncDNSResourceWithRawResponse: + """ + 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 AsyncDNSResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDNSResourceWithStreamingResponse: + """ + 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 AsyncDNSResourceWithStreamingResponse(self) + + async def summary_v2( + self, + dimension: Literal[ + "IP_VERSION", + "CACHE_HIT", + "DNSSEC", + "DNSSEC_AWARE", + "DNSSEC_E2E", + "MATCHING_ANSWER", + "PROTOCOL", + "QUERY_TYPE", + "RESPONSE_CODE", + "RESPONSE_TTL", + ], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, + query_type: Optional[ + Literal[ + "A", + "AAAA", + "A6", + "AFSDB", + "ANY", + "APL", + "ATMA", + "AXFR", + "CAA", + "CDNSKEY", + "CDS", + "CERT", + "CNAME", + "CSYNC", + "DHCID", + "DLV", + "DNAME", + "DNSKEY", + "DOA", + "DS", + "EID", + "EUI48", + "EUI64", + "GPOS", + "GID", + "HINFO", + "HIP", + "HTTPS", + "IPSECKEY", + "ISDN", + "IXFR", + "KEY", + "KX", + "L32", + "L64", + "LOC", + "LP", + "MAILA", + "MAILB", + "MB", + "MD", + "MF", + "MG", + "MINFO", + "MR", + "MX", + "NAPTR", + "NB", + "NBSTAT", + "NID", + "NIMLOC", + "NINFO", + "NS", + "NSAP", + "NSEC", + "NSEC3", + "NSEC3PARAM", + "NULL", + "NXT", + "OPENPGPKEY", + "OPT", + "PTR", + "PX", + "RKEY", + "RP", + "RRSIG", + "RT", + "SIG", + "SINK", + "SMIMEA", + "SOA", + "SPF", + "SRV", + "SSHFP", + "SVCB", + "TA", + "TALINK", + "TKEY", + "TLSA", + "TSIG", + "TXT", + "UINFO", + "UID", + "UNSPEC", + "URI", + "WKS", + "X25", + "ZONEMD", + ] + ] + | Omit = omit, + response_code: Literal[ + "NOERROR", + "FORMERR", + "SERVFAIL", + "NXDOMAIN", + "NOTIMP", + "REFUSED", + "YXDOMAIN", + "YXRRSET", + "NXRRSET", + "NOTAUTH", + "NOTZONE", + "BADSIG", + "BADKEY", + "BADTIME", + "BADMODE", + "BADNAME", + "BADALG", + "BADTRUNC", + "BADCOOKIE", + ] + | Omit = omit, + tld: 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, + ) -> DNSSummaryV2Response: + """ + Retrieves the distribution of DNS queries by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + nodata: Specifies whether the response includes empty DNS responses (NODATA). + + protocol: Filters results by DNS transport protocol. + + query_type: Filters results by DNS query type. + + response_code: Filters results by DNS response code. + + tld: Filters results by country code top-level domain (ccTLD). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/dns/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "nodata": nodata, + "protocol": protocol, + "query_type": query_type, + "response_code": response_code, + "tld": tld, + }, + dns_summary_v2_params.DNSSummaryV2Params, + ), + post_parser=ResultWrapper[DNSSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[DNSSummaryV2Response], ResultWrapper[DNSSummaryV2Response]), + ) + + async def timeseries( + self, + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -188,7 +1153,7 @@ def timeseries( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -210,14 +1175,14 @@ def timeseries( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DNSTimeseriesResponse: """ Retrieves normalized query volume to the 1.1.1.1 DNS resolver over time. @@ -270,14 +1235,14 @@ def timeseries( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return await self._get( "/radar/dns/timeseries", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( + query=await async_maybe_transform( { "agg_interval": agg_interval, "asn": asn, @@ -301,53 +1266,33 @@ def timeseries( cast_to=cast(Type[DNSTimeseriesResponse], ResultWrapper[DNSTimeseriesResponse]), ) - -class AsyncDNSResource(AsyncAPIResource): - @cached_property - def top(self) -> AsyncTopResource: - return AsyncTopResource(self._client) - - @cached_property - def summary(self) -> AsyncSummaryResource: - return AsyncSummaryResource(self._client) - - @cached_property - def timeseries_groups(self) -> AsyncTimeseriesGroupsResource: - return AsyncTimeseriesGroupsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncDNSResourceWithRawResponse: - """ - 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 AsyncDNSResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncDNSResourceWithStreamingResponse: - """ - 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 AsyncDNSResourceWithStreamingResponse(self) - - async def timeseries( + async def timeseries_groups_v2( self, + dimension: Literal[ + "IP_VERSION", + "CACHE_HIT", + "DNSSEC", + "DNSSEC_AWARE", + "DNSSEC_E2E", + "MATCHING_ANSWER", + "PROTOCOL", + "QUERY_TYPE", + "RESPONSE_CODE", + "RESPONSE_TTL", + ], *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -440,7 +1385,7 @@ async def timeseries( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -462,19 +1407,21 @@ async def timeseries( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, - ) -> DNSTimeseriesResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> DNSTimeseriesGroupsV2Response: """ - Retrieves normalized query volume to the 1.1.1.1 DNS resolver over time. + Retrieves the distribution of DNS queries grouped by dimension over time. Args: + dimension: Specifies the attribute by which to group the results. + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). Refer to [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). @@ -498,6 +1445,10 @@ async def timeseries( format: Format in which results will be returned. + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude locations from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -522,8 +1473,10 @@ async def timeseries( timeout: Override the client-level default timeout for this request, in seconds """ + if not dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") return await self._get( - "/radar/dns/timeseries", + f"/radar/dns/timeseries_groups/{dimension}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -538,6 +1491,7 @@ async def timeseries( "date_range": date_range, "date_start": date_start, "format": format, + "limit_per_group": limit_per_group, "location": location, "name": name, "nodata": nodata, @@ -546,11 +1500,11 @@ async def timeseries( "response_code": response_code, "tld": tld, }, - dns_timeseries_params.DNSTimeseriesParams, + dns_timeseries_groups_v2_params.DNSTimeseriesGroupsV2Params, ), - post_parser=ResultWrapper[DNSTimeseriesResponse]._unwrapper, + post_parser=ResultWrapper[DNSTimeseriesGroupsV2Response]._unwrapper, ), - cast_to=cast(Type[DNSTimeseriesResponse], ResultWrapper[DNSTimeseriesResponse]), + cast_to=cast(Type[DNSTimeseriesGroupsV2Response], ResultWrapper[DNSTimeseriesGroupsV2Response]), ) @@ -558,9 +1512,15 @@ class DNSResourceWithRawResponse: def __init__(self, dns: DNSResource) -> None: self._dns = dns + self.summary_v2 = to_raw_response_wrapper( + dns.summary_v2, + ) self.timeseries = to_raw_response_wrapper( dns.timeseries, ) + self.timeseries_groups_v2 = to_raw_response_wrapper( + dns.timeseries_groups_v2, + ) @cached_property def top(self) -> TopResourceWithRawResponse: @@ -579,9 +1539,15 @@ class AsyncDNSResourceWithRawResponse: def __init__(self, dns: AsyncDNSResource) -> None: self._dns = dns + self.summary_v2 = async_to_raw_response_wrapper( + dns.summary_v2, + ) self.timeseries = async_to_raw_response_wrapper( dns.timeseries, ) + self.timeseries_groups_v2 = async_to_raw_response_wrapper( + dns.timeseries_groups_v2, + ) @cached_property def top(self) -> AsyncTopResourceWithRawResponse: @@ -600,9 +1566,15 @@ class DNSResourceWithStreamingResponse: def __init__(self, dns: DNSResource) -> None: self._dns = dns + self.summary_v2 = to_streamed_response_wrapper( + dns.summary_v2, + ) self.timeseries = to_streamed_response_wrapper( dns.timeseries, ) + self.timeseries_groups_v2 = to_streamed_response_wrapper( + dns.timeseries_groups_v2, + ) @cached_property def top(self) -> TopResourceWithStreamingResponse: @@ -621,9 +1593,15 @@ class AsyncDNSResourceWithStreamingResponse: def __init__(self, dns: AsyncDNSResource) -> None: self._dns = dns + self.summary_v2 = async_to_streamed_response_wrapper( + dns.summary_v2, + ) self.timeseries = async_to_streamed_response_wrapper( dns.timeseries, ) + self.timeseries_groups_v2 = async_to_streamed_response_wrapper( + dns.timeseries_groups_v2, + ) @cached_property def top(self) -> AsyncTopResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/radar/dns/summary.py b/src/cloudflare/resources/radar/dns/summary.py index f7940c65903..92883ce38c2 100644 --- a/src/cloudflare/resources/radar/dns/summary.py +++ b/src/cloudflare/resources/radar/dns/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +import typing_extensions +from typing import Type, Union, Optional, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -66,19 +67,22 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) def cache_hit( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -171,7 +175,7 @@ def cache_hit( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -193,14 +197,14 @@ def cache_hit( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryCacheHitResponse: """ Retrieves the distribution of DNS queries by cache status. @@ -279,19 +283,22 @@ def cache_hit( cast_to=cast(Type[SummaryCacheHitResponse], ResultWrapper[SummaryCacheHitResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) def dnssec( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -384,7 +391,7 @@ def dnssec( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -406,14 +413,14 @@ def dnssec( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDNSSECResponse: """ Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) @@ -493,19 +500,22 @@ def dnssec( cast_to=cast(Type[SummaryDNSSECResponse], ResultWrapper[SummaryDNSSECResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) def dnssec_aware( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -598,7 +608,7 @@ def dnssec_aware( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -620,14 +630,14 @@ def dnssec_aware( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDNSSECAwareResponse: """ Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) @@ -707,19 +717,22 @@ def dnssec_aware( cast_to=cast(Type[SummaryDNSSECAwareResponse], ResultWrapper[SummaryDNSSECAwareResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) def dnssec_e2e( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -812,7 +825,7 @@ def dnssec_e2e( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -834,14 +847,14 @@ def dnssec_e2e( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDNSSECE2EResponse: """ Retrieves the distribution of DNSSEC-validated answers by end-to-end security @@ -921,19 +934,22 @@ def dnssec_e2e( cast_to=cast(Type[SummaryDNSSECE2EResponse], ResultWrapper[SummaryDNSSECE2EResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) def ip_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1026,7 +1042,7 @@ def ip_version( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1048,14 +1064,14 @@ def ip_version( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of DNS queries by IP version. @@ -1134,19 +1150,22 @@ def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) def matching_answer( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1239,7 +1258,7 @@ def matching_answer( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1261,14 +1280,14 @@ def matching_answer( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryMatchingAnswerResponse: """ Retrieves the distribution of DNS queries by matching answers. @@ -1347,18 +1366,21 @@ def matching_answer( cast_to=cast(Type[SummaryMatchingAnswerResponse], ResultWrapper[SummaryMatchingAnswerResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) def protocol( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1451,7 +1473,7 @@ def protocol( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1473,14 +1495,14 @@ def protocol( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryProtocolResponse: """ Retrieves the distribution of DNS queries by DNS transport protocol. @@ -1556,20 +1578,23 @@ def protocol( cast_to=cast(Type[SummaryProtocolResponse], ResultWrapper[SummaryProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) def query_type( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1591,14 +1616,14 @@ def query_type( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryQueryTypeResponse: """ Retrieves the distribution of DNS queries by type. @@ -1679,20 +1704,23 @@ def query_type( cast_to=cast(Type[SummaryQueryTypeResponse], ResultWrapper[SummaryQueryTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) def response_code( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1785,14 +1813,14 @@ def response_code( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryResponseCodeResponse: """ Retrieves the distribution of DNS queries by response code. @@ -1873,19 +1901,22 @@ def response_code( cast_to=cast(Type[SummaryResponseCodeResponse], ResultWrapper[SummaryResponseCodeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) def response_ttl( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1978,7 +2009,7 @@ def response_ttl( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2000,14 +2031,14 @@ def response_ttl( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryResponseTTLResponse: """ Retrieves the distribution of DNS queries by minimum response TTL. @@ -2107,19 +2138,22 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) async def cache_hit( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2212,7 +2246,7 @@ async def cache_hit( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2234,14 +2268,14 @@ async def cache_hit( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryCacheHitResponse: """ Retrieves the distribution of DNS queries by cache status. @@ -2320,19 +2354,22 @@ async def cache_hit( cast_to=cast(Type[SummaryCacheHitResponse], ResultWrapper[SummaryCacheHitResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) async def dnssec( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2425,7 +2462,7 @@ async def dnssec( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2447,14 +2484,14 @@ async def dnssec( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDNSSECResponse: """ Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) @@ -2534,19 +2571,22 @@ async def dnssec( cast_to=cast(Type[SummaryDNSSECResponse], ResultWrapper[SummaryDNSSECResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) async def dnssec_aware( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2639,7 +2679,7 @@ async def dnssec_aware( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2661,14 +2701,14 @@ async def dnssec_aware( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDNSSECAwareResponse: """ Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) @@ -2748,19 +2788,22 @@ async def dnssec_aware( cast_to=cast(Type[SummaryDNSSECAwareResponse], ResultWrapper[SummaryDNSSECAwareResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) async def dnssec_e2e( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2853,7 +2896,7 @@ async def dnssec_e2e( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2875,14 +2918,14 @@ async def dnssec_e2e( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDNSSECE2EResponse: """ Retrieves the distribution of DNSSEC-validated answers by end-to-end security @@ -2962,19 +3005,22 @@ async def dnssec_e2e( cast_to=cast(Type[SummaryDNSSECE2EResponse], ResultWrapper[SummaryDNSSECE2EResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) async def ip_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -3067,7 +3113,7 @@ async def ip_version( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -3089,14 +3135,14 @@ async def ip_version( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of DNS queries by IP version. @@ -3175,19 +3221,22 @@ async def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) async def matching_answer( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -3280,7 +3329,7 @@ async def matching_answer( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -3302,14 +3351,14 @@ async def matching_answer( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryMatchingAnswerResponse: """ Retrieves the distribution of DNS queries by matching answers. @@ -3388,18 +3437,21 @@ async def matching_answer( cast_to=cast(Type[SummaryMatchingAnswerResponse], ResultWrapper[SummaryMatchingAnswerResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) async def protocol( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, query_type: Optional[ Literal[ "A", @@ -3492,7 +3544,7 @@ async def protocol( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -3514,14 +3566,14 @@ async def protocol( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryProtocolResponse: """ Retrieves the distribution of DNS queries by DNS transport protocol. @@ -3597,20 +3649,23 @@ async def protocol( cast_to=cast(Type[SummaryProtocolResponse], ResultWrapper[SummaryProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) async def query_type( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -3632,14 +3687,14 @@ async def query_type( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryQueryTypeResponse: """ Retrieves the distribution of DNS queries by type. @@ -3720,20 +3775,23 @@ async def query_type( cast_to=cast(Type[SummaryQueryTypeResponse], ResultWrapper[SummaryQueryTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) async def response_code( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -3826,14 +3884,14 @@ async def response_code( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryResponseCodeResponse: """ Retrieves the distribution of DNS queries by response code. @@ -3914,19 +3972,22 @@ async def response_code( cast_to=cast(Type[SummaryResponseCodeResponse], ResultWrapper[SummaryResponseCodeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/summary_v2/) instead." + ) async def response_ttl( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -4019,7 +4080,7 @@ async def response_ttl( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -4041,14 +4102,14 @@ async def response_ttl( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryResponseTTLResponse: """ Retrieves the distribution of DNS queries by minimum response TTL. @@ -4132,35 +4193,55 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.cache_hit = to_raw_response_wrapper( - summary.cache_hit, + self.cache_hit = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.cache_hit, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec = to_raw_response_wrapper( - summary.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_aware = to_raw_response_wrapper( - summary.dnssec_aware, + self.dnssec_aware = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.dnssec_aware, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_e2e = to_raw_response_wrapper( - summary.dnssec_e2e, + self.dnssec_e2e = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.dnssec_e2e, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.matching_answer = to_raw_response_wrapper( - summary.matching_answer, + self.matching_answer = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.matching_answer, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_raw_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = to_raw_response_wrapper( - summary.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_code = to_raw_response_wrapper( - summary.response_code, + self.response_code = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.response_code, # pyright: ignore[reportDeprecated], + ) ) - self.response_ttl = to_raw_response_wrapper( - summary.response_ttl, + self.response_ttl = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.response_ttl, # pyright: ignore[reportDeprecated], + ) ) @@ -4168,35 +4249,55 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.cache_hit = async_to_raw_response_wrapper( - summary.cache_hit, + self.cache_hit = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.cache_hit, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec = async_to_raw_response_wrapper( - summary.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_aware = async_to_raw_response_wrapper( - summary.dnssec_aware, + self.dnssec_aware = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.dnssec_aware, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_e2e = async_to_raw_response_wrapper( - summary.dnssec_e2e, + self.dnssec_e2e = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.dnssec_e2e, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.matching_answer = async_to_raw_response_wrapper( - summary.matching_answer, + self.matching_answer = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.matching_answer, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_raw_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = async_to_raw_response_wrapper( - summary.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_code = async_to_raw_response_wrapper( - summary.response_code, + self.response_code = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.response_code, # pyright: ignore[reportDeprecated], + ) ) - self.response_ttl = async_to_raw_response_wrapper( - summary.response_ttl, + self.response_ttl = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.response_ttl, # pyright: ignore[reportDeprecated], + ) ) @@ -4204,35 +4305,55 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.cache_hit = to_streamed_response_wrapper( - summary.cache_hit, + self.cache_hit = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.cache_hit, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec = to_streamed_response_wrapper( - summary.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_aware = to_streamed_response_wrapper( - summary.dnssec_aware, + self.dnssec_aware = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.dnssec_aware, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_e2e = to_streamed_response_wrapper( - summary.dnssec_e2e, + self.dnssec_e2e = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.dnssec_e2e, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.matching_answer = to_streamed_response_wrapper( - summary.matching_answer, + self.matching_answer = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.matching_answer, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_streamed_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = to_streamed_response_wrapper( - summary.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_code = to_streamed_response_wrapper( - summary.response_code, + self.response_code = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.response_code, # pyright: ignore[reportDeprecated], + ) ) - self.response_ttl = to_streamed_response_wrapper( - summary.response_ttl, + self.response_ttl = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.response_ttl, # pyright: ignore[reportDeprecated], + ) ) @@ -4240,33 +4361,53 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.cache_hit = async_to_streamed_response_wrapper( - summary.cache_hit, + self.cache_hit = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.cache_hit, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec = async_to_streamed_response_wrapper( - summary.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_aware = async_to_streamed_response_wrapper( - summary.dnssec_aware, + self.dnssec_aware = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.dnssec_aware, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_e2e = async_to_streamed_response_wrapper( - summary.dnssec_e2e, + self.dnssec_e2e = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.dnssec_e2e, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.matching_answer = async_to_streamed_response_wrapper( - summary.matching_answer, + self.matching_answer = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.matching_answer, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_streamed_response_wrapper( - summary.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = async_to_streamed_response_wrapper( - summary.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_code = async_to_streamed_response_wrapper( - summary.response_code, + self.response_code = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.response_code, # pyright: ignore[reportDeprecated], + ) ) - self.response_ttl = async_to_streamed_response_wrapper( - summary.response_ttl, + self.response_ttl = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.response_ttl, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/dns/timeseries_groups.py b/src/cloudflare/resources/radar/dns/timeseries_groups.py index cd257f962bd..fa22a6d2b8a 100644 --- a/src/cloudflare/resources/radar/dns/timeseries_groups.py +++ b/src/cloudflare/resources/radar/dns/timeseries_groups.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +import typing_extensions +from typing import Type, Union, Optional, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -66,20 +67,23 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon """ return TimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) def cache_hit( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -172,7 +176,7 @@ def cache_hit( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -194,14 +198,14 @@ def cache_hit( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupCacheHitResponse: """ Retrieves the distribution of DNS queries by cache status over time. @@ -285,20 +289,23 @@ def cache_hit( cast_to=cast(Type[TimeseriesGroupCacheHitResponse], ResultWrapper[TimeseriesGroupCacheHitResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) def dnssec( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -391,7 +398,7 @@ def dnssec( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -413,14 +420,14 @@ def dnssec( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDNSSECResponse: """ Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) @@ -505,20 +512,23 @@ def dnssec( cast_to=cast(Type[TimeseriesGroupDNSSECResponse], ResultWrapper[TimeseriesGroupDNSSECResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) def dnssec_aware( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -611,7 +621,7 @@ def dnssec_aware( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -633,14 +643,14 @@ def dnssec_aware( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDNSSECAwareResponse: """ Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) @@ -725,20 +735,23 @@ def dnssec_aware( cast_to=cast(Type[TimeseriesGroupDNSSECAwareResponse], ResultWrapper[TimeseriesGroupDNSSECAwareResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) def dnssec_e2e( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -831,7 +844,7 @@ def dnssec_e2e( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -853,14 +866,14 @@ def dnssec_e2e( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDNSSECE2EResponse: """ Retrieves the distribution of DNSSEC-validated answers by end-to-end security @@ -945,20 +958,23 @@ def dnssec_e2e( cast_to=cast(Type[TimeseriesGroupDNSSECE2EResponse], ResultWrapper[TimeseriesGroupDNSSECE2EResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1051,7 +1067,7 @@ def ip_version( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1073,14 +1089,14 @@ def ip_version( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of DNS queries by IP version over time. @@ -1164,20 +1180,23 @@ def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) def matching_answer( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1270,7 +1289,7 @@ def matching_answer( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1292,14 +1311,14 @@ def matching_answer( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupMatchingAnswerResponse: """ Retrieves the distribution of DNS queries by matching answers over time. @@ -1385,19 +1404,22 @@ def matching_answer( ), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) def protocol( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1490,7 +1512,7 @@ def protocol( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1512,14 +1534,14 @@ def protocol( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupProtocolResponse: """ Retrieves the distribution of DNS queries by DNS transport protocol over time. @@ -1600,21 +1622,24 @@ def protocol( cast_to=cast(Type[TimeseriesGroupProtocolResponse], ResultWrapper[TimeseriesGroupProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) def query_type( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -1636,14 +1661,14 @@ def query_type( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupQueryTypeResponse: """ Retrieves the distribution of DNS queries by type over time. @@ -1729,21 +1754,24 @@ def query_type( cast_to=cast(Type[TimeseriesGroupQueryTypeResponse], ResultWrapper[TimeseriesGroupQueryTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) def response_code( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -1836,14 +1864,14 @@ def response_code( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupResponseCodeResponse: """ Retrieves the distribution of DNS queries by response code over time. @@ -1929,20 +1957,23 @@ def response_code( cast_to=cast(Type[TimeseriesGroupResponseCodeResponse], ResultWrapper[TimeseriesGroupResponseCodeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) def response_ttl( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2035,7 +2066,7 @@ def response_ttl( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2057,14 +2088,14 @@ def response_ttl( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupResponseTTLResponse: """ Retrieves the distribution of DNS queries by minimum answer TTL over time. @@ -2169,20 +2200,23 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR """ return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) async def cache_hit( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2275,7 +2309,7 @@ async def cache_hit( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2297,14 +2331,14 @@ async def cache_hit( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupCacheHitResponse: """ Retrieves the distribution of DNS queries by cache status over time. @@ -2388,20 +2422,23 @@ async def cache_hit( cast_to=cast(Type[TimeseriesGroupCacheHitResponse], ResultWrapper[TimeseriesGroupCacheHitResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) async def dnssec( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2494,7 +2531,7 @@ async def dnssec( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2516,14 +2553,14 @@ async def dnssec( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDNSSECResponse: """ Retrieves the distribution of DNS responses by DNSSEC (DNS Security Extensions) @@ -2608,20 +2645,23 @@ async def dnssec( cast_to=cast(Type[TimeseriesGroupDNSSECResponse], ResultWrapper[TimeseriesGroupDNSSECResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) async def dnssec_aware( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2714,7 +2754,7 @@ async def dnssec_aware( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2736,14 +2776,14 @@ async def dnssec_aware( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDNSSECAwareResponse: """ Retrieves the distribution of DNS queries by DNSSEC (DNS Security Extensions) @@ -2828,20 +2868,23 @@ async def dnssec_aware( cast_to=cast(Type[TimeseriesGroupDNSSECAwareResponse], ResultWrapper[TimeseriesGroupDNSSECAwareResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) async def dnssec_e2e( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -2934,7 +2977,7 @@ async def dnssec_e2e( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -2956,14 +2999,14 @@ async def dnssec_e2e( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDNSSECE2EResponse: """ Retrieves the distribution of DNSSEC-validated answers by end-to-end security @@ -3048,20 +3091,23 @@ async def dnssec_e2e( cast_to=cast(Type[TimeseriesGroupDNSSECE2EResponse], ResultWrapper[TimeseriesGroupDNSSECE2EResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) async def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -3154,7 +3200,7 @@ async def ip_version( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -3176,14 +3222,14 @@ async def ip_version( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of DNS queries by IP version over time. @@ -3267,20 +3313,23 @@ async def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) async def matching_answer( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -3373,7 +3422,7 @@ async def matching_answer( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -3395,14 +3444,14 @@ async def matching_answer( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupMatchingAnswerResponse: """ Retrieves the distribution of DNS queries by matching answers over time. @@ -3488,19 +3537,22 @@ async def matching_answer( ), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) async def protocol( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, query_type: Optional[ Literal[ "A", @@ -3593,7 +3645,7 @@ async def protocol( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -3615,14 +3667,14 @@ async def protocol( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupProtocolResponse: """ Retrieves the distribution of DNS queries by DNS transport protocol over time. @@ -3703,21 +3755,24 @@ async def protocol( cast_to=cast(Type[TimeseriesGroupProtocolResponse], ResultWrapper[TimeseriesGroupProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) async def query_type( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -3739,14 +3794,14 @@ async def query_type( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupQueryTypeResponse: """ Retrieves the distribution of DNS queries by type over time. @@ -3832,21 +3887,24 @@ async def query_type( cast_to=cast(Type[TimeseriesGroupQueryTypeResponse], ResultWrapper[TimeseriesGroupQueryTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) async def response_code( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -3939,14 +3997,14 @@ async def response_code( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupResponseCodeResponse: """ Retrieves the distribution of DNS queries by response code over time. @@ -4032,20 +4090,23 @@ async def response_code( cast_to=cast(Type[TimeseriesGroupResponseCodeResponse], ResultWrapper[TimeseriesGroupResponseCodeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar DNS Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/dns/methods/timeseries_groups_v2/) instead." + ) async def response_ttl( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - nodata: bool | NotGiven = NOT_GIVEN, - protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + nodata: bool | Omit = omit, + protocol: Literal["UDP", "TCP", "HTTPS", "TLS"] | Omit = omit, query_type: Optional[ Literal[ "A", @@ -4138,7 +4199,7 @@ async def response_ttl( "ZONEMD", ] ] - | NotGiven = NOT_GIVEN, + | Omit = omit, response_code: Literal[ "NOERROR", "FORMERR", @@ -4160,14 +4221,14 @@ async def response_ttl( "BADTRUNC", "BADCOOKIE", ] - | NotGiven = NOT_GIVEN, - tld: List[str] | NotGiven = NOT_GIVEN, + | Omit = omit, + tld: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupResponseTTLResponse: """ Retrieves the distribution of DNS queries by minimum answer TTL over time. @@ -4256,35 +4317,55 @@ class TimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.cache_hit = to_raw_response_wrapper( - timeseries_groups.cache_hit, + self.cache_hit = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.cache_hit, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec = to_raw_response_wrapper( - timeseries_groups.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_aware = to_raw_response_wrapper( - timeseries_groups.dnssec_aware, + self.dnssec_aware = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.dnssec_aware, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_e2e = to_raw_response_wrapper( - timeseries_groups.dnssec_e2e, + self.dnssec_e2e = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.dnssec_e2e, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.matching_answer = to_raw_response_wrapper( - timeseries_groups.matching_answer, + self.matching_answer = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.matching_answer, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_raw_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = to_raw_response_wrapper( - timeseries_groups.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_code = to_raw_response_wrapper( - timeseries_groups.response_code, + self.response_code = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.response_code, # pyright: ignore[reportDeprecated], + ) ) - self.response_ttl = to_raw_response_wrapper( - timeseries_groups.response_ttl, + self.response_ttl = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.response_ttl, # pyright: ignore[reportDeprecated], + ) ) @@ -4292,35 +4373,55 @@ class AsyncTimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.cache_hit = async_to_raw_response_wrapper( - timeseries_groups.cache_hit, + self.cache_hit = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.cache_hit, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec = async_to_raw_response_wrapper( - timeseries_groups.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_aware = async_to_raw_response_wrapper( - timeseries_groups.dnssec_aware, + self.dnssec_aware = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.dnssec_aware, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_e2e = async_to_raw_response_wrapper( - timeseries_groups.dnssec_e2e, + self.dnssec_e2e = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.dnssec_e2e, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.matching_answer = async_to_raw_response_wrapper( - timeseries_groups.matching_answer, + self.matching_answer = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.matching_answer, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_raw_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = async_to_raw_response_wrapper( - timeseries_groups.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_code = async_to_raw_response_wrapper( - timeseries_groups.response_code, + self.response_code = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.response_code, # pyright: ignore[reportDeprecated], + ) ) - self.response_ttl = async_to_raw_response_wrapper( - timeseries_groups.response_ttl, + self.response_ttl = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.response_ttl, # pyright: ignore[reportDeprecated], + ) ) @@ -4328,35 +4429,55 @@ class TimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.cache_hit = to_streamed_response_wrapper( - timeseries_groups.cache_hit, + self.cache_hit = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.cache_hit, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec = to_streamed_response_wrapper( - timeseries_groups.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_aware = to_streamed_response_wrapper( - timeseries_groups.dnssec_aware, + self.dnssec_aware = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.dnssec_aware, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_e2e = to_streamed_response_wrapper( - timeseries_groups.dnssec_e2e, + self.dnssec_e2e = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.dnssec_e2e, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.matching_answer = to_streamed_response_wrapper( - timeseries_groups.matching_answer, + self.matching_answer = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.matching_answer, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = to_streamed_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = to_streamed_response_wrapper( - timeseries_groups.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_code = to_streamed_response_wrapper( - timeseries_groups.response_code, + self.response_code = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.response_code, # pyright: ignore[reportDeprecated], + ) ) - self.response_ttl = to_streamed_response_wrapper( - timeseries_groups.response_ttl, + self.response_ttl = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.response_ttl, # pyright: ignore[reportDeprecated], + ) ) @@ -4364,33 +4485,53 @@ class AsyncTimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.cache_hit = async_to_streamed_response_wrapper( - timeseries_groups.cache_hit, + self.cache_hit = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.cache_hit, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec = async_to_streamed_response_wrapper( - timeseries_groups.dnssec, + self.dnssec = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.dnssec, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_aware = async_to_streamed_response_wrapper( - timeseries_groups.dnssec_aware, + self.dnssec_aware = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.dnssec_aware, # pyright: ignore[reportDeprecated], + ) ) - self.dnssec_e2e = async_to_streamed_response_wrapper( - timeseries_groups.dnssec_e2e, + self.dnssec_e2e = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.dnssec_e2e, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.matching_answer = async_to_streamed_response_wrapper( - timeseries_groups.matching_answer, + self.matching_answer = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.matching_answer, # pyright: ignore[reportDeprecated], + ) ) - self.protocol = async_to_streamed_response_wrapper( - timeseries_groups.protocol, + self.protocol = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.protocol, # pyright: ignore[reportDeprecated], + ) ) - self.query_type = async_to_streamed_response_wrapper( - timeseries_groups.query_type, + self.query_type = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.query_type, # pyright: ignore[reportDeprecated], + ) ) - self.response_code = async_to_streamed_response_wrapper( - timeseries_groups.response_code, + self.response_code = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.response_code, # pyright: ignore[reportDeprecated], + ) ) - self.response_ttl = async_to_streamed_response_wrapper( - timeseries_groups.response_ttl, + self.response_ttl = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.response_ttl, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/dns/top.py b/src/cloudflare/resources/radar/dns/top.py index 614ea47c49d..0c2e7061b00 100644 --- a/src/cloudflare/resources/radar/dns/top.py +++ b/src/cloudflare/resources/radar/dns/top.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,22 +50,22 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse: def ases( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - domain: List[str] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + domain: SequenceNotStr[str] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopAsesResponse: """ Retrieves the top autonomous systems by DNS queries made to 1.1.1.1 DNS @@ -139,22 +139,22 @@ def ases( def locations( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - domain: List[str] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + domain: SequenceNotStr[str] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopLocationsResponse: """ Retrieves the top locations by DNS queries made to 1.1.1.1 DNS resolver. @@ -248,22 +248,22 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: async def ases( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - domain: List[str] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + domain: SequenceNotStr[str] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopAsesResponse: """ Retrieves the top autonomous systems by DNS queries made to 1.1.1.1 DNS @@ -337,22 +337,22 @@ async def ases( async def locations( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - domain: List[str] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + domain: SequenceNotStr[str] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopLocationsResponse: """ Retrieves the top locations by DNS queries made to 1.1.1.1 DNS resolver. diff --git a/src/cloudflare/resources/radar/email/routing/routing.py b/src/cloudflare/resources/radar/email/routing/routing.py index 9aa2bb27b75..7a036446f79 100644 --- a/src/cloudflare/resources/radar/email/routing/routing.py +++ b/src/cloudflare/resources/radar/email/routing/routing.py @@ -2,6 +2,12 @@ from __future__ import annotations +from typing import List, Type, Union, cast +from datetime import datetime +from typing_extensions import Literal + +import httpx + from .summary import ( SummaryResource, AsyncSummaryResource, @@ -10,8 +16,18 @@ SummaryResourceWithStreamingResponse, AsyncSummaryResourceWithStreamingResponse, ) +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 .timeseries_groups import ( TimeseriesGroupsResource, AsyncTimeseriesGroupsResource, @@ -20,6 +36,9 @@ TimeseriesGroupsResourceWithStreamingResponse, AsyncTimeseriesGroupsResourceWithStreamingResponse, ) +from .....types.radar.email import routing_summary_v2_params, routing_timeseries_groups_v2_params +from .....types.radar.email.routing_summary_v2_response import RoutingSummaryV2Response +from .....types.radar.email.routing_timeseries_groups_v2_response import RoutingTimeseriesGroupsV2Response __all__ = ["RoutingResource", "AsyncRoutingResource"] @@ -52,6 +71,207 @@ def with_streaming_response(self) -> RoutingResourceWithStreamingResponse: """ return RoutingResourceWithStreamingResponse(self) + def summary_v2( + self, + dimension: Literal["IP_VERSION", "ENCRYPTED", "ARC", "DKIM", "DMARC", "SPF"], + *, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RoutingSummaryV2Response: + """ + Retrieves the distribution of email routing metrics by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + arc: Filters results by ARC (Authenticated Received Chain) validation. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. + + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). + + format: Format in which results will be returned. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + spf: Filters results by SPF (Sender Policy Framework) validation status. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/email/routing/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "arc": arc, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "dkim": dkim, + "dmarc": dmarc, + "encrypted": encrypted, + "format": format, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "name": name, + "spf": spf, + }, + routing_summary_v2_params.RoutingSummaryV2Params, + ), + post_parser=ResultWrapper[RoutingSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[RoutingSummaryV2Response], ResultWrapper[RoutingSummaryV2Response]), + ) + + def timeseries_groups_v2( + self, + dimension: Literal["IP_VERSION", "ENCRYPTED", "ARC", "DKIM", "DMARC", "SPF"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RoutingTimeseriesGroupsV2Response: + """ + Retrieves the distribution of email routing metrics grouped by dimension over + time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + arc: Filters results by ARC (Authenticated Received Chain) validation. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. + + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). + + format: Format in which results will be returned. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + spf: Filters results by SPF (Sender Policy Framework) validation status. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/email/routing/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "arc": arc, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "dkim": dkim, + "dmarc": dmarc, + "encrypted": encrypted, + "format": format, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "name": name, + "spf": spf, + }, + routing_timeseries_groups_v2_params.RoutingTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[RoutingTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[RoutingTimeseriesGroupsV2Response], ResultWrapper[RoutingTimeseriesGroupsV2Response]), + ) + class AsyncRoutingResource(AsyncAPIResource): @cached_property @@ -81,11 +301,219 @@ def with_streaming_response(self) -> AsyncRoutingResourceWithStreamingResponse: """ return AsyncRoutingResourceWithStreamingResponse(self) + async def summary_v2( + self, + dimension: Literal["IP_VERSION", "ENCRYPTED", "ARC", "DKIM", "DMARC", "SPF"], + *, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RoutingSummaryV2Response: + """ + Retrieves the distribution of email routing metrics by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + arc: Filters results by ARC (Authenticated Received Chain) validation. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. + + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). + + format: Format in which results will be returned. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + spf: Filters results by SPF (Sender Policy Framework) validation status. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/email/routing/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "arc": arc, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "dkim": dkim, + "dmarc": dmarc, + "encrypted": encrypted, + "format": format, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "name": name, + "spf": spf, + }, + routing_summary_v2_params.RoutingSummaryV2Params, + ), + post_parser=ResultWrapper[RoutingSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[RoutingSummaryV2Response], ResultWrapper[RoutingSummaryV2Response]), + ) + + async def timeseries_groups_v2( + self, + dimension: Literal["IP_VERSION", "ENCRYPTED", "ARC", "DKIM", "DMARC", "SPF"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RoutingTimeseriesGroupsV2Response: + """ + Retrieves the distribution of email routing metrics grouped by dimension over + time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + arc: Filters results by ARC (Authenticated Received Chain) validation. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. + + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + + encrypted: Filters results by encryption status (encrypted vs. not-encrypted). + + format: Format in which results will be returned. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + spf: Filters results by SPF (Sender Policy Framework) validation status. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/email/routing/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "arc": arc, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "dkim": dkim, + "dmarc": dmarc, + "encrypted": encrypted, + "format": format, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "name": name, + "spf": spf, + }, + routing_timeseries_groups_v2_params.RoutingTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[RoutingTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[RoutingTimeseriesGroupsV2Response], ResultWrapper[RoutingTimeseriesGroupsV2Response]), + ) + class RoutingResourceWithRawResponse: def __init__(self, routing: RoutingResource) -> None: self._routing = routing + self.summary_v2 = to_raw_response_wrapper( + routing.summary_v2, + ) + self.timeseries_groups_v2 = to_raw_response_wrapper( + routing.timeseries_groups_v2, + ) + @cached_property def summary(self) -> SummaryResourceWithRawResponse: return SummaryResourceWithRawResponse(self._routing.summary) @@ -99,6 +527,13 @@ class AsyncRoutingResourceWithRawResponse: def __init__(self, routing: AsyncRoutingResource) -> None: self._routing = routing + self.summary_v2 = async_to_raw_response_wrapper( + routing.summary_v2, + ) + self.timeseries_groups_v2 = async_to_raw_response_wrapper( + routing.timeseries_groups_v2, + ) + @cached_property def summary(self) -> AsyncSummaryResourceWithRawResponse: return AsyncSummaryResourceWithRawResponse(self._routing.summary) @@ -112,6 +547,13 @@ class RoutingResourceWithStreamingResponse: def __init__(self, routing: RoutingResource) -> None: self._routing = routing + self.summary_v2 = to_streamed_response_wrapper( + routing.summary_v2, + ) + self.timeseries_groups_v2 = to_streamed_response_wrapper( + routing.timeseries_groups_v2, + ) + @cached_property def summary(self) -> SummaryResourceWithStreamingResponse: return SummaryResourceWithStreamingResponse(self._routing.summary) @@ -125,6 +567,13 @@ class AsyncRoutingResourceWithStreamingResponse: def __init__(self, routing: AsyncRoutingResource) -> None: self._routing = routing + self.summary_v2 = async_to_streamed_response_wrapper( + routing.summary_v2, + ) + self.timeseries_groups_v2 = async_to_streamed_response_wrapper( + routing.timeseries_groups_v2, + ) + @cached_property def summary(self) -> AsyncSummaryResourceWithStreamingResponse: return AsyncSummaryResourceWithStreamingResponse(self._routing.summary) diff --git a/src/cloudflare/resources/radar/email/routing/summary.py b/src/cloudflare/resources/radar/email/routing/summary.py index 3b6b134e8a2..a2c25481826 100644 --- a/src/cloudflare/resources/radar/email/routing/summary.py +++ b/src/cloudflare/resources/radar/email/routing/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,25 +59,28 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) def arc( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryARCResponse: """ Retrieves the distribution of emails by ARC (Authenticated Received Chain) @@ -141,25 +145,28 @@ def arc( cast_to=cast(Type[SummaryARCResponse], ResultWrapper[SummaryARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) def dkim( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDKIMResponse: """ Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) @@ -224,25 +231,28 @@ def dkim( cast_to=cast(Type[SummaryDKIMResponse], ResultWrapper[SummaryDKIMResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) def dmarc( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDMARCResponse: """ Retrieves the distribution of emails by DMARC (Domain-based Message @@ -306,25 +316,28 @@ def dmarc( cast_to=cast(Type[SummaryDMARCResponse], ResultWrapper[SummaryDMARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) def encrypted( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryEncryptedResponse: """ Retrieves the distribution of emails by encryption status (encrypted vs. @@ -389,25 +402,28 @@ def encrypted( cast_to=cast(Type[SummaryEncryptedResponse], ResultWrapper[SummaryEncryptedResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) def ip_version( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of emails by IP version. @@ -471,25 +487,28 @@ def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) def spf( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummarySPFResponse: """ Retrieves the distribution of emails by SPF (Sender Policy Framework) @@ -575,25 +594,28 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) async def arc( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryARCResponse: """ Retrieves the distribution of emails by ARC (Authenticated Received Chain) @@ -658,25 +680,28 @@ async def arc( cast_to=cast(Type[SummaryARCResponse], ResultWrapper[SummaryARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) async def dkim( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDKIMResponse: """ Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) @@ -741,25 +766,28 @@ async def dkim( cast_to=cast(Type[SummaryDKIMResponse], ResultWrapper[SummaryDKIMResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) async def dmarc( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDMARCResponse: """ Retrieves the distribution of emails by DMARC (Domain-based Message @@ -823,25 +851,28 @@ async def dmarc( cast_to=cast(Type[SummaryDMARCResponse], ResultWrapper[SummaryDMARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) async def encrypted( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryEncryptedResponse: """ Retrieves the distribution of emails by encryption status (encrypted vs. @@ -906,25 +937,28 @@ async def encrypted( cast_to=cast(Type[SummaryEncryptedResponse], ResultWrapper[SummaryEncryptedResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) async def ip_version( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of emails by IP version. @@ -988,25 +1022,28 @@ async def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/summary_v2/) instead." + ) async def spf( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummarySPFResponse: """ Retrieves the distribution of emails by SPF (Sender Policy Framework) @@ -1076,23 +1113,35 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.arc = to_raw_response_wrapper( - summary.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = to_raw_response_wrapper( - summary.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = to_raw_response_wrapper( - summary.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.encrypted = to_raw_response_wrapper( - summary.encrypted, + self.encrypted = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.encrypted, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.spf = to_raw_response_wrapper( - summary.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.spf, # pyright: ignore[reportDeprecated], + ) ) @@ -1100,23 +1149,35 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.arc = async_to_raw_response_wrapper( - summary.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = async_to_raw_response_wrapper( - summary.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = async_to_raw_response_wrapper( - summary.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.encrypted = async_to_raw_response_wrapper( - summary.encrypted, + self.encrypted = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.encrypted, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.spf = async_to_raw_response_wrapper( - summary.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.spf, # pyright: ignore[reportDeprecated], + ) ) @@ -1124,23 +1185,35 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.arc = to_streamed_response_wrapper( - summary.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = to_streamed_response_wrapper( - summary.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = to_streamed_response_wrapper( - summary.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.encrypted = to_streamed_response_wrapper( - summary.encrypted, + self.encrypted = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.encrypted, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.spf = to_streamed_response_wrapper( - summary.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.spf, # pyright: ignore[reportDeprecated], + ) ) @@ -1148,21 +1221,33 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.arc = async_to_streamed_response_wrapper( - summary.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = async_to_streamed_response_wrapper( - summary.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = async_to_streamed_response_wrapper( - summary.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.encrypted = async_to_streamed_response_wrapper( - summary.encrypted, + self.encrypted = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.encrypted, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.spf = async_to_streamed_response_wrapper( - summary.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.spf, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/email/routing/timeseries_groups.py b/src/cloudflare/resources/radar/email/routing/timeseries_groups.py index 4388ac4412d..4d0eabea887 100644 --- a/src/cloudflare/resources/radar/email/routing/timeseries_groups.py +++ b/src/cloudflare/resources/radar/email/routing/timeseries_groups.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,26 +59,29 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon """ return TimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) def arc( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupARCResponse: """ Retrieves the distribution of emails by ARC (Authenticated Received Chain) @@ -147,26 +151,29 @@ def arc( cast_to=cast(Type[TimeseriesGroupARCResponse], ResultWrapper[TimeseriesGroupARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) def dkim( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDKIMResponse: """ Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) @@ -236,26 +243,29 @@ def dkim( cast_to=cast(Type[TimeseriesGroupDKIMResponse], ResultWrapper[TimeseriesGroupDKIMResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) def dmarc( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDMARCResponse: """ Retrieves the distribution of emails by DMARC (Domain-based Message @@ -324,26 +334,29 @@ def dmarc( cast_to=cast(Type[TimeseriesGroupDMARCResponse], ResultWrapper[TimeseriesGroupDMARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) def encrypted( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupEncryptedResponse: """ Retrieves the distribution of emails by encryption status (encrypted vs. @@ -413,26 +426,29 @@ def encrypted( cast_to=cast(Type[TimeseriesGroupEncryptedResponse], ResultWrapper[TimeseriesGroupEncryptedResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of emails by IP version over time. @@ -501,26 +517,29 @@ def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) def spf( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupSPFResponse: """ Retrieves the distribution of emails by SPF (Sender Policy Framework) validation @@ -611,26 +630,29 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR """ return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) async def arc( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupARCResponse: """ Retrieves the distribution of emails by ARC (Authenticated Received Chain) @@ -700,26 +722,29 @@ async def arc( cast_to=cast(Type[TimeseriesGroupARCResponse], ResultWrapper[TimeseriesGroupARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) async def dkim( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDKIMResponse: """ Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) @@ -789,26 +814,29 @@ async def dkim( cast_to=cast(Type[TimeseriesGroupDKIMResponse], ResultWrapper[TimeseriesGroupDKIMResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) async def dmarc( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDMARCResponse: """ Retrieves the distribution of emails by DMARC (Domain-based Message @@ -877,26 +905,29 @@ async def dmarc( cast_to=cast(Type[TimeseriesGroupDMARCResponse], ResultWrapper[TimeseriesGroupDMARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) async def encrypted( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupEncryptedResponse: """ Retrieves the distribution of emails by encryption status (encrypted vs. @@ -966,26 +997,29 @@ async def encrypted( cast_to=cast(Type[TimeseriesGroupEncryptedResponse], ResultWrapper[TimeseriesGroupEncryptedResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) async def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of emails by IP version over time. @@ -1054,26 +1088,29 @@ async def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Routing Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/routing/methods/timeseries_groups_v2/) instead." + ) async def spf( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + encrypted: List[Literal["ENCRYPTED", "NOT_ENCRYPTED"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupSPFResponse: """ Retrieves the distribution of emails by SPF (Sender Policy Framework) validation @@ -1148,23 +1185,35 @@ class TimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.arc = to_raw_response_wrapper( - timeseries_groups.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = to_raw_response_wrapper( - timeseries_groups.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = to_raw_response_wrapper( - timeseries_groups.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.encrypted = to_raw_response_wrapper( - timeseries_groups.encrypted, + self.encrypted = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.encrypted, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.spf = to_raw_response_wrapper( - timeseries_groups.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.spf, # pyright: ignore[reportDeprecated], + ) ) @@ -1172,23 +1221,35 @@ class AsyncTimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.arc = async_to_raw_response_wrapper( - timeseries_groups.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = async_to_raw_response_wrapper( - timeseries_groups.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = async_to_raw_response_wrapper( - timeseries_groups.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.encrypted = async_to_raw_response_wrapper( - timeseries_groups.encrypted, + self.encrypted = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.encrypted, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.spf = async_to_raw_response_wrapper( - timeseries_groups.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.spf, # pyright: ignore[reportDeprecated], + ) ) @@ -1196,23 +1257,35 @@ class TimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.arc = to_streamed_response_wrapper( - timeseries_groups.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = to_streamed_response_wrapper( - timeseries_groups.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = to_streamed_response_wrapper( - timeseries_groups.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.encrypted = to_streamed_response_wrapper( - timeseries_groups.encrypted, + self.encrypted = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.encrypted, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.spf = to_streamed_response_wrapper( - timeseries_groups.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.spf, # pyright: ignore[reportDeprecated], + ) ) @@ -1220,21 +1293,33 @@ class AsyncTimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.arc = async_to_streamed_response_wrapper( - timeseries_groups.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = async_to_streamed_response_wrapper( - timeseries_groups.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = async_to_streamed_response_wrapper( - timeseries_groups.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.encrypted = async_to_streamed_response_wrapper( - timeseries_groups.encrypted, + self.encrypted = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.encrypted, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.spf = async_to_streamed_response_wrapper( - timeseries_groups.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.spf, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/email/security/security.py b/src/cloudflare/resources/radar/email/security/security.py index 2a0a223796e..a83510b60ca 100644 --- a/src/cloudflare/resources/radar/email/security/security.py +++ b/src/cloudflare/resources/radar/email/security/security.py @@ -2,6 +2,12 @@ from __future__ import annotations +from typing import List, Type, Union, cast +from datetime import datetime +from typing_extensions import Literal + +import httpx + from .summary import ( SummaryResource, AsyncSummaryResource, @@ -18,8 +24,18 @@ TopResourceWithStreamingResponse, AsyncTopResourceWithStreamingResponse, ) +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 .timeseries_groups import ( TimeseriesGroupsResource, AsyncTimeseriesGroupsResource, @@ -28,6 +44,9 @@ TimeseriesGroupsResourceWithStreamingResponse, AsyncTimeseriesGroupsResourceWithStreamingResponse, ) +from .....types.radar.email import security_summary_v2_params, security_timeseries_groups_v2_params +from .....types.radar.email.security_summary_v2_response import SecuritySummaryV2Response +from .....types.radar.email.security_timeseries_groups_v2_response import SecurityTimeseriesGroupsV2Response __all__ = ["SecurityResource", "AsyncSecurityResource"] @@ -64,6 +83,203 @@ def with_streaming_response(self) -> SecurityResourceWithStreamingResponse: """ return SecurityResourceWithStreamingResponse(self) + def summary_v2( + self, + dimension: Literal[ + "SPAM", "MALICIOUS", "SPOOF", "THREAT_CATEGORY", "ARC", "DKIM", "DMARC", "SPF", "TLS_VERSION" + ], + *, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SecuritySummaryV2Response: + """ + Retrieves the distribution of email security metrics by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + arc: Filters results by ARC (Authenticated Received Chain) validation. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. + + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + spf: Filters results by SPF (Sender Policy Framework) validation status. + + tls_version: Filters results by TLS version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/email/security/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "arc": arc, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "dkim": dkim, + "dmarc": dmarc, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + "spf": spf, + "tls_version": tls_version, + }, + security_summary_v2_params.SecuritySummaryV2Params, + ), + post_parser=ResultWrapper[SecuritySummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[SecuritySummaryV2Response], ResultWrapper[SecuritySummaryV2Response]), + ) + + def timeseries_groups_v2( + self, + dimension: Literal[ + "SPAM", "MALICIOUS", "SPOOF", "THREAT_CATEGORY", "ARC", "DKIM", "DMARC", "SPF", "TLS_VERSION" + ], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SecurityTimeseriesGroupsV2Response: + """ + Retrieves the distribution of email security metrics grouped by dimension over + time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + arc: Filters results by ARC (Authenticated Received Chain) validation. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. + + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + spf: Filters results by SPF (Sender Policy Framework) validation status. + + tls_version: Filters results by TLS version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/email/security/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "arc": arc, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "dkim": dkim, + "dmarc": dmarc, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + "spf": spf, + "tls_version": tls_version, + }, + security_timeseries_groups_v2_params.SecurityTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[SecurityTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[SecurityTimeseriesGroupsV2Response], ResultWrapper[SecurityTimeseriesGroupsV2Response]), + ) + class AsyncSecurityResource(AsyncAPIResource): @cached_property @@ -97,11 +313,215 @@ def with_streaming_response(self) -> AsyncSecurityResourceWithStreamingResponse: """ return AsyncSecurityResourceWithStreamingResponse(self) + async def summary_v2( + self, + dimension: Literal[ + "SPAM", "MALICIOUS", "SPOOF", "THREAT_CATEGORY", "ARC", "DKIM", "DMARC", "SPF", "TLS_VERSION" + ], + *, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SecuritySummaryV2Response: + """ + Retrieves the distribution of email security metrics by the specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + arc: Filters results by ARC (Authenticated Received Chain) validation. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. + + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + spf: Filters results by SPF (Sender Policy Framework) validation status. + + tls_version: Filters results by TLS version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/email/security/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "arc": arc, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "dkim": dkim, + "dmarc": dmarc, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + "spf": spf, + "tls_version": tls_version, + }, + security_summary_v2_params.SecuritySummaryV2Params, + ), + post_parser=ResultWrapper[SecuritySummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[SecuritySummaryV2Response], ResultWrapper[SecuritySummaryV2Response]), + ) + + async def timeseries_groups_v2( + self, + dimension: Literal[ + "SPAM", "MALICIOUS", "SPOOF", "THREAT_CATEGORY", "ARC", "DKIM", "DMARC", "SPF", "TLS_VERSION" + ], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SecurityTimeseriesGroupsV2Response: + """ + Retrieves the distribution of email security metrics grouped by dimension over + time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + arc: Filters results by ARC (Authenticated Received Chain) validation. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + dkim: Filters results by DKIM (DomainKeys Identified Mail) validation status. + + dmarc: Filters results by DMARC (Domain-based Message Authentication, Reporting and + Conformance) validation status. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + name: Array of names used to label the series in the response. + + spf: Filters results by SPF (Sender Policy Framework) validation status. + + tls_version: Filters results by TLS version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/email/security/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "arc": arc, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "dkim": dkim, + "dmarc": dmarc, + "format": format, + "limit_per_group": limit_per_group, + "name": name, + "spf": spf, + "tls_version": tls_version, + }, + security_timeseries_groups_v2_params.SecurityTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[SecurityTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[SecurityTimeseriesGroupsV2Response], ResultWrapper[SecurityTimeseriesGroupsV2Response]), + ) + class SecurityResourceWithRawResponse: def __init__(self, security: SecurityResource) -> None: self._security = security + self.summary_v2 = to_raw_response_wrapper( + security.summary_v2, + ) + self.timeseries_groups_v2 = to_raw_response_wrapper( + security.timeseries_groups_v2, + ) + @cached_property def top(self) -> TopResourceWithRawResponse: return TopResourceWithRawResponse(self._security.top) @@ -119,6 +539,13 @@ class AsyncSecurityResourceWithRawResponse: def __init__(self, security: AsyncSecurityResource) -> None: self._security = security + self.summary_v2 = async_to_raw_response_wrapper( + security.summary_v2, + ) + self.timeseries_groups_v2 = async_to_raw_response_wrapper( + security.timeseries_groups_v2, + ) + @cached_property def top(self) -> AsyncTopResourceWithRawResponse: return AsyncTopResourceWithRawResponse(self._security.top) @@ -136,6 +563,13 @@ class SecurityResourceWithStreamingResponse: def __init__(self, security: SecurityResource) -> None: self._security = security + self.summary_v2 = to_streamed_response_wrapper( + security.summary_v2, + ) + self.timeseries_groups_v2 = to_streamed_response_wrapper( + security.timeseries_groups_v2, + ) + @cached_property def top(self) -> TopResourceWithStreamingResponse: return TopResourceWithStreamingResponse(self._security.top) @@ -153,6 +587,13 @@ class AsyncSecurityResourceWithStreamingResponse: def __init__(self, security: AsyncSecurityResource) -> None: self._security = security + self.summary_v2 = async_to_streamed_response_wrapper( + security.summary_v2, + ) + self.timeseries_groups_v2 = async_to_streamed_response_wrapper( + security.timeseries_groups_v2, + ) + @cached_property def top(self) -> AsyncTopResourceWithStreamingResponse: return AsyncTopResourceWithStreamingResponse(self._security.top) diff --git a/src/cloudflare/resources/radar/email/security/summary.py b/src/cloudflare/resources/radar/email/security/summary.py index 0b612f5b869..0f62202cb05 100644 --- a/src/cloudflare/resources/radar/email/security/summary.py +++ b/src/cloudflare/resources/radar/email/security/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -64,24 +65,27 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) def arc( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryARCResponse: """ Retrieves the distribution of emails by ARC (Authenticated Received Chain) @@ -143,24 +147,27 @@ def arc( cast_to=cast(Type[SummaryARCResponse], ResultWrapper[SummaryARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) def dkim( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDKIMResponse: """ Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) @@ -222,24 +229,27 @@ def dkim( cast_to=cast(Type[SummaryDKIMResponse], ResultWrapper[SummaryDKIMResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) def dmarc( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDMARCResponse: """ Retrieves the distribution of emails by DMARC (Domain-based Message @@ -300,25 +310,28 @@ def dmarc( cast_to=cast(Type[SummaryDMARCResponse], ResultWrapper[SummaryDMARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) def malicious( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryMaliciousResponse: """ Retrieves the distribution of emails by malicious classification. @@ -382,25 +395,28 @@ def malicious( cast_to=cast(Type[SummaryMaliciousResponse], ResultWrapper[SummaryMaliciousResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) def spam( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummarySpamResponse: """Retrieves the proportion of emails by spam classification (spam vs. @@ -465,24 +481,27 @@ def spam( cast_to=cast(Type[SummarySpamResponse], ResultWrapper[SummarySpamResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) def spf( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummarySPFResponse: """ Retrieves the distribution of emails by SPF (Sender Policy Framework) @@ -544,25 +563,28 @@ def spf( cast_to=cast(Type[SummarySPFResponse], ResultWrapper[SummarySPFResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) def spoof( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummarySpoofResponse: """ Retrieves the proportion of emails by spoof classification (spoof vs. @@ -627,25 +649,28 @@ def spoof( cast_to=cast(Type[SummarySpoofResponse], ResultWrapper[SummarySpoofResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) def threat_category( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryThreatCategoryResponse: """ Retrieves the distribution of emails by threat categories. @@ -709,24 +734,27 @@ def threat_category( cast_to=cast(Type[SummaryThreatCategoryResponse], ResultWrapper[SummaryThreatCategoryResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) def tls_version( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryTLSVersionResponse: """ Retrieves the distribution of emails by TLS version. @@ -808,24 +836,27 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) async def arc( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryARCResponse: """ Retrieves the distribution of emails by ARC (Authenticated Received Chain) @@ -887,24 +918,27 @@ async def arc( cast_to=cast(Type[SummaryARCResponse], ResultWrapper[SummaryARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) async def dkim( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDKIMResponse: """ Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) @@ -966,24 +1000,27 @@ async def dkim( cast_to=cast(Type[SummaryDKIMResponse], ResultWrapper[SummaryDKIMResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) async def dmarc( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDMARCResponse: """ Retrieves the distribution of emails by DMARC (Domain-based Message @@ -1044,25 +1081,28 @@ async def dmarc( cast_to=cast(Type[SummaryDMARCResponse], ResultWrapper[SummaryDMARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) async def malicious( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryMaliciousResponse: """ Retrieves the distribution of emails by malicious classification. @@ -1126,25 +1166,28 @@ async def malicious( cast_to=cast(Type[SummaryMaliciousResponse], ResultWrapper[SummaryMaliciousResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) async def spam( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummarySpamResponse: """Retrieves the proportion of emails by spam classification (spam vs. @@ -1209,24 +1252,27 @@ async def spam( cast_to=cast(Type[SummarySpamResponse], ResultWrapper[SummarySpamResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) async def spf( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummarySPFResponse: """ Retrieves the distribution of emails by SPF (Sender Policy Framework) @@ -1288,25 +1334,28 @@ async def spf( cast_to=cast(Type[SummarySPFResponse], ResultWrapper[SummarySPFResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) async def spoof( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummarySpoofResponse: """ Retrieves the proportion of emails by spoof classification (spoof vs. @@ -1371,25 +1420,28 @@ async def spoof( cast_to=cast(Type[SummarySpoofResponse], ResultWrapper[SummarySpoofResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) async def threat_category( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryThreatCategoryResponse: """ Retrieves the distribution of emails by threat categories. @@ -1453,24 +1505,27 @@ async def threat_category( cast_to=cast(Type[SummaryThreatCategoryResponse], ResultWrapper[SummaryThreatCategoryResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/summary_v2/) instead." + ) async def tls_version( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryTLSVersionResponse: """ Retrieves the distribution of emails by TLS version. @@ -1536,32 +1591,50 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.arc = to_raw_response_wrapper( - summary.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = to_raw_response_wrapper( - summary.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = to_raw_response_wrapper( - summary.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.malicious = to_raw_response_wrapper( - summary.malicious, + self.malicious = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.malicious, # pyright: ignore[reportDeprecated], + ) ) - self.spam = to_raw_response_wrapper( - summary.spam, + self.spam = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.spam, # pyright: ignore[reportDeprecated], + ) ) - self.spf = to_raw_response_wrapper( - summary.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.spf, # pyright: ignore[reportDeprecated], + ) ) - self.spoof = to_raw_response_wrapper( - summary.spoof, + self.spoof = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.spoof, # pyright: ignore[reportDeprecated], + ) ) - self.threat_category = to_raw_response_wrapper( - summary.threat_category, + self.threat_category = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.threat_category, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = to_raw_response_wrapper( - summary.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -1569,32 +1642,50 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.arc = async_to_raw_response_wrapper( - summary.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = async_to_raw_response_wrapper( - summary.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = async_to_raw_response_wrapper( - summary.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.malicious = async_to_raw_response_wrapper( - summary.malicious, + self.malicious = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.malicious, # pyright: ignore[reportDeprecated], + ) ) - self.spam = async_to_raw_response_wrapper( - summary.spam, + self.spam = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.spam, # pyright: ignore[reportDeprecated], + ) ) - self.spf = async_to_raw_response_wrapper( - summary.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.spf, # pyright: ignore[reportDeprecated], + ) ) - self.spoof = async_to_raw_response_wrapper( - summary.spoof, + self.spoof = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.spoof, # pyright: ignore[reportDeprecated], + ) ) - self.threat_category = async_to_raw_response_wrapper( - summary.threat_category, + self.threat_category = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.threat_category, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = async_to_raw_response_wrapper( - summary.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -1602,32 +1693,50 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.arc = to_streamed_response_wrapper( - summary.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = to_streamed_response_wrapper( - summary.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = to_streamed_response_wrapper( - summary.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.malicious = to_streamed_response_wrapper( - summary.malicious, + self.malicious = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.malicious, # pyright: ignore[reportDeprecated], + ) ) - self.spam = to_streamed_response_wrapper( - summary.spam, + self.spam = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.spam, # pyright: ignore[reportDeprecated], + ) ) - self.spf = to_streamed_response_wrapper( - summary.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.spf, # pyright: ignore[reportDeprecated], + ) ) - self.spoof = to_streamed_response_wrapper( - summary.spoof, + self.spoof = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.spoof, # pyright: ignore[reportDeprecated], + ) ) - self.threat_category = to_streamed_response_wrapper( - summary.threat_category, + self.threat_category = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.threat_category, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = to_streamed_response_wrapper( - summary.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -1635,30 +1744,48 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.arc = async_to_streamed_response_wrapper( - summary.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = async_to_streamed_response_wrapper( - summary.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = async_to_streamed_response_wrapper( - summary.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.malicious = async_to_streamed_response_wrapper( - summary.malicious, + self.malicious = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.malicious, # pyright: ignore[reportDeprecated], + ) ) - self.spam = async_to_streamed_response_wrapper( - summary.spam, + self.spam = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.spam, # pyright: ignore[reportDeprecated], + ) ) - self.spf = async_to_streamed_response_wrapper( - summary.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.spf, # pyright: ignore[reportDeprecated], + ) ) - self.spoof = async_to_streamed_response_wrapper( - summary.spoof, + self.spoof = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.spoof, # pyright: ignore[reportDeprecated], + ) ) - self.threat_category = async_to_streamed_response_wrapper( - summary.threat_category, + self.threat_category = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.threat_category, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = async_to_streamed_response_wrapper( - summary.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.tls_version, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/email/security/timeseries_groups.py b/src/cloudflare/resources/radar/email/security/timeseries_groups.py index f433fc627d6..955c4e89342 100644 --- a/src/cloudflare/resources/radar/email/security/timeseries_groups.py +++ b/src/cloudflare/resources/radar/email/security/timeseries_groups.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -66,25 +67,28 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon """ return TimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) def arc( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupARCResponse: """ Retrieves the distribution of emails by ARC (Authenticated Received Chain) @@ -151,25 +155,28 @@ def arc( cast_to=cast(Type[TimeseriesGroupARCResponse], ResultWrapper[TimeseriesGroupARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) def dkim( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDKIMResponse: """ Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) @@ -236,25 +243,28 @@ def dkim( cast_to=cast(Type[TimeseriesGroupDKIMResponse], ResultWrapper[TimeseriesGroupDKIMResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) def dmarc( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDMARCResponse: """ Retrieves the distribution of emails by DMARC (Domain-based Message @@ -320,26 +330,29 @@ def dmarc( cast_to=cast(Type[TimeseriesGroupDMARCResponse], ResultWrapper[TimeseriesGroupDMARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) def malicious( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupMaliciousResponse: """ Retrieves the distribution of emails by malicious classification over time. @@ -408,26 +421,29 @@ def malicious( cast_to=cast(Type[TimeseriesGroupMaliciousResponse], ResultWrapper[TimeseriesGroupMaliciousResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) def spam( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupSpamResponse: """Retrieves the distribution of emails by spam classification (spam vs. @@ -498,25 +514,28 @@ def spam( cast_to=cast(Type[TimeseriesGroupSpamResponse], ResultWrapper[TimeseriesGroupSpamResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) def spf( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupSPFResponse: """ Retrieves the distribution of emails by SPF (Sender Policy Framework) validation @@ -583,26 +602,29 @@ def spf( cast_to=cast(Type[TimeseriesGroupSPFResponse], ResultWrapper[TimeseriesGroupSPFResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) def spoof( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupSpoofResponse: """ Retrieves the distribution of emails by spoof classification (spoof vs. @@ -672,26 +694,29 @@ def spoof( cast_to=cast(Type[TimeseriesGroupSpoofResponse], ResultWrapper[TimeseriesGroupSpoofResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) def threat_category( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupThreatCategoryResponse: """ Retrieves the distribution of emails by threat category over time. @@ -762,25 +787,28 @@ def threat_category( ), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) def tls_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupTLSVersionResponse: """ Retrieves the distribution of emails by TLS version over time. @@ -867,25 +895,28 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR """ return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) async def arc( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupARCResponse: """ Retrieves the distribution of emails by ARC (Authenticated Received Chain) @@ -952,25 +983,28 @@ async def arc( cast_to=cast(Type[TimeseriesGroupARCResponse], ResultWrapper[TimeseriesGroupARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) async def dkim( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDKIMResponse: """ Retrieves the distribution of emails by DKIM (DomainKeys Identified Mail) @@ -1037,25 +1071,28 @@ async def dkim( cast_to=cast(Type[TimeseriesGroupDKIMResponse], ResultWrapper[TimeseriesGroupDKIMResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) async def dmarc( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDMARCResponse: """ Retrieves the distribution of emails by DMARC (Domain-based Message @@ -1121,26 +1158,29 @@ async def dmarc( cast_to=cast(Type[TimeseriesGroupDMARCResponse], ResultWrapper[TimeseriesGroupDMARCResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) async def malicious( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupMaliciousResponse: """ Retrieves the distribution of emails by malicious classification over time. @@ -1209,26 +1249,29 @@ async def malicious( cast_to=cast(Type[TimeseriesGroupMaliciousResponse], ResultWrapper[TimeseriesGroupMaliciousResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) async def spam( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupSpamResponse: """Retrieves the distribution of emails by spam classification (spam vs. @@ -1299,25 +1342,28 @@ async def spam( cast_to=cast(Type[TimeseriesGroupSpamResponse], ResultWrapper[TimeseriesGroupSpamResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) async def spf( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupSPFResponse: """ Retrieves the distribution of emails by SPF (Sender Policy Framework) validation @@ -1384,26 +1430,29 @@ async def spf( cast_to=cast(Type[TimeseriesGroupSPFResponse], ResultWrapper[TimeseriesGroupSPFResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) async def spoof( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupSpoofResponse: """ Retrieves the distribution of emails by spoof classification (spoof vs. @@ -1473,26 +1522,29 @@ async def spoof( cast_to=cast(Type[TimeseriesGroupSpoofResponse], ResultWrapper[TimeseriesGroupSpoofResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) async def threat_category( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupThreatCategoryResponse: """ Retrieves the distribution of emails by threat category over time. @@ -1563,25 +1615,28 @@ async def threat_category( ), ) + @typing_extensions.deprecated( + "Use [Radar Email Security Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/email/subresources/security/methods/timeseries_groups_v2/) instead." + ) async def tls_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupTLSVersionResponse: """ Retrieves the distribution of emails by TLS version over time. @@ -1652,32 +1707,50 @@ class TimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.arc = to_raw_response_wrapper( - timeseries_groups.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = to_raw_response_wrapper( - timeseries_groups.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = to_raw_response_wrapper( - timeseries_groups.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.malicious = to_raw_response_wrapper( - timeseries_groups.malicious, + self.malicious = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.malicious, # pyright: ignore[reportDeprecated], + ) ) - self.spam = to_raw_response_wrapper( - timeseries_groups.spam, + self.spam = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.spam, # pyright: ignore[reportDeprecated], + ) ) - self.spf = to_raw_response_wrapper( - timeseries_groups.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.spf, # pyright: ignore[reportDeprecated], + ) ) - self.spoof = to_raw_response_wrapper( - timeseries_groups.spoof, + self.spoof = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.spoof, # pyright: ignore[reportDeprecated], + ) ) - self.threat_category = to_raw_response_wrapper( - timeseries_groups.threat_category, + self.threat_category = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.threat_category, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = to_raw_response_wrapper( - timeseries_groups.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -1685,32 +1758,50 @@ class AsyncTimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.arc = async_to_raw_response_wrapper( - timeseries_groups.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = async_to_raw_response_wrapper( - timeseries_groups.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = async_to_raw_response_wrapper( - timeseries_groups.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.malicious = async_to_raw_response_wrapper( - timeseries_groups.malicious, + self.malicious = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.malicious, # pyright: ignore[reportDeprecated], + ) ) - self.spam = async_to_raw_response_wrapper( - timeseries_groups.spam, + self.spam = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.spam, # pyright: ignore[reportDeprecated], + ) ) - self.spf = async_to_raw_response_wrapper( - timeseries_groups.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.spf, # pyright: ignore[reportDeprecated], + ) ) - self.spoof = async_to_raw_response_wrapper( - timeseries_groups.spoof, + self.spoof = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.spoof, # pyright: ignore[reportDeprecated], + ) ) - self.threat_category = async_to_raw_response_wrapper( - timeseries_groups.threat_category, + self.threat_category = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.threat_category, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = async_to_raw_response_wrapper( - timeseries_groups.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -1718,32 +1809,50 @@ class TimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.arc = to_streamed_response_wrapper( - timeseries_groups.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = to_streamed_response_wrapper( - timeseries_groups.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = to_streamed_response_wrapper( - timeseries_groups.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.malicious = to_streamed_response_wrapper( - timeseries_groups.malicious, + self.malicious = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.malicious, # pyright: ignore[reportDeprecated], + ) ) - self.spam = to_streamed_response_wrapper( - timeseries_groups.spam, + self.spam = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.spam, # pyright: ignore[reportDeprecated], + ) ) - self.spf = to_streamed_response_wrapper( - timeseries_groups.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.spf, # pyright: ignore[reportDeprecated], + ) ) - self.spoof = to_streamed_response_wrapper( - timeseries_groups.spoof, + self.spoof = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.spoof, # pyright: ignore[reportDeprecated], + ) ) - self.threat_category = to_streamed_response_wrapper( - timeseries_groups.threat_category, + self.threat_category = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.threat_category, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = to_streamed_response_wrapper( - timeseries_groups.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -1751,30 +1860,48 @@ class AsyncTimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.arc = async_to_streamed_response_wrapper( - timeseries_groups.arc, + self.arc = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.arc, # pyright: ignore[reportDeprecated], + ) ) - self.dkim = async_to_streamed_response_wrapper( - timeseries_groups.dkim, + self.dkim = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.dkim, # pyright: ignore[reportDeprecated], + ) ) - self.dmarc = async_to_streamed_response_wrapper( - timeseries_groups.dmarc, + self.dmarc = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.dmarc, # pyright: ignore[reportDeprecated], + ) ) - self.malicious = async_to_streamed_response_wrapper( - timeseries_groups.malicious, + self.malicious = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.malicious, # pyright: ignore[reportDeprecated], + ) ) - self.spam = async_to_streamed_response_wrapper( - timeseries_groups.spam, + self.spam = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.spam, # pyright: ignore[reportDeprecated], + ) ) - self.spf = async_to_streamed_response_wrapper( - timeseries_groups.spf, + self.spf = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.spf, # pyright: ignore[reportDeprecated], + ) ) - self.spoof = async_to_streamed_response_wrapper( - timeseries_groups.spoof, + self.spoof = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.spoof, # pyright: ignore[reportDeprecated], + ) ) - self.threat_category = async_to_streamed_response_wrapper( - timeseries_groups.threat_category, + self.threat_category = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.threat_category, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = async_to_streamed_response_wrapper( - timeseries_groups.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.tls_version, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py b/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py index 6966fe41e86..7c5e809c1e7 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/malicious.py @@ -8,7 +8,7 @@ import httpx -from ......._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,24 +50,24 @@ def get( self, malicious: Literal["MALICIOUS", "NOT_MALICIOUS"], *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tld_category: Literal["CLASSIC", "COUNTRY"] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tld_category: Literal["CLASSIC", "COUNTRY"] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MaliciousGetResponse: """ Retrieves the top TLDs by emails classified as malicious or not. @@ -166,24 +166,24 @@ async def get( self, malicious: Literal["MALICIOUS", "NOT_MALICIOUS"], *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tld_category: Literal["CLASSIC", "COUNTRY"] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tld_category: Literal["CLASSIC", "COUNTRY"] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MaliciousGetResponse: """ Retrieves the top TLDs by emails classified as malicious or not. diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/spam.py b/src/cloudflare/resources/radar/email/security/top/tlds/spam.py index 1792364f8e9..1c7d7ed08ec 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/spam.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/spam.py @@ -8,7 +8,7 @@ import httpx -from ......._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,24 +50,24 @@ def get( self, spam: Literal["SPAM", "NOT_SPAM"], *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tld_category: Literal["CLASSIC", "COUNTRY"] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tld_category: Literal["CLASSIC", "COUNTRY"] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SpamGetResponse: """ Retrieves the top TLDs by emails classified as spam or not. @@ -166,24 +166,24 @@ async def get( self, spam: Literal["SPAM", "NOT_SPAM"], *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tld_category: Literal["CLASSIC", "COUNTRY"] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tld_category: Literal["CLASSIC", "COUNTRY"] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SpamGetResponse: """ Retrieves the top TLDs by emails classified as spam or not. diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py b/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py index a36572b1186..0ff172ed740 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/spoof.py @@ -8,7 +8,7 @@ import httpx -from ......._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,24 +50,24 @@ def get( self, spoof: Literal["SPOOF", "NOT_SPOOF"], *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tld_category: Literal["CLASSIC", "COUNTRY"] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tld_category: Literal["CLASSIC", "COUNTRY"] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SpoofGetResponse: """ Retrieves the top TLDs by emails classified as spoof or not. @@ -166,24 +166,24 @@ async def get( self, spoof: Literal["SPOOF", "NOT_SPOOF"], *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tld_category: Literal["CLASSIC", "COUNTRY"] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tld_category: Literal["CLASSIC", "COUNTRY"] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SpoofGetResponse: """ Retrieves the top TLDs by emails classified as spoof or not. diff --git a/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py b/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py index 44c436dcd56..a3a8786bf46 100644 --- a/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py +++ b/src/cloudflare/resources/radar/email/security/top/tlds/tlds.py @@ -32,7 +32,7 @@ MaliciousResourceWithStreamingResponse, AsyncMaliciousResourceWithStreamingResponse, ) -from ......._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -85,24 +85,24 @@ def with_streaming_response(self) -> TldsResourceWithStreamingResponse: def get( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tld_category: Literal["CLASSIC", "COUNTRY"] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tld_category: Literal["CLASSIC", "COUNTRY"] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TldGetResponse: """ Retrieves the top TLDs by number of email messages. @@ -208,24 +208,24 @@ def with_streaming_response(self) -> AsyncTldsResourceWithStreamingResponse: async def get( self, *, - arc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - dkim: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - dmarc: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - spf: List[Literal["PASS", "NONE", "FAIL"]] | NotGiven = NOT_GIVEN, - tld_category: Literal["CLASSIC", "COUNTRY"] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | NotGiven = NOT_GIVEN, + arc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + dkim: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + dmarc: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + spf: List[Literal["PASS", "NONE", "FAIL"]] | Omit = omit, + tld_category: Literal["CLASSIC", "COUNTRY"] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TldGetResponse: """ Retrieves the top TLDs by number of email messages. diff --git a/src/cloudflare/resources/radar/entities/asns.py b/src/cloudflare/resources/radar/entities/asns.py index 767f6997a7f..3e20efe46e0 100644 --- a/src/cloudflare/resources/radar/entities/asns.py +++ b/src/cloudflare/resources/radar/entities/asns.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -19,11 +19,12 @@ ) from ...._wrappers import ResultWrapper from ...._base_client import make_request_options -from ....types.radar.entities import asn_ip_params, asn_get_params, asn_rel_params, asn_list_params +from ....types.radar.entities import asn_ip_params, asn_get_params, asn_rel_params, asn_list_params, asn_as_set_params from ....types.radar.entities.asn_ip_response import ASNIPResponse from ....types.radar.entities.asn_get_response import ASNGetResponse from ....types.radar.entities.asn_rel_response import ASNRelResponse from ....types.radar.entities.asn_list_response import ASNListResponse +from ....types.radar.entities.asn_as_set_response import ASNAsSetResponse __all__ = ["ASNsResource", "AsyncASNsResource"] @@ -51,18 +52,18 @@ def with_streaming_response(self) -> ASNsResourceWithStreamingResponse: def list( self, *, - asn: str | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - order_by: Literal["ASN", "POPULATION"] | NotGiven = NOT_GIVEN, + asn: str | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | Omit = omit, + offset: int | Omit = omit, + order_by: Literal["ASN", "POPULATION"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ASNListResponse: """ Retrieves a list of autonomous systems. @@ -112,17 +113,58 @@ def list( cast_to=cast(Type[ASNListResponse], ResultWrapper[ASNListResponse]), ) + def as_set( + self, + asn: int, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ASNAsSetResponse: + """ + Retrieves Internet Routing Registry AS-SETs that an AS is a member of. + + Args: + asn: Retrieves all AS-SETs that the given AS is a member of. + + format: Format in which results will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + f"/radar/entities/asns/{asn}/as_set", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"format": format}, asn_as_set_params.ASNAsSetParams), + post_parser=ResultWrapper[ASNAsSetResponse]._unwrapper, + ), + cast_to=cast(Type[ASNAsSetResponse], ResultWrapper[ASNAsSetResponse]), + ) + def get( self, asn: int, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ASNGetResponse: """Retrieves the requested autonomous system information. @@ -161,13 +203,13 @@ def ip( self, *, ip: str, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ASNIPResponse: """ Retrieves the requested autonomous system information based on IP address. @@ -209,14 +251,14 @@ def rel( self, asn: int, *, - asn2: int | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn2: int | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ASNRelResponse: """ Retrieves AS-level relationship for given networks. @@ -280,18 +322,18 @@ def with_streaming_response(self) -> AsyncASNsResourceWithStreamingResponse: async def list( self, *, - asn: str | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - order_by: Literal["ASN", "POPULATION"] | NotGiven = NOT_GIVEN, + asn: str | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | Omit = omit, + offset: int | Omit = omit, + order_by: Literal["ASN", "POPULATION"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ASNListResponse: """ Retrieves a list of autonomous systems. @@ -341,17 +383,58 @@ async def list( cast_to=cast(Type[ASNListResponse], ResultWrapper[ASNListResponse]), ) + async def as_set( + self, + asn: int, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ASNAsSetResponse: + """ + Retrieves Internet Routing Registry AS-SETs that an AS is a member of. + + Args: + asn: Retrieves all AS-SETs that the given AS is a member of. + + format: Format in which results will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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._get( + f"/radar/entities/asns/{asn}/as_set", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"format": format}, asn_as_set_params.ASNAsSetParams), + post_parser=ResultWrapper[ASNAsSetResponse]._unwrapper, + ), + cast_to=cast(Type[ASNAsSetResponse], ResultWrapper[ASNAsSetResponse]), + ) + async def get( self, asn: int, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ASNGetResponse: """Retrieves the requested autonomous system information. @@ -390,13 +473,13 @@ async def ip( self, *, ip: str, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ASNIPResponse: """ Retrieves the requested autonomous system information based on IP address. @@ -438,14 +521,14 @@ async def rel( self, asn: int, *, - asn2: int | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + asn2: int | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ASNRelResponse: """ Retrieves AS-level relationship for given networks. @@ -493,6 +576,9 @@ def __init__(self, asns: ASNsResource) -> None: self.list = to_raw_response_wrapper( asns.list, ) + self.as_set = to_raw_response_wrapper( + asns.as_set, + ) self.get = to_raw_response_wrapper( asns.get, ) @@ -511,6 +597,9 @@ def __init__(self, asns: AsyncASNsResource) -> None: self.list = async_to_raw_response_wrapper( asns.list, ) + self.as_set = async_to_raw_response_wrapper( + asns.as_set, + ) self.get = async_to_raw_response_wrapper( asns.get, ) @@ -529,6 +618,9 @@ def __init__(self, asns: ASNsResource) -> None: self.list = to_streamed_response_wrapper( asns.list, ) + self.as_set = to_streamed_response_wrapper( + asns.as_set, + ) self.get = to_streamed_response_wrapper( asns.get, ) @@ -547,6 +639,9 @@ def __init__(self, asns: AsyncASNsResource) -> None: self.list = async_to_streamed_response_wrapper( asns.list, ) + self.as_set = async_to_streamed_response_wrapper( + asns.as_set, + ) self.get = async_to_streamed_response_wrapper( asns.get, ) diff --git a/src/cloudflare/resources/radar/entities/entities.py b/src/cloudflare/resources/radar/entities/entities.py index eace35e3e5b..3a09e011fc7 100644 --- a/src/cloudflare/resources/radar/entities/entities.py +++ b/src/cloudflare/resources/radar/entities/entities.py @@ -15,7 +15,7 @@ ASNsResourceWithStreamingResponse, AsyncASNsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from .locations import ( LocationsResource, @@ -73,13 +73,13 @@ def get( self, *, ip: str, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EntityGetResponse: """ Retrieves IP address information. @@ -149,13 +149,13 @@ async def get( self, *, ip: str, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EntityGetResponse: """ Retrieves IP address information. diff --git a/src/cloudflare/resources/radar/entities/locations.py b/src/cloudflare/resources/radar/entities/locations.py index 29aa75e9800..594c5078309 100644 --- a/src/cloudflare/resources/radar/entities/locations.py +++ b/src/cloudflare/resources/radar/entities/locations.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,16 +49,16 @@ def with_streaming_response(self) -> LocationsResourceWithStreamingResponse: def list( self, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationListResponse: """ Retrieves a list of locations. @@ -106,13 +106,13 @@ def get( self, location: str, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationGetResponse: """Retrieves the requested location information. @@ -172,16 +172,16 @@ def with_streaming_response(self) -> AsyncLocationsResourceWithStreamingResponse async def list( self, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationListResponse: """ Retrieves a list of locations. @@ -229,13 +229,13 @@ async def get( self, location: str, *, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, + format: Literal["JSON", "CSV"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationGetResponse: """Retrieves the requested location information. diff --git a/src/cloudflare/resources/radar/geolocations.py b/src/cloudflare/resources/radar/geolocations.py new file mode 100644 index 00000000000..623748a5bb3 --- /dev/null +++ b/src/cloudflare/resources/radar/geolocations.py @@ -0,0 +1,326 @@ +# 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, 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.radar import geolocation_get_params, geolocation_list_params +from ..._base_client import make_request_options +from ...types.radar.geolocation_get_response import GeolocationGetResponse +from ...types.radar.geolocation_list_response import GeolocationListResponse + +__all__ = ["GeolocationsResource", "AsyncGeolocationsResource"] + + +class GeolocationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> GeolocationsResourceWithRawResponse: + """ + 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 GeolocationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GeolocationsResourceWithStreamingResponse: + """ + 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 GeolocationsResourceWithStreamingResponse(self) + + def list( + self, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: str | Omit = omit, + limit: int | Omit = omit, + location: str | 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GeolocationListResponse: + """ + Retrieves a list of geolocations. + + Args: + format: Format in which results will be returned. + + geo_id: Filters results by geolocation. Specify a comma-separated list of GeoNames IDs. + + limit: Limits the number of objects returned in the response. + + location: Filters results by location. Specify a comma-separated list of alpha-2 location + codes. + + offset: Skips the specified number of objects before fetching the results. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + "/radar/geolocations", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "format": format, + "geo_id": geo_id, + "limit": limit, + "location": location, + "offset": offset, + }, + geolocation_list_params.GeolocationListParams, + ), + post_parser=ResultWrapper[GeolocationListResponse]._unwrapper, + ), + cast_to=cast(Type[GeolocationListResponse], ResultWrapper[GeolocationListResponse]), + ) + + def get( + self, + geo_id: str, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GeolocationGetResponse: + """Retrieves the requested Geolocation information. + + Args: + geo_id: Geolocation ID. + + Refer to + [GeoNames](https://download.geonames.org/export/dump/readme.txt) + + format: Format in which results will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 geo_id: + raise ValueError(f"Expected a non-empty value for `geo_id` but received {geo_id!r}") + return self._get( + f"/radar/geolocations/{geo_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"format": format}, geolocation_get_params.GeolocationGetParams), + post_parser=ResultWrapper[GeolocationGetResponse]._unwrapper, + ), + cast_to=cast(Type[GeolocationGetResponse], ResultWrapper[GeolocationGetResponse]), + ) + + +class AsyncGeolocationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncGeolocationsResourceWithRawResponse: + """ + 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 AsyncGeolocationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGeolocationsResourceWithStreamingResponse: + """ + 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 AsyncGeolocationsResourceWithStreamingResponse(self) + + async def list( + self, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: str | Omit = omit, + limit: int | Omit = omit, + location: str | 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GeolocationListResponse: + """ + Retrieves a list of geolocations. + + Args: + format: Format in which results will be returned. + + geo_id: Filters results by geolocation. Specify a comma-separated list of GeoNames IDs. + + limit: Limits the number of objects returned in the response. + + location: Filters results by location. Specify a comma-separated list of alpha-2 location + codes. + + offset: Skips the specified number of objects before fetching the results. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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._get( + "/radar/geolocations", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "format": format, + "geo_id": geo_id, + "limit": limit, + "location": location, + "offset": offset, + }, + geolocation_list_params.GeolocationListParams, + ), + post_parser=ResultWrapper[GeolocationListResponse]._unwrapper, + ), + cast_to=cast(Type[GeolocationListResponse], ResultWrapper[GeolocationListResponse]), + ) + + async def get( + self, + geo_id: str, + *, + format: Literal["JSON", "CSV"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GeolocationGetResponse: + """Retrieves the requested Geolocation information. + + Args: + geo_id: Geolocation ID. + + Refer to + [GeoNames](https://download.geonames.org/export/dump/readme.txt) + + format: Format in which results will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 geo_id: + raise ValueError(f"Expected a non-empty value for `geo_id` but received {geo_id!r}") + return await self._get( + f"/radar/geolocations/{geo_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"format": format}, geolocation_get_params.GeolocationGetParams), + post_parser=ResultWrapper[GeolocationGetResponse]._unwrapper, + ), + cast_to=cast(Type[GeolocationGetResponse], ResultWrapper[GeolocationGetResponse]), + ) + + +class GeolocationsResourceWithRawResponse: + def __init__(self, geolocations: GeolocationsResource) -> None: + self._geolocations = geolocations + + self.list = to_raw_response_wrapper( + geolocations.list, + ) + self.get = to_raw_response_wrapper( + geolocations.get, + ) + + +class AsyncGeolocationsResourceWithRawResponse: + def __init__(self, geolocations: AsyncGeolocationsResource) -> None: + self._geolocations = geolocations + + self.list = async_to_raw_response_wrapper( + geolocations.list, + ) + self.get = async_to_raw_response_wrapper( + geolocations.get, + ) + + +class GeolocationsResourceWithStreamingResponse: + def __init__(self, geolocations: GeolocationsResource) -> None: + self._geolocations = geolocations + + self.list = to_streamed_response_wrapper( + geolocations.list, + ) + self.get = to_streamed_response_wrapper( + geolocations.get, + ) + + +class AsyncGeolocationsResourceWithStreamingResponse: + def __init__(self, geolocations: AsyncGeolocationsResource) -> None: + self._geolocations = geolocations + + self.list = async_to_streamed_response_wrapper( + geolocations.list, + ) + self.get = async_to_streamed_response_wrapper( + geolocations.get, + ) diff --git a/src/cloudflare/resources/radar/http/ases/ases.py b/src/cloudflare/resources/radar/http/ases/ases.py index f56c64ca883..171dd7d8ca1 100644 --- a/src/cloudflare/resources/radar/http/ases/ases.py +++ b/src/cloudflare/resources/radar/http/ases/ases.py @@ -24,7 +24,7 @@ BotClassResourceWithStreamingResponse, AsyncBotClassResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from .ip_version import ( IPVersionResource, @@ -145,30 +145,30 @@ def with_streaming_response(self) -> AsesResourceWithStreamingResponse: def get( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AseGetResponse: """ Retrieves the top autonomous systems by HTTP requests. @@ -200,6 +200,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -244,6 +249,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -316,30 +322,30 @@ def with_streaming_response(self) -> AsyncAsesResourceWithStreamingResponse: async def get( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AseGetResponse: """ Retrieves the top autonomous systems by HTTP requests. @@ -371,6 +377,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -415,6 +426,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/ases/bot_class.py b/src/cloudflare/resources/radar/http/ases/bot_class.py index c4f4526d270..e383e6b7f98 100644 --- a/src/cloudflare/resources/radar/http/ases/bot_class.py +++ b/src/cloudflare/resources/radar/http/ases/bot_class.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, bot_class: Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BotClassGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested bot @@ -105,6 +105,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -150,6 +155,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -191,29 +197,29 @@ async def get( self, bot_class: Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BotClassGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested bot @@ -246,6 +252,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -291,6 +302,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/ases/browser_family.py b/src/cloudflare/resources/radar/http/ases/browser_family.py index 496959981b2..f00473cde74 100644 --- a/src/cloudflare/resources/radar/http/ases/browser_family.py +++ b/src/cloudflare/resources/radar/http/ases/browser_family.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, browser_family: Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BrowserFamilyGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested browser @@ -105,6 +105,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -150,6 +155,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -191,29 +197,29 @@ async def get( self, browser_family: Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BrowserFamilyGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested browser @@ -246,6 +252,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -291,6 +302,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/ases/device_type.py b/src/cloudflare/resources/radar/http/ases/device_type.py index a5b87ad2c02..85aaf98bcae 100644 --- a/src/cloudflare/resources/radar/http/ases/device_type.py +++ b/src/cloudflare/resources/radar/http/ases/device_type.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, device_type: Literal["DESKTOP", "MOBILE", "OTHER"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DeviceTypeGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested device @@ -105,6 +105,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -150,6 +155,7 @@ def get( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -191,29 +197,29 @@ async def get( self, device_type: Literal["DESKTOP", "MOBILE", "OTHER"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DeviceTypeGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested device @@ -246,6 +252,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -291,6 +302,7 @@ async def get( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/ases/http_method.py b/src/cloudflare/resources/radar/http/ases/http_method.py index 64e8a3231c1..b6983067121 100644 --- a/src/cloudflare/resources/radar/http/ases/http_method.py +++ b/src/cloudflare/resources/radar/http/ases/http_method.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, http_version: Literal["HTTPv1", "HTTPv2", "HTTPv3"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HTTPMethodGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested HTTP @@ -107,6 +107,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -151,6 +156,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "ip_version": ip_version, "limit": limit, @@ -191,29 +197,29 @@ async def get( self, http_version: Literal["HTTPv1", "HTTPv2", "HTTPv3"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HTTPMethodGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested HTTP @@ -248,6 +254,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -292,6 +303,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "ip_version": ip_version, "limit": limit, diff --git a/src/cloudflare/resources/radar/http/ases/http_protocol.py b/src/cloudflare/resources/radar/http/ases/http_protocol.py index c30a885bd6d..ab95425cb9d 100644 --- a/src/cloudflare/resources/radar/http/ases/http_protocol.py +++ b/src/cloudflare/resources/radar/http/ases/http_protocol.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, http_protocol: Literal["HTTP", "HTTPS"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HTTPProtocolGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested HTTP @@ -107,6 +107,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_version: Filters results by HTTP version. ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -151,6 +156,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_version": http_version, "ip_version": ip_version, "limit": limit, @@ -191,29 +197,29 @@ async def get( self, http_protocol: Literal["HTTP", "HTTPS"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HTTPProtocolGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested HTTP @@ -248,6 +254,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_version: Filters results by HTTP version. ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -292,6 +303,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_version": http_version, "ip_version": ip_version, "limit": limit, diff --git a/src/cloudflare/resources/radar/http/ases/ip_version.py b/src/cloudflare/resources/radar/http/ases/ip_version.py index 1aea55c9184..f70d9e2093b 100644 --- a/src/cloudflare/resources/radar/http/ases/ip_version.py +++ b/src/cloudflare/resources/radar/http/ases/ip_version.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, ip_version: Literal["IPv4", "IPv6"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPVersionGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested IP @@ -107,6 +107,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -151,6 +156,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "limit": limit, @@ -191,29 +197,29 @@ async def get( self, ip_version: Literal["IPv4", "IPv6"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPVersionGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested IP @@ -248,6 +254,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -292,6 +303,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "limit": limit, diff --git a/src/cloudflare/resources/radar/http/ases/os.py b/src/cloudflare/resources/radar/http/ases/os.py index 1717428a6cc..b9404151a52 100644 --- a/src/cloudflare/resources/radar/http/ases/os.py +++ b/src/cloudflare/resources/radar/http/ases/os.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,28 +50,29 @@ def get( self, os: Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OSGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested @@ -106,6 +107,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -150,6 +156,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -190,28 +197,29 @@ async def get( self, os: Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OSGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested @@ -246,6 +254,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -290,6 +303,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/ases/tls_version.py b/src/cloudflare/resources/radar/http/ases/tls_version.py index 88da0ad9a4c..bbcb2a7e18f 100644 --- a/src/cloudflare/resources/radar/http/ases/tls_version.py +++ b/src/cloudflare/resources/radar/http/ases/tls_version.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, tls_version: Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TLSVersionGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested TLS @@ -107,6 +107,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -151,6 +156,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -191,29 +197,29 @@ async def get( self, tls_version: Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TLSVersionGetResponse: """ Retrieves the top autonomous systems, by HTTP requests, of the requested TLS @@ -248,6 +254,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -292,6 +303,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/http.py b/src/cloudflare/resources/radar/http/http.py index 9650fc5ef5b..9754cb0f2e0 100644 --- a/src/cloudflare/resources/radar/http/http.py +++ b/src/cloudflare/resources/radar/http/http.py @@ -24,7 +24,7 @@ SummaryResourceWithStreamingResponse, AsyncSummaryResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from .ases.ases import ( AsesResource, @@ -43,7 +43,7 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....types.radar import http_timeseries_params +from ....types.radar import http_summary_v2_params, http_timeseries_params, http_timeseries_groups_v2_params from ...._base_client import make_request_options from .timeseries_groups import ( TimeseriesGroupsResource, @@ -61,7 +61,9 @@ LocationsResourceWithStreamingResponse, AsyncLocationsResourceWithStreamingResponse, ) +from ....types.radar.http_summary_v2_response import HTTPSummaryV2Response from ....types.radar.http_timeseries_response import HTTPTimeseriesResponse +from ....types.radar.http_timeseries_groups_v2_response import HTTPTimeseriesGroupsV2Response __all__ = ["HTTPResource", "AsyncHTTPResource"] @@ -106,34 +108,173 @@ def with_streaming_response(self) -> HTTPResourceWithStreamingResponse: """ return HTTPResourceWithStreamingResponse(self) + def summary_v2( + self, + dimension: Literal[ + "ADM1", + "BOT_CLASS", + "BROWSER", + "BROWSER_FAMILY", + "DEVICE_TYPE", + "HTTP_PROTOCOL", + "HTTP_VERSION", + "IP_VERSION", + "OS", + "POST_QUANTUM", + "TLS_VERSION", + ], + *, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> HTTPSummaryV2Response: + """ + Retrieves the distribution of HTTP requests by the specified dimension. + + Args: + dimension: Specifies the HTTP attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot_class: Filters results by bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + device_type: Filters results by device type. + + format: Format in which results will be returned. + + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). + + http_version: Filters results by HTTP version. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + os: Filters results by operating system. + + tls_version: Filters results by TLS version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/http/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "asn": asn, + "bot_class": bot_class, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "device_type": device_type, + "format": format, + "geo_id": geo_id, + "http_protocol": http_protocol, + "http_version": http_version, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "os": os, + "tls_version": tls_version, + }, + http_summary_v2_params.HTTPSummaryV2Params, + ), + post_parser=ResultWrapper[HTTPSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[HTTPSummaryV2Response], ResultWrapper[HTTPSummaryV2Response]), + ) + def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HTTPTimeseriesResponse: """ Retrieves the HTTP requests over time. @@ -169,6 +310,11 @@ def timeseries( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -215,6 +361,7 @@ def timeseries( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -231,6 +378,156 @@ def timeseries( cast_to=cast(Type[HTTPTimeseriesResponse], ResultWrapper[HTTPTimeseriesResponse]), ) + def timeseries_groups_v2( + self, + dimension: Literal[ + "ADM1", + "BOT_CLASS", + "BROWSER", + "BROWSER_FAMILY", + "DEVICE_TYPE", + "HTTP_PROTOCOL", + "HTTP_VERSION", + "IP_VERSION", + "OS", + "POST_QUANTUM", + "TLS_VERSION", + ], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> HTTPTimeseriesGroupsV2Response: + """ + Retrieves the distribution of HTTP requests grouped by dimension. + + Args: + dimension: Specifies the HTTP attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot_class: Filters results by bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + device_type: Filters results by device type. + + format: Format in which results will be returned. + + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). + + http_version: Filters results by HTTP version. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + os: Filters results by operating system. + + tls_version: Filters results by TLS version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/http/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "bot_class": bot_class, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "device_type": device_type, + "format": format, + "geo_id": geo_id, + "http_protocol": http_protocol, + "http_version": http_version, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + "os": os, + "tls_version": tls_version, + }, + http_timeseries_groups_v2_params.HTTPTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[HTTPTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[HTTPTimeseriesGroupsV2Response], ResultWrapper[HTTPTimeseriesGroupsV2Response]), + ) + class AsyncHTTPResource(AsyncAPIResource): @cached_property @@ -272,34 +569,173 @@ def with_streaming_response(self) -> AsyncHTTPResourceWithStreamingResponse: """ return AsyncHTTPResourceWithStreamingResponse(self) + async def summary_v2( + self, + dimension: Literal[ + "ADM1", + "BOT_CLASS", + "BROWSER", + "BROWSER_FAMILY", + "DEVICE_TYPE", + "HTTP_PROTOCOL", + "HTTP_VERSION", + "IP_VERSION", + "OS", + "POST_QUANTUM", + "TLS_VERSION", + ], + *, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> HTTPSummaryV2Response: + """ + Retrieves the distribution of HTTP requests by the specified dimension. + + Args: + dimension: Specifies the HTTP attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot_class: Filters results by bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + device_type: Filters results by device type. + + format: Format in which results will be returned. + + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). + + http_version: Filters results by HTTP version. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + os: Filters results by operating system. + + tls_version: Filters results by TLS version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/http/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "asn": asn, + "bot_class": bot_class, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "device_type": device_type, + "format": format, + "geo_id": geo_id, + "http_protocol": http_protocol, + "http_version": http_version, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "os": os, + "tls_version": tls_version, + }, + http_summary_v2_params.HTTPSummaryV2Params, + ), + post_parser=ResultWrapper[HTTPSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[HTTPSummaryV2Response], ResultWrapper[HTTPSummaryV2Response]), + ) + async def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HTTPTimeseriesResponse: """ Retrieves the HTTP requests over time. @@ -335,6 +771,11 @@ async def timeseries( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -381,6 +822,7 @@ async def timeseries( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -397,14 +839,170 @@ async def timeseries( cast_to=cast(Type[HTTPTimeseriesResponse], ResultWrapper[HTTPTimeseriesResponse]), ) + async def timeseries_groups_v2( + self, + dimension: Literal[ + "ADM1", + "BOT_CLASS", + "BROWSER", + "BROWSER_FAMILY", + "DEVICE_TYPE", + "HTTP_PROTOCOL", + "HTTP_VERSION", + "IP_VERSION", + "OS", + "POST_QUANTUM", + "TLS_VERSION", + ], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> HTTPTimeseriesGroupsV2Response: + """ + Retrieves the distribution of HTTP requests grouped by dimension. + + Args: + dimension: Specifies the HTTP attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot_class: Filters results by bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + device_type: Filters results by device type. + + format: Format in which results will be returned. + + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). + + http_version: Filters results by HTTP version. + + ip_version: Filters results by IP version (Ipv4 vs. IPv6). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + os: Filters results by operating system. + + tls_version: Filters results by TLS version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/http/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "bot_class": bot_class, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "device_type": device_type, + "format": format, + "geo_id": geo_id, + "http_protocol": http_protocol, + "http_version": http_version, + "ip_version": ip_version, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + "os": os, + "tls_version": tls_version, + }, + http_timeseries_groups_v2_params.HTTPTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[HTTPTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast(Type[HTTPTimeseriesGroupsV2Response], ResultWrapper[HTTPTimeseriesGroupsV2Response]), + ) + class HTTPResourceWithRawResponse: def __init__(self, http: HTTPResource) -> None: self._http = http + self.summary_v2 = to_raw_response_wrapper( + http.summary_v2, + ) self.timeseries = to_raw_response_wrapper( http.timeseries, ) + self.timeseries_groups_v2 = to_raw_response_wrapper( + http.timeseries_groups_v2, + ) @cached_property def locations(self) -> LocationsResourceWithRawResponse: @@ -431,9 +1029,15 @@ class AsyncHTTPResourceWithRawResponse: def __init__(self, http: AsyncHTTPResource) -> None: self._http = http + self.summary_v2 = async_to_raw_response_wrapper( + http.summary_v2, + ) self.timeseries = async_to_raw_response_wrapper( http.timeseries, ) + self.timeseries_groups_v2 = async_to_raw_response_wrapper( + http.timeseries_groups_v2, + ) @cached_property def locations(self) -> AsyncLocationsResourceWithRawResponse: @@ -460,9 +1064,15 @@ class HTTPResourceWithStreamingResponse: def __init__(self, http: HTTPResource) -> None: self._http = http + self.summary_v2 = to_streamed_response_wrapper( + http.summary_v2, + ) self.timeseries = to_streamed_response_wrapper( http.timeseries, ) + self.timeseries_groups_v2 = to_streamed_response_wrapper( + http.timeseries_groups_v2, + ) @cached_property def locations(self) -> LocationsResourceWithStreamingResponse: @@ -489,9 +1099,15 @@ class AsyncHTTPResourceWithStreamingResponse: def __init__(self, http: AsyncHTTPResource) -> None: self._http = http + self.summary_v2 = async_to_streamed_response_wrapper( + http.summary_v2, + ) self.timeseries = async_to_streamed_response_wrapper( http.timeseries, ) + self.timeseries_groups_v2 = async_to_streamed_response_wrapper( + http.timeseries_groups_v2, + ) @cached_property def locations(self) -> AsyncLocationsResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/radar/http/locations/bot_class.py b/src/cloudflare/resources/radar/http/locations/bot_class.py index 66e013cd350..207ffcaa027 100644 --- a/src/cloudflare/resources/radar/http/locations/bot_class.py +++ b/src/cloudflare/resources/radar/http/locations/bot_class.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, bot_class: Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BotClassGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested bot class. @@ -104,6 +104,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -149,6 +154,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -190,29 +196,29 @@ async def get( self, bot_class: Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BotClassGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested bot class. @@ -244,6 +250,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -289,6 +300,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/locations/browser_family.py b/src/cloudflare/resources/radar/http/locations/browser_family.py index 53cf29a5552..bc5a5db3ea3 100644 --- a/src/cloudflare/resources/radar/http/locations/browser_family.py +++ b/src/cloudflare/resources/radar/http/locations/browser_family.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, browser_family: Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BrowserFamilyGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested browser family. @@ -104,6 +104,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -149,6 +154,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -190,29 +196,29 @@ async def get( self, browser_family: Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BrowserFamilyGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested browser family. @@ -244,6 +250,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -289,6 +300,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/locations/device_type.py b/src/cloudflare/resources/radar/http/locations/device_type.py index 2b13a8d4c13..5300107f97d 100644 --- a/src/cloudflare/resources/radar/http/locations/device_type.py +++ b/src/cloudflare/resources/radar/http/locations/device_type.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, device_type: Literal["DESKTOP", "MOBILE", "OTHER"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DeviceTypeGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested device type. @@ -104,6 +104,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -149,6 +154,7 @@ def get( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -190,29 +196,29 @@ async def get( self, device_type: Literal["DESKTOP", "MOBILE", "OTHER"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DeviceTypeGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested device type. @@ -244,6 +250,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -289,6 +300,7 @@ async def get( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/locations/http_method.py b/src/cloudflare/resources/radar/http/locations/http_method.py index 3b70bb1b244..639ad34ed89 100644 --- a/src/cloudflare/resources/radar/http/locations/http_method.py +++ b/src/cloudflare/resources/radar/http/locations/http_method.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, http_version: Literal["HTTPv1", "HTTPv2", "HTTPv3"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HTTPMethodGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested HTTP version. @@ -106,6 +106,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -150,6 +155,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "ip_version": ip_version, "limit": limit, @@ -190,29 +196,29 @@ async def get( self, http_version: Literal["HTTPv1", "HTTPv2", "HTTPv3"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HTTPMethodGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested HTTP version. @@ -246,6 +252,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -290,6 +301,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "ip_version": ip_version, "limit": limit, diff --git a/src/cloudflare/resources/radar/http/locations/http_protocol.py b/src/cloudflare/resources/radar/http/locations/http_protocol.py index a67af85c018..a4df4deecf5 100644 --- a/src/cloudflare/resources/radar/http/locations/http_protocol.py +++ b/src/cloudflare/resources/radar/http/locations/http_protocol.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, http_protocol: Literal["HTTP", "HTTPS"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HTTPProtocolGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested HTTP protocol. @@ -106,6 +106,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_version: Filters results by HTTP version. ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -150,6 +155,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_version": http_version, "ip_version": ip_version, "limit": limit, @@ -190,29 +196,29 @@ async def get( self, http_protocol: Literal["HTTP", "HTTPS"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HTTPProtocolGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested HTTP protocol. @@ -246,6 +252,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_version: Filters results by HTTP version. ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -290,6 +301,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_version": http_version, "ip_version": ip_version, "limit": limit, diff --git a/src/cloudflare/resources/radar/http/locations/ip_version.py b/src/cloudflare/resources/radar/http/locations/ip_version.py index 8fd9dbc5861..c5f62f7a46e 100644 --- a/src/cloudflare/resources/radar/http/locations/ip_version.py +++ b/src/cloudflare/resources/radar/http/locations/ip_version.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, ip_version: Literal["IPv4", "IPv6"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPVersionGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested IP version. @@ -106,6 +106,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -150,6 +155,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "limit": limit, @@ -190,29 +196,29 @@ async def get( self, ip_version: Literal["IPv4", "IPv6"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IPVersionGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested IP version. @@ -246,6 +252,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -290,6 +301,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "limit": limit, diff --git a/src/cloudflare/resources/radar/http/locations/locations.py b/src/cloudflare/resources/radar/http/locations/locations.py index 74aaa31dc83..f35bdc497e6 100644 --- a/src/cloudflare/resources/radar/http/locations/locations.py +++ b/src/cloudflare/resources/radar/http/locations/locations.py @@ -24,7 +24,7 @@ BotClassResourceWithStreamingResponse, AsyncBotClassResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from .ip_version import ( IPVersionResource, @@ -145,30 +145,30 @@ def with_streaming_response(self) -> LocationsResourceWithStreamingResponse: def get( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationGetResponse: """ Retrieves the top locations by HTTP requests. @@ -200,6 +200,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -244,6 +249,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -316,30 +322,30 @@ def with_streaming_response(self) -> AsyncLocationsResourceWithStreamingResponse async def get( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationGetResponse: """ Retrieves the top locations by HTTP requests. @@ -371,6 +377,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -415,6 +426,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/locations/os.py b/src/cloudflare/resources/radar/http/locations/os.py index 9977f428f59..ab46ba089cf 100644 --- a/src/cloudflare/resources/radar/http/locations/os.py +++ b/src/cloudflare/resources/radar/http/locations/os.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,28 +50,29 @@ def get( self, os: Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OSGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested operating @@ -106,6 +107,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -150,6 +156,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -190,28 +197,29 @@ async def get( self, os: Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OSGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested operating @@ -246,6 +254,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -290,6 +303,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/locations/tls_version.py b/src/cloudflare/resources/radar/http/locations/tls_version.py index 70909cf4164..d53cd40360c 100644 --- a/src/cloudflare/resources/radar/http/locations/tls_version.py +++ b/src/cloudflare/resources/radar/http/locations/tls_version.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,29 +50,29 @@ def get( self, tls_version: Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TLSVersionGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested TLS protocol @@ -107,6 +107,11 @@ def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -151,6 +156,7 @@ def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -191,29 +197,29 @@ async def get( self, tls_version: Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"], *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TLSVersionGetResponse: """ Retrieves the top locations, by HTTP requests, of the requested TLS protocol @@ -248,6 +254,11 @@ async def get( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -292,6 +303,7 @@ async def get( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, diff --git a/src/cloudflare/resources/radar/http/summary.py b/src/cloudflare/resources/radar/http/summary.py index 36f04c30727..6859ec69b38 100644 --- a/src/cloudflare/resources/radar/http/summary.py +++ b/src/cloudflare/resources/radar/http/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -62,31 +63,34 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) def bot_class( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryBotClassResponse: """ Retrieves the distribution of bot-generated HTTP requests to genuine human @@ -118,6 +122,11 @@ def bot_class( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -159,6 +168,7 @@ def bot_class( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -174,31 +184,34 @@ def bot_class( cast_to=cast(Type[SummaryBotClassResponse], ResultWrapper[SummaryBotClassResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) def device_type( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDeviceTypeResponse: """ Retrieves the distribution of HTTP requests generated by mobile, desktop, and @@ -229,6 +242,11 @@ def device_type( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -270,6 +288,7 @@ def device_type( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -285,31 +304,34 @@ def device_type( cast_to=cast(Type[SummaryDeviceTypeResponse], ResultWrapper[SummaryDeviceTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) def http_protocol( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryHTTPProtocolResponse: """Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. @@ -342,6 +364,11 @@ def http_protocol( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_version: Filters results by HTTP version. ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -382,6 +409,7 @@ def http_protocol( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_version": http_version, "ip_version": ip_version, "location": location, @@ -396,31 +424,34 @@ def http_protocol( cast_to=cast(Type[SummaryHTTPProtocolResponse], ResultWrapper[SummaryHTTPProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) def http_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryHTTPVersionResponse: """ Retrieves the distribution of HTTP requests by HTTP version. @@ -452,6 +483,11 @@ def http_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -492,6 +528,7 @@ def http_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "ip_version": ip_version, "location": location, @@ -506,31 +543,34 @@ def http_version( cast_to=cast(Type[SummaryHTTPVersionResponse], ResultWrapper[SummaryHTTPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) def ip_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of HTTP requests by IP version. @@ -562,6 +602,11 @@ def ip_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -602,6 +647,7 @@ def ip_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "location": location, @@ -616,30 +662,34 @@ def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) def os( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryOSResponse: """ Retrieves the distribution of HTTP requests by operating system (Windows, macOS, @@ -672,6 +722,11 @@ def os( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -712,6 +767,7 @@ def os( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -726,32 +782,35 @@ def os( cast_to=cast(Type[SummaryOSResponse], ResultWrapper[SummaryOSResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) def post_quantum( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryPostQuantumResponse: """ Retrieves the distribution of HTTP requests by post-quantum support. @@ -783,6 +842,11 @@ def post_quantum( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -825,6 +889,7 @@ def post_quantum( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -840,31 +905,34 @@ def post_quantum( cast_to=cast(Type[SummaryPostQuantumResponse], ResultWrapper[SummaryPostQuantumResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) def tls_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryTLSVersionResponse: """ Retrieves the distribution of HTTP requests by TLS version. @@ -896,6 +964,11 @@ def tls_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -936,6 +1009,7 @@ def tls_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -971,31 +1045,34 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) async def bot_class( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryBotClassResponse: """ Retrieves the distribution of bot-generated HTTP requests to genuine human @@ -1027,6 +1104,11 @@ async def bot_class( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1068,6 +1150,7 @@ async def bot_class( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1083,31 +1166,34 @@ async def bot_class( cast_to=cast(Type[SummaryBotClassResponse], ResultWrapper[SummaryBotClassResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) async def device_type( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryDeviceTypeResponse: """ Retrieves the distribution of HTTP requests generated by mobile, desktop, and @@ -1138,6 +1224,11 @@ async def device_type( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1179,6 +1270,7 @@ async def device_type( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1194,31 +1286,34 @@ async def device_type( cast_to=cast(Type[SummaryDeviceTypeResponse], ResultWrapper[SummaryDeviceTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) async def http_protocol( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryHTTPProtocolResponse: """Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. @@ -1251,6 +1346,11 @@ async def http_protocol( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_version: Filters results by HTTP version. ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -1291,6 +1391,7 @@ async def http_protocol( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_version": http_version, "ip_version": ip_version, "location": location, @@ -1305,31 +1406,34 @@ async def http_protocol( cast_to=cast(Type[SummaryHTTPProtocolResponse], ResultWrapper[SummaryHTTPProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) async def http_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryHTTPVersionResponse: """ Retrieves the distribution of HTTP requests by HTTP version. @@ -1361,6 +1465,11 @@ async def http_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -1401,6 +1510,7 @@ async def http_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "ip_version": ip_version, "location": location, @@ -1415,31 +1525,34 @@ async def http_version( cast_to=cast(Type[SummaryHTTPVersionResponse], ResultWrapper[SummaryHTTPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) async def ip_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryIPVersionResponse: """ Retrieves the distribution of HTTP requests by IP version. @@ -1471,6 +1584,11 @@ async def ip_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1511,6 +1629,7 @@ async def ip_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "location": location, @@ -1525,30 +1644,34 @@ async def ip_version( cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) async def os( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryOSResponse: """ Retrieves the distribution of HTTP requests by operating system (Windows, macOS, @@ -1581,6 +1704,11 @@ async def os( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1621,6 +1749,7 @@ async def os( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1635,32 +1764,35 @@ async def os( cast_to=cast(Type[SummaryOSResponse], ResultWrapper[SummaryOSResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) async def post_quantum( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryPostQuantumResponse: """ Retrieves the distribution of HTTP requests by post-quantum support. @@ -1692,6 +1824,11 @@ async def post_quantum( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1734,6 +1871,7 @@ async def post_quantum( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1749,31 +1887,34 @@ async def post_quantum( cast_to=cast(Type[SummaryPostQuantumResponse], ResultWrapper[SummaryPostQuantumResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) async def tls_version( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryTLSVersionResponse: """ Retrieves the distribution of HTTP requests by TLS version. @@ -1805,6 +1946,11 @@ async def tls_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1845,6 +1991,7 @@ async def tls_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1864,29 +2011,45 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.bot_class = to_raw_response_wrapper( - summary.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.device_type = to_raw_response_wrapper( - summary.device_type, + self.device_type = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.device_type, # pyright: ignore[reportDeprecated], + ) ) - self.http_protocol = to_raw_response_wrapper( - summary.http_protocol, + self.http_protocol = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.http_protocol, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = to_raw_response_wrapper( - summary.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.os = to_raw_response_wrapper( - summary.os, + self.os = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.os, # pyright: ignore[reportDeprecated], + ) ) - self.post_quantum = to_raw_response_wrapper( - summary.post_quantum, + self.post_quantum = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.post_quantum, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = to_raw_response_wrapper( - summary.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -1894,29 +2057,45 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.bot_class = async_to_raw_response_wrapper( - summary.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.device_type = async_to_raw_response_wrapper( - summary.device_type, + self.device_type = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.device_type, # pyright: ignore[reportDeprecated], + ) ) - self.http_protocol = async_to_raw_response_wrapper( - summary.http_protocol, + self.http_protocol = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.http_protocol, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = async_to_raw_response_wrapper( - summary.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.os = async_to_raw_response_wrapper( - summary.os, + self.os = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.os, # pyright: ignore[reportDeprecated], + ) ) - self.post_quantum = async_to_raw_response_wrapper( - summary.post_quantum, + self.post_quantum = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.post_quantum, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = async_to_raw_response_wrapper( - summary.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -1924,29 +2103,45 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.bot_class = to_streamed_response_wrapper( - summary.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.device_type = to_streamed_response_wrapper( - summary.device_type, + self.device_type = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.device_type, # pyright: ignore[reportDeprecated], + ) ) - self.http_protocol = to_streamed_response_wrapper( - summary.http_protocol, + self.http_protocol = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.http_protocol, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = to_streamed_response_wrapper( - summary.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.os = to_streamed_response_wrapper( - summary.os, + self.os = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.os, # pyright: ignore[reportDeprecated], + ) ) - self.post_quantum = to_streamed_response_wrapper( - summary.post_quantum, + self.post_quantum = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.post_quantum, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = to_streamed_response_wrapper( - summary.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -1954,27 +2149,43 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.bot_class = async_to_streamed_response_wrapper( - summary.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.device_type = async_to_streamed_response_wrapper( - summary.device_type, + self.device_type = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.device_type, # pyright: ignore[reportDeprecated], + ) ) - self.http_protocol = async_to_streamed_response_wrapper( - summary.http_protocol, + self.http_protocol = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.http_protocol, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = async_to_streamed_response_wrapper( - summary.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - summary.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.os = async_to_streamed_response_wrapper( - summary.os, + self.os = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.os, # pyright: ignore[reportDeprecated], + ) ) - self.post_quantum = async_to_streamed_response_wrapper( - summary.post_quantum, + self.post_quantum = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.post_quantum, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = async_to_streamed_response_wrapper( - summary.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.tls_version, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/http/timeseries_groups.py b/src/cloudflare/resources/radar/http/timeseries_groups.py index 25cdd7d6709..1abeaa86143 100644 --- a/src/cloudflare/resources/radar/http/timeseries_groups.py +++ b/src/cloudflare/resources/radar/http/timeseries_groups.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -66,32 +67,35 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon """ return TimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) def bot_class( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupBotClassResponse: """ Retrieves the distribution of HTTP requests classified as automated or human @@ -126,6 +130,11 @@ def bot_class( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -168,6 +177,7 @@ def bot_class( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -183,34 +193,37 @@ def bot_class( cast_to=cast(Type[TimeseriesGroupBotClassResponse], ResultWrapper[TimeseriesGroupBotClassResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) def browser( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupBrowserResponse: """ Retrieves the distribution of HTTP requests by user agent over time. @@ -246,6 +259,11 @@ def browser( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -293,6 +311,7 @@ def browser( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -309,33 +328,36 @@ def browser( cast_to=cast(Type[TimeseriesGroupBrowserResponse], ResultWrapper[TimeseriesGroupBrowserResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) def browser_family( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupBrowserFamilyResponse: """ Retrieves the distribution of HTTP requests by user agent family over time. @@ -369,6 +391,11 @@ def browser_family( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -415,6 +442,7 @@ def browser_family( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -433,32 +461,35 @@ def browser_family( ), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) def device_type( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDeviceTypeResponse: """ Retrieves the distribution of HTTP requests by device type over time. @@ -492,6 +523,11 @@ def device_type( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -534,6 +570,7 @@ def device_type( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -549,32 +586,35 @@ def device_type( cast_to=cast(Type[TimeseriesGroupDeviceTypeResponse], ResultWrapper[TimeseriesGroupDeviceTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) def http_protocol( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupHTTPProtocolResponse: """Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. @@ -612,6 +652,11 @@ def http_protocol( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_version: Filters results by HTTP version. ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -653,6 +698,7 @@ def http_protocol( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_version": http_version, "ip_version": ip_version, "location": location, @@ -667,32 +713,35 @@ def http_protocol( cast_to=cast(Type[TimeseriesGroupHTTPProtocolResponse], ResultWrapper[TimeseriesGroupHTTPProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) def http_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupHTTPVersionResponse: """ Retrieves the distribution of HTTP requests by HTTP version over time. @@ -728,6 +777,11 @@ def http_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -769,6 +823,7 @@ def http_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "ip_version": ip_version, "location": location, @@ -783,32 +838,35 @@ def http_version( cast_to=cast(Type[TimeseriesGroupHTTPVersionResponse], ResultWrapper[TimeseriesGroupHTTPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of HTTP requests by IP version over time. @@ -844,6 +902,11 @@ def ip_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -885,6 +948,7 @@ def ip_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "location": location, @@ -899,31 +963,35 @@ def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) def os( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupOSResponse: """ Retrieves the distribution of HTTP requests by operating system over time. @@ -959,6 +1027,11 @@ def os( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1000,6 +1073,7 @@ def os( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1014,33 +1088,36 @@ def os( cast_to=cast(Type[TimeseriesGroupOSResponse], ResultWrapper[TimeseriesGroupOSResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) def post_quantum( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupPostQuantumResponse: """ Retrieves the distribution of HTTP requests by post-quantum support over time. @@ -1076,6 +1153,11 @@ def post_quantum( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1119,6 +1201,7 @@ def post_quantum( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1134,32 +1217,35 @@ def post_quantum( cast_to=cast(Type[TimeseriesGroupPostQuantumResponse], ResultWrapper[TimeseriesGroupPostQuantumResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) def tls_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupTLSVersionResponse: """ Retrieves the distribution of HTTP requests by TLS version over time. @@ -1195,6 +1281,11 @@ def tls_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1236,6 +1327,7 @@ def tls_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1271,32 +1363,35 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR """ return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) async def bot_class( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupBotClassResponse: """ Retrieves the distribution of HTTP requests classified as automated or human @@ -1331,6 +1426,11 @@ async def bot_class( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1373,6 +1473,7 @@ async def bot_class( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1388,34 +1489,37 @@ async def bot_class( cast_to=cast(Type[TimeseriesGroupBotClassResponse], ResultWrapper[TimeseriesGroupBotClassResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) async def browser( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupBrowserResponse: """ Retrieves the distribution of HTTP requests by user agent over time. @@ -1451,6 +1555,11 @@ async def browser( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1498,6 +1607,7 @@ async def browser( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1514,33 +1624,36 @@ async def browser( cast_to=cast(Type[TimeseriesGroupBrowserResponse], ResultWrapper[TimeseriesGroupBrowserResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) async def browser_family( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit_per_group: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupBrowserFamilyResponse: """ Retrieves the distribution of HTTP requests by user agent family over time. @@ -1574,6 +1687,11 @@ async def browser_family( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1620,6 +1738,7 @@ async def browser_family( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1638,32 +1757,35 @@ async def browser_family( ), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) async def device_type( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupDeviceTypeResponse: """ Retrieves the distribution of HTTP requests by device type over time. @@ -1697,6 +1819,11 @@ async def device_type( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -1739,6 +1866,7 @@ async def device_type( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -1754,32 +1882,35 @@ async def device_type( cast_to=cast(Type[TimeseriesGroupDeviceTypeResponse], ResultWrapper[TimeseriesGroupDeviceTypeResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) async def http_protocol( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupHTTPProtocolResponse: """Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. @@ -1817,6 +1948,11 @@ async def http_protocol( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_version: Filters results by HTTP version. ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -1858,6 +1994,7 @@ async def http_protocol( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_version": http_version, "ip_version": ip_version, "location": location, @@ -1872,32 +2009,35 @@ async def http_protocol( cast_to=cast(Type[TimeseriesGroupHTTPProtocolResponse], ResultWrapper[TimeseriesGroupHTTPProtocolResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) async def http_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupHTTPVersionResponse: """ Retrieves the distribution of HTTP requests by HTTP version over time. @@ -1933,6 +2073,11 @@ async def http_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). ip_version: Filters results by IP version (Ipv4 vs. IPv6). @@ -1974,6 +2119,7 @@ async def http_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "ip_version": ip_version, "location": location, @@ -1988,32 +2134,35 @@ async def http_version( cast_to=cast(Type[TimeseriesGroupHTTPVersionResponse], ResultWrapper[TimeseriesGroupHTTPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) async def ip_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupIPVersionResponse: """ Retrieves the distribution of HTTP requests by IP version over time. @@ -2049,6 +2198,11 @@ async def ip_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -2090,6 +2244,7 @@ async def ip_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "location": location, @@ -2104,31 +2259,35 @@ async def ip_version( cast_to=cast(Type[TimeseriesGroupIPVersionResponse], ResultWrapper[TimeseriesGroupIPVersionResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) async def os( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupOSResponse: """ Retrieves the distribution of HTTP requests by operating system over time. @@ -2164,6 +2323,11 @@ async def os( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -2205,6 +2369,7 @@ async def os( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -2219,33 +2384,36 @@ async def os( cast_to=cast(Type[TimeseriesGroupOSResponse], ResultWrapper[TimeseriesGroupOSResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) async def post_quantum( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupPostQuantumResponse: """ Retrieves the distribution of HTTP requests by post-quantum support over time. @@ -2281,6 +2449,11 @@ async def post_quantum( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -2324,6 +2497,7 @@ async def post_quantum( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -2339,32 +2513,35 @@ async def post_quantum( cast_to=cast(Type[TimeseriesGroupPostQuantumResponse], ResultWrapper[TimeseriesGroupPostQuantumResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/timeseries_groups_v2/) instead." + ) async def tls_version( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupTLSVersionResponse: """ Retrieves the distribution of HTTP requests by TLS version over time. @@ -2400,6 +2577,11 @@ async def tls_version( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -2441,6 +2623,7 @@ async def tls_version( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -2460,35 +2643,55 @@ class TimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bot_class = to_raw_response_wrapper( - timeseries_groups.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.browser = to_raw_response_wrapper( - timeseries_groups.browser, + self.browser = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.browser, # pyright: ignore[reportDeprecated], + ) ) - self.browser_family = to_raw_response_wrapper( - timeseries_groups.browser_family, + self.browser_family = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.browser_family, # pyright: ignore[reportDeprecated], + ) ) - self.device_type = to_raw_response_wrapper( - timeseries_groups.device_type, + self.device_type = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.device_type, # pyright: ignore[reportDeprecated], + ) ) - self.http_protocol = to_raw_response_wrapper( - timeseries_groups.http_protocol, + self.http_protocol = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.http_protocol, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = to_raw_response_wrapper( - timeseries_groups.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.os = to_raw_response_wrapper( - timeseries_groups.os, + self.os = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.os, # pyright: ignore[reportDeprecated], + ) ) - self.post_quantum = to_raw_response_wrapper( - timeseries_groups.post_quantum, + self.post_quantum = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.post_quantum, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = to_raw_response_wrapper( - timeseries_groups.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -2496,35 +2699,55 @@ class AsyncTimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bot_class = async_to_raw_response_wrapper( - timeseries_groups.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.browser = async_to_raw_response_wrapper( - timeseries_groups.browser, + self.browser = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.browser, # pyright: ignore[reportDeprecated], + ) ) - self.browser_family = async_to_raw_response_wrapper( - timeseries_groups.browser_family, + self.browser_family = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.browser_family, # pyright: ignore[reportDeprecated], + ) ) - self.device_type = async_to_raw_response_wrapper( - timeseries_groups.device_type, + self.device_type = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.device_type, # pyright: ignore[reportDeprecated], + ) ) - self.http_protocol = async_to_raw_response_wrapper( - timeseries_groups.http_protocol, + self.http_protocol = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.http_protocol, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = async_to_raw_response_wrapper( - timeseries_groups.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_raw_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.os = async_to_raw_response_wrapper( - timeseries_groups.os, + self.os = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.os, # pyright: ignore[reportDeprecated], + ) ) - self.post_quantum = async_to_raw_response_wrapper( - timeseries_groups.post_quantum, + self.post_quantum = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.post_quantum, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = async_to_raw_response_wrapper( - timeseries_groups.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -2532,35 +2755,55 @@ class TimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bot_class = to_streamed_response_wrapper( - timeseries_groups.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.browser = to_streamed_response_wrapper( - timeseries_groups.browser, + self.browser = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.browser, # pyright: ignore[reportDeprecated], + ) ) - self.browser_family = to_streamed_response_wrapper( - timeseries_groups.browser_family, + self.browser_family = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.browser_family, # pyright: ignore[reportDeprecated], + ) ) - self.device_type = to_streamed_response_wrapper( - timeseries_groups.device_type, + self.device_type = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.device_type, # pyright: ignore[reportDeprecated], + ) ) - self.http_protocol = to_streamed_response_wrapper( - timeseries_groups.http_protocol, + self.http_protocol = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.http_protocol, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = to_streamed_response_wrapper( - timeseries_groups.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.os = to_streamed_response_wrapper( - timeseries_groups.os, + self.os = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.os, # pyright: ignore[reportDeprecated], + ) ) - self.post_quantum = to_streamed_response_wrapper( - timeseries_groups.post_quantum, + self.post_quantum = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.post_quantum, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = to_streamed_response_wrapper( - timeseries_groups.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.tls_version, # pyright: ignore[reportDeprecated], + ) ) @@ -2568,33 +2811,53 @@ class AsyncTimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bot_class = async_to_streamed_response_wrapper( - timeseries_groups.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.browser = async_to_streamed_response_wrapper( - timeseries_groups.browser, + self.browser = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.browser, # pyright: ignore[reportDeprecated], + ) ) - self.browser_family = async_to_streamed_response_wrapper( - timeseries_groups.browser_family, + self.browser_family = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.browser_family, # pyright: ignore[reportDeprecated], + ) ) - self.device_type = async_to_streamed_response_wrapper( - timeseries_groups.device_type, + self.device_type = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.device_type, # pyright: ignore[reportDeprecated], + ) ) - self.http_protocol = async_to_streamed_response_wrapper( - timeseries_groups.http_protocol, + self.http_protocol = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.http_protocol, # pyright: ignore[reportDeprecated], + ) ) - self.http_version = async_to_streamed_response_wrapper( - timeseries_groups.http_version, + self.http_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.http_version, # pyright: ignore[reportDeprecated], + ) ) - self.ip_version = async_to_streamed_response_wrapper( - timeseries_groups.ip_version, + self.ip_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.ip_version, # pyright: ignore[reportDeprecated], + ) ) - self.os = async_to_streamed_response_wrapper( - timeseries_groups.os, + self.os = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.os, # pyright: ignore[reportDeprecated], + ) ) - self.post_quantum = async_to_streamed_response_wrapper( - timeseries_groups.post_quantum, + self.post_quantum = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.post_quantum, # pyright: ignore[reportDeprecated], + ) ) - self.tls_version = async_to_streamed_response_wrapper( - timeseries_groups.tls_version, + self.tls_version = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.tls_version, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/http/top.py b/src/cloudflare/resources/radar/http/top.py index 041d6b3f6a5..93a3faa2427 100644 --- a/src/cloudflare/resources/radar/http/top.py +++ b/src/cloudflare/resources/radar/http/top.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -47,33 +48,36 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse: """ return TopResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) def browser( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopBrowserResponse: """ Retrieves the top user agents by HTTP requests. @@ -105,6 +109,11 @@ def browser( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -149,6 +158,7 @@ def browser( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -165,32 +175,35 @@ def browser( cast_to=cast(Type[TopBrowserResponse], ResultWrapper[TopBrowserResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) def browser_family( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopBrowserFamilyResponse: """ Retrieves the top user agents, aggregated in families, by HTTP requests. @@ -220,6 +233,11 @@ def browser_family( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -263,6 +281,7 @@ def browser_family( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -300,33 +319,36 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: """ return AsyncTopResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) async def browser( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + browser_family: List[Literal["CHROME", "EDGE", "FIREFOX", "SAFARI"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopBrowserResponse: """ Retrieves the top user agents by HTTP requests. @@ -358,6 +380,11 @@ async def browser( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -402,6 +429,7 @@ async def browser( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -418,32 +446,35 @@ async def browser( cast_to=cast(Type[TopBrowserResponse], ResultWrapper[TopBrowserResponse]), ) + @typing_extensions.deprecated( + "Use [Radar HTTP Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/http/methods/summary_v2/) instead." + ) async def browser_family( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN, - http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN, - ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] - | NotGiven = NOT_GIVEN, - tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + http_protocol: List[Literal["HTTP", "HTTPS"]] | Omit = omit, + http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | Omit = omit, + ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]] | Omit = omit, + tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopBrowserFamilyResponse: """ Retrieves the top user agents, aggregated in families, by HTTP requests. @@ -473,6 +504,11 @@ async def browser_family( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + http_protocol: Filters results by HTTP protocol (HTTP vs. HTTPS). http_version: Filters results by HTTP version. @@ -516,6 +552,7 @@ async def browser_family( "date_start": date_start, "device_type": device_type, "format": format, + "geo_id": geo_id, "http_protocol": http_protocol, "http_version": http_version, "ip_version": ip_version, @@ -537,11 +574,15 @@ class TopResourceWithRawResponse: def __init__(self, top: TopResource) -> None: self._top = top - self.browser = to_raw_response_wrapper( - top.browser, + self.browser = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + top.browser, # pyright: ignore[reportDeprecated], + ) ) - self.browser_family = to_raw_response_wrapper( - top.browser_family, + self.browser_family = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + top.browser_family, # pyright: ignore[reportDeprecated], + ) ) @@ -549,11 +590,15 @@ class AsyncTopResourceWithRawResponse: def __init__(self, top: AsyncTopResource) -> None: self._top = top - self.browser = async_to_raw_response_wrapper( - top.browser, + self.browser = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + top.browser, # pyright: ignore[reportDeprecated], + ) ) - self.browser_family = async_to_raw_response_wrapper( - top.browser_family, + self.browser_family = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + top.browser_family, # pyright: ignore[reportDeprecated], + ) ) @@ -561,11 +606,15 @@ class TopResourceWithStreamingResponse: def __init__(self, top: TopResource) -> None: self._top = top - self.browser = to_streamed_response_wrapper( - top.browser, + self.browser = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + top.browser, # pyright: ignore[reportDeprecated], + ) ) - self.browser_family = to_streamed_response_wrapper( - top.browser_family, + self.browser_family = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + top.browser_family, # pyright: ignore[reportDeprecated], + ) ) @@ -573,9 +622,13 @@ class AsyncTopResourceWithStreamingResponse: def __init__(self, top: AsyncTopResource) -> None: self._top = top - self.browser = async_to_streamed_response_wrapper( - top.browser, + self.browser = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + top.browser, # pyright: ignore[reportDeprecated], + ) ) - self.browser_family = async_to_streamed_response_wrapper( - top.browser_family, + self.browser_family = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + top.browser_family, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/leaked_credentials/leaked_credentials.py b/src/cloudflare/resources/radar/leaked_credentials/leaked_credentials.py index 567848d37ba..565ce6034c7 100644 --- a/src/cloudflare/resources/radar/leaked_credentials/leaked_credentials.py +++ b/src/cloudflare/resources/radar/leaked_credentials/leaked_credentials.py @@ -2,6 +2,12 @@ from __future__ import annotations +from typing import List, Type, Union, cast +from datetime import datetime +from typing_extensions import Literal + +import httpx + from .summary import ( SummaryResource, AsyncSummaryResource, @@ -10,8 +16,19 @@ SummaryResourceWithStreamingResponse, AsyncSummaryResourceWithStreamingResponse, ) +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.radar import leaked_credential_summary_v2_params, leaked_credential_timeseries_groups_v2_params +from ...._base_client import make_request_options from .timeseries_groups import ( TimeseriesGroupsResource, AsyncTimeseriesGroupsResource, @@ -20,6 +37,8 @@ TimeseriesGroupsResourceWithStreamingResponse, AsyncTimeseriesGroupsResourceWithStreamingResponse, ) +from ....types.radar.leaked_credential_summary_v2_response import LeakedCredentialSummaryV2Response +from ....types.radar.leaked_credential_timeseries_groups_v2_response import LeakedCredentialTimeseriesGroupsV2Response __all__ = ["LeakedCredentialsResource", "AsyncLeakedCredentialsResource"] @@ -52,6 +71,235 @@ def with_streaming_response(self) -> LeakedCredentialsResourceWithStreamingRespo """ return LeakedCredentialsResourceWithStreamingResponse(self) + def summary_v2( + self, + dimension: Literal["COMPROMISED", "BOT_CLASS"], + *, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + compromised: List[Literal["CLEAN", "COMPROMISED"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + ) -> LeakedCredentialSummaryV2Response: + """ + Retrieves an aggregated summary of HTTP authentication requests grouped by the + specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot_class: Filters results by bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + + compromised: Filters results by compromised credential status (clean vs. compromised). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/leaked_credential_checks/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "asn": asn, + "bot_class": bot_class, + "compromised": compromised, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + }, + leaked_credential_summary_v2_params.LeakedCredentialSummaryV2Params, + ), + post_parser=ResultWrapper[LeakedCredentialSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[LeakedCredentialSummaryV2Response], ResultWrapper[LeakedCredentialSummaryV2Response]), + ) + + def timeseries_groups_v2( + self, + dimension: Literal["COMPROMISED", "BOT_CLASS"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + check_result: List[ + Literal[ + "CLEAN", + "USERNAME_LEAKED", + "USERNAME_PASSWORD_SIMILAR", + "USERNAME_AND_PASSWORD_LEAKED", + "PASSWORD_LEAKED", + ] + ] + | Omit = omit, + compromised: List[Literal["CLEAN", "COMPROMISED"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LeakedCredentialTimeseriesGroupsV2Response: + """ + Retrieves the distribution of HTTP authentication requests, grouped by the + specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot_class: Filters results by bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + + check_result: Filters results by leaked credential check result. + + compromised: Filters results by compromised credential status (clean vs. compromised). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/leaked_credential_checks/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "bot_class": bot_class, + "check_result": check_result, + "compromised": compromised, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + }, + leaked_credential_timeseries_groups_v2_params.LeakedCredentialTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[LeakedCredentialTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast( + Type[LeakedCredentialTimeseriesGroupsV2Response], + ResultWrapper[LeakedCredentialTimeseriesGroupsV2Response], + ), + ) + class AsyncLeakedCredentialsResource(AsyncAPIResource): @cached_property @@ -81,11 +329,247 @@ def with_streaming_response(self) -> AsyncLeakedCredentialsResourceWithStreaming """ return AsyncLeakedCredentialsResourceWithStreamingResponse(self) + async def summary_v2( + self, + dimension: Literal["COMPROMISED", "BOT_CLASS"], + *, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + compromised: List[Literal["CLEAN", "COMPROMISED"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + ) -> LeakedCredentialSummaryV2Response: + """ + Retrieves an aggregated summary of HTTP authentication requests grouped by the + specified dimension. + + Args: + dimension: Specifies the attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot_class: Filters results by bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + + compromised: Filters results by compromised credential status (clean vs. compromised). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/leaked_credential_checks/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "asn": asn, + "bot_class": bot_class, + "compromised": compromised, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + }, + leaked_credential_summary_v2_params.LeakedCredentialSummaryV2Params, + ), + post_parser=ResultWrapper[LeakedCredentialSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[LeakedCredentialSummaryV2Response], ResultWrapper[LeakedCredentialSummaryV2Response]), + ) + + async def timeseries_groups_v2( + self, + dimension: Literal["COMPROMISED", "BOT_CLASS"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + check_result: List[ + Literal[ + "CLEAN", + "USERNAME_LEAKED", + "USERNAME_PASSWORD_SIMILAR", + "USERNAME_AND_PASSWORD_LEAKED", + "PASSWORD_LEAKED", + ] + ] + | Omit = omit, + compromised: List[Literal["CLEAN", "COMPROMISED"]] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> LeakedCredentialTimeseriesGroupsV2Response: + """ + Retrieves the distribution of HTTP authentication requests, grouped by the + specified dimension over time. + + Args: + dimension: Specifies the attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + bot_class: Filters results by bot class. Refer to + [Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/). + + check_result: Filters results by leaked credential check result. + + compromised: Filters results by compromised credential status (clean vs. compromised). + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/leaked_credential_checks/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "bot_class": bot_class, + "check_result": check_result, + "compromised": compromised, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + }, + leaked_credential_timeseries_groups_v2_params.LeakedCredentialTimeseriesGroupsV2Params, + ), + post_parser=ResultWrapper[LeakedCredentialTimeseriesGroupsV2Response]._unwrapper, + ), + cast_to=cast( + Type[LeakedCredentialTimeseriesGroupsV2Response], + ResultWrapper[LeakedCredentialTimeseriesGroupsV2Response], + ), + ) + class LeakedCredentialsResourceWithRawResponse: def __init__(self, leaked_credentials: LeakedCredentialsResource) -> None: self._leaked_credentials = leaked_credentials + self.summary_v2 = to_raw_response_wrapper( + leaked_credentials.summary_v2, + ) + self.timeseries_groups_v2 = to_raw_response_wrapper( + leaked_credentials.timeseries_groups_v2, + ) + @cached_property def summary(self) -> SummaryResourceWithRawResponse: return SummaryResourceWithRawResponse(self._leaked_credentials.summary) @@ -99,6 +583,13 @@ class AsyncLeakedCredentialsResourceWithRawResponse: def __init__(self, leaked_credentials: AsyncLeakedCredentialsResource) -> None: self._leaked_credentials = leaked_credentials + self.summary_v2 = async_to_raw_response_wrapper( + leaked_credentials.summary_v2, + ) + self.timeseries_groups_v2 = async_to_raw_response_wrapper( + leaked_credentials.timeseries_groups_v2, + ) + @cached_property def summary(self) -> AsyncSummaryResourceWithRawResponse: return AsyncSummaryResourceWithRawResponse(self._leaked_credentials.summary) @@ -112,6 +603,13 @@ class LeakedCredentialsResourceWithStreamingResponse: def __init__(self, leaked_credentials: LeakedCredentialsResource) -> None: self._leaked_credentials = leaked_credentials + self.summary_v2 = to_streamed_response_wrapper( + leaked_credentials.summary_v2, + ) + self.timeseries_groups_v2 = to_streamed_response_wrapper( + leaked_credentials.timeseries_groups_v2, + ) + @cached_property def summary(self) -> SummaryResourceWithStreamingResponse: return SummaryResourceWithStreamingResponse(self._leaked_credentials.summary) @@ -125,6 +623,13 @@ class AsyncLeakedCredentialsResourceWithStreamingResponse: def __init__(self, leaked_credentials: AsyncLeakedCredentialsResource) -> None: self._leaked_credentials = leaked_credentials + self.summary_v2 = async_to_streamed_response_wrapper( + leaked_credentials.summary_v2, + ) + self.timeseries_groups_v2 = async_to_streamed_response_wrapper( + leaked_credentials.timeseries_groups_v2, + ) + @cached_property def summary(self) -> AsyncSummaryResourceWithStreamingResponse: return AsyncSummaryResourceWithStreamingResponse(self._leaked_credentials.summary) diff --git a/src/cloudflare/resources/radar/leaked_credentials/summary.py b/src/cloudflare/resources/radar/leaked_credentials/summary.py index 263f761efec..bba1af6177a 100644 --- a/src/cloudflare/resources/radar/leaked_credentials/summary.py +++ b/src/cloudflare/resources/radar/leaked_credentials/summary.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -47,21 +48,24 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: """ return SummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead." + ) def bot_class( self, *, - compromised: List[Literal["CLEAN", "COMPROMISED"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + compromised: List[Literal["CLEAN", "COMPROMISED"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryBotClassResponse: """ Retrieves the distribution of HTTP authentication requests by bot class. @@ -112,21 +116,24 @@ def bot_class( cast_to=cast(Type[SummaryBotClassResponse], ResultWrapper[SummaryBotClassResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead." + ) def compromised( self, *, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryCompromisedResponse: """ Retrieves the distribution of HTTP authentication requests by compromised @@ -200,21 +207,24 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: """ return AsyncSummaryResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead." + ) async def bot_class( self, *, - compromised: List[Literal["CLEAN", "COMPROMISED"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + compromised: List[Literal["CLEAN", "COMPROMISED"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryBotClassResponse: """ Retrieves the distribution of HTTP authentication requests by bot class. @@ -265,21 +275,24 @@ async def bot_class( cast_to=cast(Type[SummaryBotClassResponse], ResultWrapper[SummaryBotClassResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Leaked Credentials Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/summary_v2/) instead." + ) async def compromised( self, *, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SummaryCompromisedResponse: """ Retrieves the distribution of HTTP authentication requests by compromised @@ -337,11 +350,15 @@ class SummaryResourceWithRawResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.bot_class = to_raw_response_wrapper( - summary.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.compromised = to_raw_response_wrapper( - summary.compromised, + self.compromised = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + summary.compromised, # pyright: ignore[reportDeprecated], + ) ) @@ -349,11 +366,15 @@ class AsyncSummaryResourceWithRawResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.bot_class = async_to_raw_response_wrapper( - summary.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.compromised = async_to_raw_response_wrapper( - summary.compromised, + self.compromised = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + summary.compromised, # pyright: ignore[reportDeprecated], + ) ) @@ -361,11 +382,15 @@ class SummaryResourceWithStreamingResponse: def __init__(self, summary: SummaryResource) -> None: self._summary = summary - self.bot_class = to_streamed_response_wrapper( - summary.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.compromised = to_streamed_response_wrapper( - summary.compromised, + self.compromised = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + summary.compromised, # pyright: ignore[reportDeprecated], + ) ) @@ -373,9 +398,13 @@ class AsyncSummaryResourceWithStreamingResponse: def __init__(self, summary: AsyncSummaryResource) -> None: self._summary = summary - self.bot_class = async_to_streamed_response_wrapper( - summary.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.compromised = async_to_streamed_response_wrapper( - summary.compromised, + self.compromised = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + summary.compromised, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/leaked_credentials/timeseries_groups.py b/src/cloudflare/resources/radar/leaked_credentials/timeseries_groups.py index 44ed7cfffbe..efc2df0c83f 100644 --- a/src/cloudflare/resources/radar/leaked_credentials/timeseries_groups.py +++ b/src/cloudflare/resources/radar/leaked_credentials/timeseries_groups.py @@ -2,13 +2,14 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -47,22 +48,25 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon """ return TimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead." + ) def bot_class( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - compromised: List[Literal["CLEAN", "COMPROMISED"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + compromised: List[Literal["CLEAN", "COMPROMISED"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupBotClassResponse: """ Retrieves the distribution of HTTP authentication requests by bot class over @@ -119,22 +123,25 @@ def bot_class( cast_to=cast(Type[TimeseriesGroupBotClassResponse], ResultWrapper[TimeseriesGroupBotClassResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead." + ) def compromised( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupCompromisedResponse: """ Retrieves the distribution of HTTP authentication requests by compromised @@ -213,22 +220,25 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR """ return AsyncTimeseriesGroupsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead." + ) async def bot_class( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - compromised: List[Literal["CLEAN", "COMPROMISED"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + compromised: List[Literal["CLEAN", "COMPROMISED"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupBotClassResponse: """ Retrieves the distribution of HTTP authentication requests by bot class over @@ -285,22 +295,25 @@ async def bot_class( cast_to=cast(Type[TimeseriesGroupBotClassResponse], ResultWrapper[TimeseriesGroupBotClassResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Leaked Credentials Timeseries Groups By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/leaked_credentials/methods/timeseries_groups_v2/) instead." + ) async def compromised( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupCompromisedResponse: """ Retrieves the distribution of HTTP authentication requests by compromised @@ -363,11 +376,15 @@ class TimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bot_class = to_raw_response_wrapper( - timeseries_groups.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.compromised = to_raw_response_wrapper( - timeseries_groups.compromised, + self.compromised = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + timeseries_groups.compromised, # pyright: ignore[reportDeprecated], + ) ) @@ -375,11 +392,15 @@ class AsyncTimeseriesGroupsResourceWithRawResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bot_class = async_to_raw_response_wrapper( - timeseries_groups.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.compromised = async_to_raw_response_wrapper( - timeseries_groups.compromised, + self.compromised = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + timeseries_groups.compromised, # pyright: ignore[reportDeprecated], + ) ) @@ -387,11 +408,15 @@ class TimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: TimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bot_class = to_streamed_response_wrapper( - timeseries_groups.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.compromised = to_streamed_response_wrapper( - timeseries_groups.compromised, + self.compromised = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + timeseries_groups.compromised, # pyright: ignore[reportDeprecated], + ) ) @@ -399,9 +424,13 @@ class AsyncTimeseriesGroupsResourceWithStreamingResponse: def __init__(self, timeseries_groups: AsyncTimeseriesGroupsResource) -> None: self._timeseries_groups = timeseries_groups - self.bot_class = async_to_streamed_response_wrapper( - timeseries_groups.bot_class, + self.bot_class = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.bot_class, # pyright: ignore[reportDeprecated], + ) ) - self.compromised = async_to_streamed_response_wrapper( - timeseries_groups.compromised, + self.compromised = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + timeseries_groups.compromised, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/radar/netflows/netflows.py b/src/cloudflare/resources/radar/netflows/netflows.py index 36d37590875..7a22667bc74 100644 --- a/src/cloudflare/resources/radar/netflows/netflows.py +++ b/src/cloudflare/resources/radar/netflows/netflows.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal @@ -16,7 +17,7 @@ TopResourceWithStreamingResponse, AsyncTopResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -27,10 +28,17 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....types.radar import netflow_summary_params, netflow_timeseries_params +from ....types.radar import ( + netflow_summary_params, + netflow_summary_v2_params, + netflow_timeseries_params, + netflow_timeseries_groups_params, +) from ...._base_client import make_request_options from ....types.radar.netflow_summary_response import NetflowSummaryResponse +from ....types.radar.netflow_summary_v2_response import NetflowSummaryV2Response from ....types.radar.netflow_timeseries_response import NetflowTimeseriesResponse +from ....types.radar.netflow_timeseries_groups_response import NetflowTimeseriesGroupsResponse __all__ = ["NetflowsResource", "AsyncNetflowsResource"] @@ -59,23 +67,27 @@ def with_streaming_response(self) -> NetflowsResourceWithStreamingResponse: """ return NetflowsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead." + ) def summary( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> NetflowSummaryResponse: """ Retrieves the distribution of network traffic (NetFlows) by HTTP vs other @@ -101,6 +113,11 @@ def summary( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude locations from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -130,6 +147,7 @@ def summary( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "location": location, "name": name, }, @@ -140,26 +158,130 @@ def summary( cast_to=cast(Type[NetflowSummaryResponse], ResultWrapper[NetflowSummaryResponse]), ) + def summary_v2( + self, + dimension: Literal["ADM1", "PRODUCT"], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + product: List[Literal["HTTP", "ALL"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NetflowSummaryV2Response: + """ + Retrieves the distribution of network traffic (NetFlows) by the specified + dimension. + + Args: + dimension: Specifies the NetFlows attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + product: Filters the results by network traffic product types. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/netflows/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "geo_id": geo_id, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "product": product, + }, + netflow_summary_v2_params.NetflowSummaryV2Params, + ), + post_parser=ResultWrapper[NetflowSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[NetflowSummaryV2Response], ResultWrapper[NetflowSummaryV2Response]), + ) + def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - product: List[Literal["HTTP", "ALL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + product: List[Literal["HTTP", "ALL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> NetflowTimeseriesResponse: """ Retrieves network traffic (NetFlows) over time. @@ -188,6 +310,11 @@ def timeseries( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude locations from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -223,6 +350,7 @@ def timeseries( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "location": location, "name": name, "normalization": normalization, @@ -235,6 +363,120 @@ def timeseries( cast_to=cast(Type[NetflowTimeseriesResponse], ResultWrapper[NetflowTimeseriesResponse]), ) + def timeseries_groups( + self, + dimension: Literal["ADM1", "PRODUCT"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + product: List[Literal["HTTP", "ALL"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NetflowTimeseriesGroupsResponse: + """ + Retrieves the distribution of NetFlows traffic, grouped by chosen the specified + dimension over time. + + Args: + dimension: Specifies the NetFlows attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + product: Filters the results by network traffic product types. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/netflows/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "geo_id": geo_id, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + "product": product, + }, + netflow_timeseries_groups_params.NetflowTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[NetflowTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[NetflowTimeseriesGroupsResponse], ResultWrapper[NetflowTimeseriesGroupsResponse]), + ) + class AsyncNetflowsResource(AsyncAPIResource): @cached_property @@ -260,23 +502,27 @@ def with_streaming_response(self) -> AsyncNetflowsResourceWithStreamingResponse: """ return AsyncNetflowsResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Get Network Traffic Distribution By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/netflows/methods/summary_v2/) instead." + ) async def summary( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> NetflowSummaryResponse: """ Retrieves the distribution of network traffic (NetFlows) by HTTP vs other @@ -302,6 +548,11 @@ async def summary( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude locations from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -331,6 +582,7 @@ async def summary( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "location": location, "name": name, }, @@ -341,26 +593,130 @@ async def summary( cast_to=cast(Type[NetflowSummaryResponse], ResultWrapper[NetflowSummaryResponse]), ) + async def summary_v2( + self, + dimension: Literal["ADM1", "PRODUCT"], + *, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + product: List[Literal["HTTP", "ALL"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NetflowSummaryV2Response: + """ + Retrieves the distribution of network traffic (NetFlows) by the specified + dimension. + + Args: + dimension: Specifies the NetFlows attribute by which to group the results. + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + product: Filters the results by network traffic product types. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/netflows/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "geo_id": geo_id, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "product": product, + }, + netflow_summary_v2_params.NetflowSummaryV2Params, + ), + post_parser=ResultWrapper[NetflowSummaryV2Response]._unwrapper, + ), + cast_to=cast(Type[NetflowSummaryV2Response], ResultWrapper[NetflowSummaryV2Response]), + ) + async def timeseries( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN, - product: List[Literal["HTTP", "ALL"]] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + product: List[Literal["HTTP", "ALL"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> NetflowTimeseriesResponse: """ Retrieves network traffic (NetFlows) over time. @@ -389,6 +745,11 @@ async def timeseries( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude locations from results. For example, `-US,PT` excludes results from the US, but includes results from PT. @@ -424,6 +785,7 @@ async def timeseries( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "location": location, "name": name, "normalization": normalization, @@ -436,17 +798,139 @@ async def timeseries( cast_to=cast(Type[NetflowTimeseriesResponse], ResultWrapper[NetflowTimeseriesResponse]), ) + async def timeseries_groups( + self, + dimension: Literal["ADM1", "PRODUCT"], + *, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + limit_per_group: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + product: List[Literal["HTTP", "ALL"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NetflowTimeseriesGroupsResponse: + """ + Retrieves the distribution of NetFlows traffic, grouped by chosen the specified + dimension over time. + + Args: + dimension: Specifies the NetFlows attribute by which to group the results. + + agg_interval: Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude continents from results. For example, `-EU,NA` + excludes results from EU, but includes results from NA. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + + limit_per_group: Limits the number of objects per group to the top items within the specified + time range. When item count exceeds the limit, extra items appear grouped under + an "other" category. + + location: Filters results by location. Specify a comma-separated list of alpha-2 codes. + Prefix with `-` to exclude locations from results. For example, `-US,PT` + excludes results from the US, but includes results from PT. + + name: Array of names used to label the series in the response. + + normalization: Normalization method applied to the results. Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + + product: Filters the results by network traffic product types. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/netflows/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agg_interval": agg_interval, + "asn": asn, + "continent": continent, + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "geo_id": geo_id, + "limit_per_group": limit_per_group, + "location": location, + "name": name, + "normalization": normalization, + "product": product, + }, + netflow_timeseries_groups_params.NetflowTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[NetflowTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[NetflowTimeseriesGroupsResponse], ResultWrapper[NetflowTimeseriesGroupsResponse]), + ) + class NetflowsResourceWithRawResponse: def __init__(self, netflows: NetflowsResource) -> None: self._netflows = netflows - self.summary = to_raw_response_wrapper( - netflows.summary, + self.summary = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + netflows.summary, # pyright: ignore[reportDeprecated], + ) + ) + self.summary_v2 = to_raw_response_wrapper( + netflows.summary_v2, ) self.timeseries = to_raw_response_wrapper( netflows.timeseries, ) + self.timeseries_groups = to_raw_response_wrapper( + netflows.timeseries_groups, + ) @cached_property def top(self) -> TopResourceWithRawResponse: @@ -457,12 +941,20 @@ class AsyncNetflowsResourceWithRawResponse: def __init__(self, netflows: AsyncNetflowsResource) -> None: self._netflows = netflows - self.summary = async_to_raw_response_wrapper( - netflows.summary, + self.summary = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + netflows.summary, # pyright: ignore[reportDeprecated], + ) + ) + self.summary_v2 = async_to_raw_response_wrapper( + netflows.summary_v2, ) self.timeseries = async_to_raw_response_wrapper( netflows.timeseries, ) + self.timeseries_groups = async_to_raw_response_wrapper( + netflows.timeseries_groups, + ) @cached_property def top(self) -> AsyncTopResourceWithRawResponse: @@ -473,12 +965,20 @@ class NetflowsResourceWithStreamingResponse: def __init__(self, netflows: NetflowsResource) -> None: self._netflows = netflows - self.summary = to_streamed_response_wrapper( - netflows.summary, + self.summary = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + netflows.summary, # pyright: ignore[reportDeprecated], + ) + ) + self.summary_v2 = to_streamed_response_wrapper( + netflows.summary_v2, ) self.timeseries = to_streamed_response_wrapper( netflows.timeseries, ) + self.timeseries_groups = to_streamed_response_wrapper( + netflows.timeseries_groups, + ) @cached_property def top(self) -> TopResourceWithStreamingResponse: @@ -489,12 +989,20 @@ class AsyncNetflowsResourceWithStreamingResponse: def __init__(self, netflows: AsyncNetflowsResource) -> None: self._netflows = netflows - self.summary = async_to_streamed_response_wrapper( - netflows.summary, + self.summary = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + netflows.summary, # pyright: ignore[reportDeprecated], + ) + ) + self.summary_v2 = async_to_streamed_response_wrapper( + netflows.summary_v2, ) self.timeseries = async_to_streamed_response_wrapper( netflows.timeseries, ) + self.timeseries_groups = async_to_streamed_response_wrapper( + netflows.timeseries_groups, + ) @cached_property def top(self) -> AsyncTopResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/radar/netflows/top.py b/src/cloudflare/resources/radar/netflows/top.py index c58b13cbb99..467898134c8 100644 --- a/src/cloudflare/resources/radar/netflows/top.py +++ b/src/cloudflare/resources/radar/netflows/top.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,21 +50,22 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse: def ases( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopAsesResponse: """ Retrieves the top autonomous systems by network traffic (NetFlows). @@ -89,6 +90,11 @@ def ases( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + limit: Limits the number of objects returned in the response. location: Filters results by location. Specify a comma-separated list of alpha-2 codes. @@ -120,6 +126,7 @@ def ases( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "limit": limit, "location": location, "name": name, @@ -134,21 +141,22 @@ def ases( def locations( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopLocationsResponse: """ Retrieves the top locations by network traffic (NetFlows). @@ -173,6 +181,11 @@ def locations( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + limit: Limits the number of objects returned in the response. location: Filters results by location. Specify a comma-separated list of alpha-2 codes. @@ -204,6 +217,7 @@ def locations( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "limit": limit, "location": location, "name": name, @@ -239,21 +253,22 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: async def ases( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopAsesResponse: """ Retrieves the top autonomous systems by network traffic (NetFlows). @@ -278,6 +293,11 @@ async def ases( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + limit: Limits the number of objects returned in the response. location: Filters results by location. Specify a comma-separated list of alpha-2 codes. @@ -309,6 +329,7 @@ async def ases( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "limit": limit, "location": location, "name": name, @@ -323,21 +344,22 @@ async def ases( async def locations( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + geo_id: SequenceNotStr[str] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopLocationsResponse: """ Retrieves the top locations by network traffic (NetFlows). @@ -362,6 +384,11 @@ async def locations( format: Format in which results will be returned. + geo_id: Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + excludes results from the 2267056 (Lisbon), but includes results from 5128638 + (New York). + limit: Limits the number of objects returned in the response. location: Filters results by location. Specify a comma-separated list of alpha-2 codes. @@ -393,6 +420,7 @@ async def locations( "date_range": date_range, "date_start": date_start, "format": format, + "geo_id": geo_id, "limit": limit, "location": location, "name": name, diff --git a/src/cloudflare/resources/radar/quality/iqi.py b/src/cloudflare/resources/radar/quality/iqi.py index 72bbe9a14d6..c5a89636de4 100644 --- a/src/cloudflare/resources/radar/quality/iqi.py +++ b/src/cloudflare/resources/radar/quality/iqi.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,20 +51,20 @@ def summary( self, *, metric: Literal["BANDWIDTH", "DNS", "LATENCY"], - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IQISummaryResponse: """ Retrieves a summary (percentiles) of bandwidth, latency, or DNS response time @@ -136,22 +136,22 @@ def timeseries_groups( self, *, metric: Literal["BANDWIDTH", "DNS", "LATENCY"], - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - interpolation: bool | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + interpolation: bool | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IQITimeseriesGroupsResponse: """ Retrieves a time series (percentiles) of bandwidth, latency, or DNS response @@ -252,20 +252,20 @@ async def summary( self, *, metric: Literal["BANDWIDTH", "DNS", "LATENCY"], - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IQISummaryResponse: """ Retrieves a summary (percentiles) of bandwidth, latency, or DNS response time @@ -337,22 +337,22 @@ async def timeseries_groups( self, *, metric: Literal["BANDWIDTH", "DNS", "LATENCY"], - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - interpolation: bool | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + interpolation: bool | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IQITimeseriesGroupsResponse: """ Retrieves a time series (percentiles) of bandwidth, latency, or DNS response diff --git a/src/cloudflare/resources/radar/quality/speed/speed.py b/src/cloudflare/resources/radar/quality/speed/speed.py index 538c08df835..e3b27dfbb45 100644 --- a/src/cloudflare/resources/radar/quality/speed/speed.py +++ b/src/cloudflare/resources/radar/quality/speed/speed.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal @@ -16,7 +16,7 @@ TopResourceWithStreamingResponse, AsyncTopResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -62,20 +62,20 @@ def with_streaming_response(self) -> SpeedResourceWithStreamingResponse: def histogram( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bucket_size: int | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - metric_group: Literal["BANDWIDTH", "LATENCY", "JITTER"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bucket_size: int | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + metric_group: Literal["BANDWIDTH", "LATENCY", "JITTER"] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SpeedHistogramResponse: """ Retrieves a histogram from the previous 90 days of Cloudflare Speed Test data, @@ -141,18 +141,18 @@ def histogram( def summary( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SpeedSummaryResponse: """ Retrieves a summary of bandwidth, latency, jitter, and packet loss, from the @@ -237,20 +237,20 @@ def with_streaming_response(self) -> AsyncSpeedResourceWithStreamingResponse: async def histogram( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - bucket_size: int | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - metric_group: Literal["BANDWIDTH", "LATENCY", "JITTER"] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + bucket_size: int | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + metric_group: Literal["BANDWIDTH", "LATENCY", "JITTER"] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SpeedHistogramResponse: """ Retrieves a histogram from the previous 90 days of Cloudflare Speed Test data, @@ -316,18 +316,18 @@ async def histogram( async def summary( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SpeedSummaryResponse: """ Retrieves a summary of bandwidth, latency, jitter, and packet loss, from the diff --git a/src/cloudflare/resources/radar/quality/speed/top.py b/src/cloudflare/resources/radar/quality/speed/top.py index dee7fd7ce5f..6827dc62b1f 100644 --- a/src/cloudflare/resources/radar/quality/speed/top.py +++ b/src/cloudflare/resources/radar/quality/speed/top.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,24 +50,24 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse: def ases( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, order_by: Literal[ "BANDWIDTH_DOWNLOAD", "BANDWIDTH_UPLOAD", "LATENCY_IDLE", "LATENCY_LOADED", "JITTER_IDLE", "JITTER_LOADED" ] - | NotGiven = NOT_GIVEN, - reverse: bool | NotGiven = NOT_GIVEN, + | Omit = omit, + reverse: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopAsesResponse: """ Retrieves the top autonomous systems by bandwidth, latency, jitter, or packet @@ -136,24 +136,24 @@ def ases( def locations( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, order_by: Literal[ "BANDWIDTH_DOWNLOAD", "BANDWIDTH_UPLOAD", "LATENCY_IDLE", "LATENCY_LOADED", "JITTER_IDLE", "JITTER_LOADED" ] - | NotGiven = NOT_GIVEN, - reverse: bool | NotGiven = NOT_GIVEN, + | Omit = omit, + reverse: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopLocationsResponse: """ Retrieves the top locations by bandwidth, latency, jitter, or packet loss, from @@ -243,24 +243,24 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: async def ases( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, order_by: Literal[ "BANDWIDTH_DOWNLOAD", "BANDWIDTH_UPLOAD", "LATENCY_IDLE", "LATENCY_LOADED", "JITTER_IDLE", "JITTER_LOADED" ] - | NotGiven = NOT_GIVEN, - reverse: bool | NotGiven = NOT_GIVEN, + | Omit = omit, + reverse: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopAsesResponse: """ Retrieves the top autonomous systems by bandwidth, latency, jitter, or packet @@ -329,24 +329,24 @@ async def ases( async def locations( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, order_by: Literal[ "BANDWIDTH_DOWNLOAD", "BANDWIDTH_UPLOAD", "LATENCY_IDLE", "LATENCY_LOADED", "JITTER_IDLE", "JITTER_LOADED" ] - | NotGiven = NOT_GIVEN, - reverse: bool | NotGiven = NOT_GIVEN, + | Omit = omit, + reverse: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopLocationsResponse: """ Retrieves the top locations by bandwidth, latency, jitter, or packet loss, from diff --git a/src/cloudflare/resources/radar/radar.py b/src/cloudflare/resources/radar/radar.py index 7242f18dd38..e48327663a6 100644 --- a/src/cloudflare/resources/radar/radar.py +++ b/src/cloudflare/resources/radar/radar.py @@ -10,6 +10,14 @@ AIResourceWithStreamingResponse, AsyncAIResourceWithStreamingResponse, ) +from .ct.ct import ( + CtResource, + AsyncCtResource, + CtResourceWithRawResponse, + AsyncCtResourceWithRawResponse, + CtResourceWithStreamingResponse, + AsyncCtResourceWithStreamingResponse, +) from .search import ( SearchResource, AsyncSearchResource, @@ -43,6 +51,14 @@ AsyncDatasetsResourceWithStreamingResponse, ) from ..._compat import cached_property +from .bots.bots import ( + BotsResource, + AsyncBotsResource, + BotsResourceWithRawResponse, + AsyncBotsResourceWithRawResponse, + BotsResourceWithStreamingResponse, + AsyncBotsResourceWithStreamingResponse, +) from .http.http import ( HTTPResource, AsyncHTTPResource, @@ -68,6 +84,14 @@ EmailResourceWithStreamingResponse, AsyncEmailResourceWithStreamingResponse, ) +from .geolocations import ( + GeolocationsResource, + AsyncGeolocationsResource, + GeolocationsResourceWithRawResponse, + AsyncGeolocationsResourceWithRawResponse, + GeolocationsResourceWithStreamingResponse, + AsyncGeolocationsResourceWithStreamingResponse, +) from .attacks.attacks import ( AttacksResource, AsyncAttacksResource, @@ -165,6 +189,10 @@ class RadarResource(SyncAPIResource): def ai(self) -> AIResource: return AIResource(self._client) + @cached_property + def ct(self) -> CtResource: + return CtResource(self._client) + @cached_property def annotations(self) -> AnnotationsResource: return AnnotationsResource(self._client) @@ -173,6 +201,10 @@ def annotations(self) -> AnnotationsResource: def bgp(self) -> BGPResource: return BGPResource(self._client) + @cached_property + def bots(self) -> BotsResource: + return BotsResource(self._client) + @cached_property def datasets(self) -> DatasetsResource: return DatasetsResource(self._client) @@ -209,6 +241,10 @@ def attacks(self) -> AttacksResource: def entities(self) -> EntitiesResource: return EntitiesResource(self._client) + @cached_property + def geolocations(self) -> GeolocationsResource: + return GeolocationsResource(self._client) + @cached_property def http(self) -> HTTPResource: return HTTPResource(self._client) @@ -262,6 +298,10 @@ class AsyncRadarResource(AsyncAPIResource): def ai(self) -> AsyncAIResource: return AsyncAIResource(self._client) + @cached_property + def ct(self) -> AsyncCtResource: + return AsyncCtResource(self._client) + @cached_property def annotations(self) -> AsyncAnnotationsResource: return AsyncAnnotationsResource(self._client) @@ -270,6 +310,10 @@ def annotations(self) -> AsyncAnnotationsResource: def bgp(self) -> AsyncBGPResource: return AsyncBGPResource(self._client) + @cached_property + def bots(self) -> AsyncBotsResource: + return AsyncBotsResource(self._client) + @cached_property def datasets(self) -> AsyncDatasetsResource: return AsyncDatasetsResource(self._client) @@ -306,6 +350,10 @@ def attacks(self) -> AsyncAttacksResource: def entities(self) -> AsyncEntitiesResource: return AsyncEntitiesResource(self._client) + @cached_property + def geolocations(self) -> AsyncGeolocationsResource: + return AsyncGeolocationsResource(self._client) + @cached_property def http(self) -> AsyncHTTPResource: return AsyncHTTPResource(self._client) @@ -362,6 +410,10 @@ def __init__(self, radar: RadarResource) -> None: def ai(self) -> AIResourceWithRawResponse: return AIResourceWithRawResponse(self._radar.ai) + @cached_property + def ct(self) -> CtResourceWithRawResponse: + return CtResourceWithRawResponse(self._radar.ct) + @cached_property def annotations(self) -> AnnotationsResourceWithRawResponse: return AnnotationsResourceWithRawResponse(self._radar.annotations) @@ -370,6 +422,10 @@ def annotations(self) -> AnnotationsResourceWithRawResponse: def bgp(self) -> BGPResourceWithRawResponse: return BGPResourceWithRawResponse(self._radar.bgp) + @cached_property + def bots(self) -> BotsResourceWithRawResponse: + return BotsResourceWithRawResponse(self._radar.bots) + @cached_property def datasets(self) -> DatasetsResourceWithRawResponse: return DatasetsResourceWithRawResponse(self._radar.datasets) @@ -406,6 +462,10 @@ def attacks(self) -> AttacksResourceWithRawResponse: def entities(self) -> EntitiesResourceWithRawResponse: return EntitiesResourceWithRawResponse(self._radar.entities) + @cached_property + def geolocations(self) -> GeolocationsResourceWithRawResponse: + return GeolocationsResourceWithRawResponse(self._radar.geolocations) + @cached_property def http(self) -> HTTPResourceWithRawResponse: return HTTPResourceWithRawResponse(self._radar.http) @@ -443,6 +503,10 @@ def __init__(self, radar: AsyncRadarResource) -> None: def ai(self) -> AsyncAIResourceWithRawResponse: return AsyncAIResourceWithRawResponse(self._radar.ai) + @cached_property + def ct(self) -> AsyncCtResourceWithRawResponse: + return AsyncCtResourceWithRawResponse(self._radar.ct) + @cached_property def annotations(self) -> AsyncAnnotationsResourceWithRawResponse: return AsyncAnnotationsResourceWithRawResponse(self._radar.annotations) @@ -451,6 +515,10 @@ def annotations(self) -> AsyncAnnotationsResourceWithRawResponse: def bgp(self) -> AsyncBGPResourceWithRawResponse: return AsyncBGPResourceWithRawResponse(self._radar.bgp) + @cached_property + def bots(self) -> AsyncBotsResourceWithRawResponse: + return AsyncBotsResourceWithRawResponse(self._radar.bots) + @cached_property def datasets(self) -> AsyncDatasetsResourceWithRawResponse: return AsyncDatasetsResourceWithRawResponse(self._radar.datasets) @@ -487,6 +555,10 @@ def attacks(self) -> AsyncAttacksResourceWithRawResponse: def entities(self) -> AsyncEntitiesResourceWithRawResponse: return AsyncEntitiesResourceWithRawResponse(self._radar.entities) + @cached_property + def geolocations(self) -> AsyncGeolocationsResourceWithRawResponse: + return AsyncGeolocationsResourceWithRawResponse(self._radar.geolocations) + @cached_property def http(self) -> AsyncHTTPResourceWithRawResponse: return AsyncHTTPResourceWithRawResponse(self._radar.http) @@ -524,6 +596,10 @@ def __init__(self, radar: RadarResource) -> None: def ai(self) -> AIResourceWithStreamingResponse: return AIResourceWithStreamingResponse(self._radar.ai) + @cached_property + def ct(self) -> CtResourceWithStreamingResponse: + return CtResourceWithStreamingResponse(self._radar.ct) + @cached_property def annotations(self) -> AnnotationsResourceWithStreamingResponse: return AnnotationsResourceWithStreamingResponse(self._radar.annotations) @@ -532,6 +608,10 @@ def annotations(self) -> AnnotationsResourceWithStreamingResponse: def bgp(self) -> BGPResourceWithStreamingResponse: return BGPResourceWithStreamingResponse(self._radar.bgp) + @cached_property + def bots(self) -> BotsResourceWithStreamingResponse: + return BotsResourceWithStreamingResponse(self._radar.bots) + @cached_property def datasets(self) -> DatasetsResourceWithStreamingResponse: return DatasetsResourceWithStreamingResponse(self._radar.datasets) @@ -568,6 +648,10 @@ def attacks(self) -> AttacksResourceWithStreamingResponse: def entities(self) -> EntitiesResourceWithStreamingResponse: return EntitiesResourceWithStreamingResponse(self._radar.entities) + @cached_property + def geolocations(self) -> GeolocationsResourceWithStreamingResponse: + return GeolocationsResourceWithStreamingResponse(self._radar.geolocations) + @cached_property def http(self) -> HTTPResourceWithStreamingResponse: return HTTPResourceWithStreamingResponse(self._radar.http) @@ -605,6 +689,10 @@ def __init__(self, radar: AsyncRadarResource) -> None: def ai(self) -> AsyncAIResourceWithStreamingResponse: return AsyncAIResourceWithStreamingResponse(self._radar.ai) + @cached_property + def ct(self) -> AsyncCtResourceWithStreamingResponse: + return AsyncCtResourceWithStreamingResponse(self._radar.ct) + @cached_property def annotations(self) -> AsyncAnnotationsResourceWithStreamingResponse: return AsyncAnnotationsResourceWithStreamingResponse(self._radar.annotations) @@ -613,6 +701,10 @@ def annotations(self) -> AsyncAnnotationsResourceWithStreamingResponse: def bgp(self) -> AsyncBGPResourceWithStreamingResponse: return AsyncBGPResourceWithStreamingResponse(self._radar.bgp) + @cached_property + def bots(self) -> AsyncBotsResourceWithStreamingResponse: + return AsyncBotsResourceWithStreamingResponse(self._radar.bots) + @cached_property def datasets(self) -> AsyncDatasetsResourceWithStreamingResponse: return AsyncDatasetsResourceWithStreamingResponse(self._radar.datasets) @@ -649,6 +741,10 @@ def attacks(self) -> AsyncAttacksResourceWithStreamingResponse: def entities(self) -> AsyncEntitiesResourceWithStreamingResponse: return AsyncEntitiesResourceWithStreamingResponse(self._radar.entities) + @cached_property + def geolocations(self) -> AsyncGeolocationsResourceWithStreamingResponse: + return AsyncGeolocationsResourceWithStreamingResponse(self._radar.geolocations) + @cached_property def http(self) -> AsyncHTTPResourceWithStreamingResponse: return AsyncHTTPResourceWithStreamingResponse(self._radar.http) diff --git a/src/cloudflare/resources/radar/ranking/domain.py b/src/cloudflare/resources/radar/ranking/domain.py index ea9e2adc103..7ec008fe5ec 100644 --- a/src/cloudflare/resources/radar/ranking/domain.py +++ b/src/cloudflare/resources/radar/ranking/domain.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import date from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,18 +50,18 @@ def get( self, domain: str, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - include_top_locations: bool | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + include_top_locations: bool | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainGetResponse: """Retrieves domain rank details. @@ -143,18 +143,18 @@ async def get( self, domain: str, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - include_top_locations: bool | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + include_top_locations: bool | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainGetResponse: """Retrieves domain rank details. diff --git a/src/cloudflare/resources/radar/ranking/internet_services.py b/src/cloudflare/resources/radar/ranking/internet_services.py index 8558f402676..577ff274502 100644 --- a/src/cloudflare/resources/radar/ranking/internet_services.py +++ b/src/cloudflare/resources/radar/ranking/internet_services.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import date, datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,16 +55,16 @@ def with_streaming_response(self) -> InternetServicesResourceWithStreamingRespon def categories( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InternetServiceCategoriesResponse: """ Retrieves the list of Internet services categories. @@ -110,19 +110,19 @@ def categories( def timeseries_groups( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - service_category: List[str] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + service_category: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InternetServiceTimeseriesGroupsResponse: """ Retrieves Internet Services rank update changes over time. @@ -181,17 +181,17 @@ def timeseries_groups( def top( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - service_category: List[str] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + service_category: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InternetServiceTopResponse: """ Retrieves top Internet services based on their rank. @@ -261,16 +261,16 @@ def with_streaming_response(self) -> AsyncInternetServicesResourceWithStreamingR async def categories( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InternetServiceCategoriesResponse: """ Retrieves the list of Internet services categories. @@ -316,19 +316,19 @@ async def categories( async def timeseries_groups( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - service_category: List[str] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + service_category: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InternetServiceTimeseriesGroupsResponse: """ Retrieves Internet Services rank update changes over time. @@ -387,17 +387,17 @@ async def timeseries_groups( async def top( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - service_category: List[str] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + service_category: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InternetServiceTopResponse: """ Retrieves top Internet services based on their rank. diff --git a/src/cloudflare/resources/radar/ranking/ranking.py b/src/cloudflare/resources/radar/ranking/ranking.py index 1bf39f2d907..2ff2768f9f7 100644 --- a/src/cloudflare/resources/radar/ranking/ranking.py +++ b/src/cloudflare/resources/radar/ranking/ranking.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import date, datetime from typing_extensions import Literal @@ -16,7 +16,7 @@ DomainResourceWithStreamingResponse, AsyncDomainResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -74,22 +74,22 @@ def with_streaming_response(self) -> RankingResourceWithStreamingResponse: def timeseries_groups( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - domain_category: List[str] | NotGiven = NOT_GIVEN, - domains: List[str] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + domain_category: SequenceNotStr[str] | Omit = omit, + domains: SequenceNotStr[str] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RankingTimeseriesGroupsResponse: """ Retrieves domains rank over time. @@ -156,19 +156,19 @@ def timeseries_groups( def top( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - domain_category: List[str] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + domain_category: SequenceNotStr[str] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RankingTopResponse: """Retrieves the top or trending domains based on their rank. @@ -257,22 +257,22 @@ def with_streaming_response(self) -> AsyncRankingResourceWithStreamingResponse: async def timeseries_groups( self, *, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - domain_category: List[str] | NotGiven = NOT_GIVEN, - domains: List[str] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | NotGiven = NOT_GIVEN, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + domain_category: SequenceNotStr[str] | Omit = omit, + domains: SequenceNotStr[str] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RankingTimeseriesGroupsResponse: """ Retrieves domains rank over time. @@ -339,19 +339,19 @@ async def timeseries_groups( async def top( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - domain_category: List[str] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + domain_category: SequenceNotStr[str] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + ranking_type: Literal["POPULAR", "TRENDING_RISE", "TRENDING_STEADY"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RankingTopResponse: """Retrieves the top or trending domains based on their rank. diff --git a/src/cloudflare/resources/radar/robots_txt/top/top.py b/src/cloudflare/resources/radar/robots_txt/top/top.py index 91d261f35ee..d8aeb803a8d 100644 --- a/src/cloudflare/resources/radar/robots_txt/top/top.py +++ b/src/cloudflare/resources/radar/robots_txt/top/top.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import date from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .user_agents import ( @@ -61,17 +61,17 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse: def domain_categories( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - user_agent_category: Literal["AI"] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + user_agent_category: Literal["AI"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopDomainCategoriesResponse: """ Retrieves the top domain categories by the number of robots.txt files parsed. @@ -145,17 +145,17 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: async def domain_categories( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - user_agent_category: Literal["AI"] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + user_agent_category: Literal["AI"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopDomainCategoriesResponse: """ Retrieves the top domain categories by the number of robots.txt files parsed. diff --git a/src/cloudflare/resources/radar/robots_txt/top/user_agents.py b/src/cloudflare/resources/radar/robots_txt/top/user_agents.py index ba0e8558dcc..aa7b368669b 100644 --- a/src/cloudflare/resources/radar/robots_txt/top/user_agents.py +++ b/src/cloudflare/resources/radar/robots_txt/top/user_agents.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import date from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,19 +49,19 @@ def with_streaming_response(self) -> UserAgentsResourceWithStreamingResponse: def directive( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - directive: Literal["ALLOW", "DISALLOW"] | NotGiven = NOT_GIVEN, - domain_category: List[str] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - user_agent_category: Literal["AI"] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + directive: Literal["ALLOW", "DISALLOW"] | Omit = omit, + domain_category: SequenceNotStr[str] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + user_agent_category: Literal["AI"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UserAgentDirectiveResponse: """ Retrieves the top user agents on robots.txt files. @@ -137,19 +137,19 @@ def with_streaming_response(self) -> AsyncUserAgentsResourceWithStreamingRespons async def directive( self, *, - date: List[Union[str, date]] | NotGiven = NOT_GIVEN, - directive: Literal["ALLOW", "DISALLOW"] | NotGiven = NOT_GIVEN, - domain_category: List[str] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, - user_agent_category: Literal["AI"] | NotGiven = NOT_GIVEN, + date: SequenceNotStr[Union[str, date]] | Omit = omit, + directive: Literal["ALLOW", "DISALLOW"] | Omit = omit, + domain_category: SequenceNotStr[str] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + name: SequenceNotStr[str] | Omit = omit, + user_agent_category: Literal["AI"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UserAgentDirectiveResponse: """ Retrieves the top user agents on robots.txt files. diff --git a/src/cloudflare/resources/radar/search.py b/src/cloudflare/resources/radar/search.py index a1e32a7d272..4d15a3e8477 100644 --- a/src/cloudflare/resources/radar/search.py +++ b/src/cloudflare/resources/radar/search.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,23 +49,52 @@ def global_( self, *, query: str, - exclude: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - include: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - limit_per_group: float | NotGiven = NOT_GIVEN, + exclude: List[ + Literal[ + "ADM1S", + "ASNS", + "BOTS", + "CERTIFICATE_AUTHORITIES", + "CERTIFICATE_LOGS", + "INDUSTRIES", + "LOCATIONS", + "NOTEBOOKS", + "TLDS", + "VERTICALS", + ] + ] + | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + include: List[ + Literal[ + "ADM1S", + "ASNS", + "BOTS", + "CERTIFICATE_AUTHORITIES", + "CERTIFICATE_LOGS", + "INDUSTRIES", + "LOCATIONS", + "NOTEBOOKS", + "TLDS", + "VERTICALS", + ] + ] + | Omit = omit, + limit: int | Omit = omit, + limit_per_group: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SearchGlobalResponse: """ - Searches for locations, autonomous systems, and reports. + Searches for locations, autonomous systems, reports, bots, certificate logs, + certificate authorities, industries and verticals Args: - query: Search for locations, autonomous systems and reports. + query: String used to perform the search operation. exclude: Search types excluded from results. @@ -133,23 +162,52 @@ async def global_( self, *, query: str, - exclude: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - include: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - limit_per_group: float | NotGiven = NOT_GIVEN, + exclude: List[ + Literal[ + "ADM1S", + "ASNS", + "BOTS", + "CERTIFICATE_AUTHORITIES", + "CERTIFICATE_LOGS", + "INDUSTRIES", + "LOCATIONS", + "NOTEBOOKS", + "TLDS", + "VERTICALS", + ] + ] + | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + include: List[ + Literal[ + "ADM1S", + "ASNS", + "BOTS", + "CERTIFICATE_AUTHORITIES", + "CERTIFICATE_LOGS", + "INDUSTRIES", + "LOCATIONS", + "NOTEBOOKS", + "TLDS", + "VERTICALS", + ] + ] + | Omit = omit, + limit: int | Omit = omit, + limit_per_group: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SearchGlobalResponse: """ - Searches for locations, autonomous systems, and reports. + Searches for locations, autonomous systems, reports, bots, certificate logs, + certificate authorities, industries and verticals Args: - query: Search for locations, autonomous systems and reports. + query: String used to perform the search operation. exclude: Search types excluded from results. diff --git a/src/cloudflare/resources/radar/tcp_resets_timeouts.py b/src/cloudflare/resources/radar/tcp_resets_timeouts.py index 7620b03d366..9dd77daf74b 100644 --- a/src/cloudflare/resources/radar/tcp_resets_timeouts.py +++ b/src/cloudflare/resources/radar/tcp_resets_timeouts.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Union, cast +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,20 +50,20 @@ def with_streaming_response(self) -> TCPResetsTimeoutsResourceWithStreamingRespo def summary( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TCPResetsTimeoutSummaryResponse: """ Retrieves the distribution of connection stage by TCP connections terminated @@ -131,21 +131,21 @@ def summary( def timeseries_groups( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TCPResetsTimeoutTimeseriesGroupsResponse: """ Retrieves the distribution of connection stage by TCP connections terminated @@ -241,20 +241,20 @@ def with_streaming_response(self) -> AsyncTCPResetsTimeoutsResourceWithStreaming async def summary( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TCPResetsTimeoutSummaryResponse: """ Retrieves the distribution of connection stage by TCP connections terminated @@ -322,21 +322,21 @@ async def summary( async def timeseries_groups( self, *, - agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TCPResetsTimeoutTimeseriesGroupsResponse: """ Retrieves the distribution of connection stage by TCP connections terminated diff --git a/src/cloudflare/resources/radar/traffic_anomalies/locations.py b/src/cloudflare/resources/radar/traffic_anomalies/locations.py index 6722546ad4a..737d8fe8d60 100644 --- a/src/cloudflare/resources/radar/traffic_anomalies/locations.py +++ b/src/cloudflare/resources/radar/traffic_anomalies/locations.py @@ -8,7 +8,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,18 +49,18 @@ def with_streaming_response(self) -> LocationsResourceWithStreamingResponse: def get( self, *, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - status: Literal["VERIFIED", "UNVERIFIED"] | NotGiven = NOT_GIVEN, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + status: Literal["VERIFIED", "UNVERIFIED"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationGetResponse: """Retrieves the sum of Internet traffic anomalies, grouped by location. @@ -134,18 +134,18 @@ def with_streaming_response(self) -> AsyncLocationsResourceWithStreamingResponse async def get( self, *, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - status: Literal["VERIFIED", "UNVERIFIED"] | NotGiven = NOT_GIVEN, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + status: Literal["VERIFIED", "UNVERIFIED"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LocationGetResponse: """Retrieves the sum of Internet traffic anomalies, grouped by location. diff --git a/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py b/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py index 1b36df9507e..001beb8b7ff 100644 --- a/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py +++ b/src/cloudflare/resources/radar/traffic_anomalies/traffic_anomalies.py @@ -8,7 +8,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from .locations import ( LocationsResource, @@ -61,21 +61,21 @@ def with_streaming_response(self) -> TrafficAnomaliesResourceWithStreamingRespon def get( self, *, - asn: int | NotGiven = NOT_GIVEN, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - status: Literal["VERIFIED", "UNVERIFIED"] | NotGiven = NOT_GIVEN, + asn: int | Omit = omit, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | Omit = omit, + offset: int | Omit = omit, + status: Literal["VERIFIED", "UNVERIFIED"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrafficAnomalyGetResponse: """ Retrieves the latest Internet traffic anomalies, which are signals that might @@ -162,21 +162,21 @@ def with_streaming_response(self) -> AsyncTrafficAnomaliesResourceWithStreamingR async def get( self, *, - asn: int | NotGiven = NOT_GIVEN, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_range: str | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: str | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - status: Literal["VERIFIED", "UNVERIFIED"] | NotGiven = NOT_GIVEN, + asn: int | Omit = omit, + date_end: Union[str, datetime] | Omit = omit, + date_range: str | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | Omit = omit, + offset: int | Omit = omit, + status: Literal["VERIFIED", "UNVERIFIED"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrafficAnomalyGetResponse: """ Retrieves the latest Internet traffic anomalies, which are signals that might diff --git a/src/cloudflare/resources/radar/verified_bots/top.py b/src/cloudflare/resources/radar/verified_bots/top.py index 1a56c1d62c9..8e3fb21aca5 100644 --- a/src/cloudflare/resources/radar/verified_bots/top.py +++ b/src/cloudflare/resources/radar/verified_bots/top.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List, Type, Union, cast +import typing_extensions +from typing import Type, Union, cast from datetime import datetime from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -47,24 +48,27 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse: """ return TopResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Bots API](https://developers.cloudflare.com/api/resources/radar/subresources/bots/) instead." + ) def bots( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopBotsResponse: """ Retrieves the top verified bots by HTTP requests, with owner and category. @@ -131,24 +135,27 @@ def bots( cast_to=cast(Type[TopBotsResponse], ResultWrapper[TopBotsResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Bots API](https://developers.cloudflare.com/api/resources/radar/subresources/bots/) instead." + ) def categories( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopCategoriesResponse: """ Retrieves the top verified bot categories by HTTP requests, along with their @@ -237,24 +244,27 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse: """ return AsyncTopResourceWithStreamingResponse(self) + @typing_extensions.deprecated( + "Use [Radar Bots API](https://developers.cloudflare.com/api/resources/radar/subresources/bots/) instead." + ) async def bots( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopBotsResponse: """ Retrieves the top verified bots by HTTP requests, with owner and category. @@ -321,24 +331,27 @@ async def bots( cast_to=cast(Type[TopBotsResponse], ResultWrapper[TopBotsResponse]), ) + @typing_extensions.deprecated( + "Use [Radar Bots API](https://developers.cloudflare.com/api/resources/radar/subresources/bots/) instead." + ) async def categories( self, *, - asn: List[str] | NotGiven = NOT_GIVEN, - continent: List[str] | NotGiven = NOT_GIVEN, - date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - date_range: List[str] | NotGiven = NOT_GIVEN, - date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN, - format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - location: List[str] | NotGiven = NOT_GIVEN, - name: List[str] | NotGiven = NOT_GIVEN, + asn: SequenceNotStr[str] | Omit = omit, + continent: SequenceNotStr[str] | Omit = omit, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: SequenceNotStr[str] | Omit = omit, + name: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TopCategoriesResponse: """ Retrieves the top verified bot categories by HTTP requests, along with their @@ -411,11 +424,15 @@ class TopResourceWithRawResponse: def __init__(self, top: TopResource) -> None: self._top = top - self.bots = to_raw_response_wrapper( - top.bots, + self.bots = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + top.bots, # pyright: ignore[reportDeprecated], + ) ) - self.categories = to_raw_response_wrapper( - top.categories, + self.categories = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + top.categories, # pyright: ignore[reportDeprecated], + ) ) @@ -423,11 +440,15 @@ class AsyncTopResourceWithRawResponse: def __init__(self, top: AsyncTopResource) -> None: self._top = top - self.bots = async_to_raw_response_wrapper( - top.bots, + self.bots = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + top.bots, # pyright: ignore[reportDeprecated], + ) ) - self.categories = async_to_raw_response_wrapper( - top.categories, + self.categories = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + top.categories, # pyright: ignore[reportDeprecated], + ) ) @@ -435,11 +456,15 @@ class TopResourceWithStreamingResponse: def __init__(self, top: TopResource) -> None: self._top = top - self.bots = to_streamed_response_wrapper( - top.bots, + self.bots = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + top.bots, # pyright: ignore[reportDeprecated], + ) ) - self.categories = to_streamed_response_wrapper( - top.categories, + self.categories = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + top.categories, # pyright: ignore[reportDeprecated], + ) ) @@ -447,9 +472,13 @@ class AsyncTopResourceWithStreamingResponse: def __init__(self, top: AsyncTopResource) -> None: self._top = top - self.bots = async_to_streamed_response_wrapper( - top.bots, + self.bots = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + top.bots, # pyright: ignore[reportDeprecated], + ) ) - self.categories = async_to_streamed_response_wrapper( - top.categories, + self.categories = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + top.categories, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/rate_limits.py b/src/cloudflare/resources/rate_limits.py index fff377dde6f..31110953cfa 100644 --- a/src/cloudflare/resources/rate_limits.py +++ b/src/cloudflare/resources/rate_limits.py @@ -7,7 +7,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -63,7 +63,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RateLimit: """Creates a new rate limit for a zone. @@ -123,14 +123,14 @@ def list( self, *, zone_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[RateLimit]: """ Fetches the rate limits for a zone. @@ -185,7 +185,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RateLimitDeleteResponse: """ Deletes an existing rate limit. @@ -236,7 +236,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RateLimit: """ Updates an existing rate limit. @@ -304,7 +304,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RateLimit: """ Fetches the details of a rate limit. @@ -375,7 +375,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RateLimit: """Creates a new rate limit for a zone. @@ -435,14 +435,14 @@ def list( self, *, zone_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RateLimit, AsyncV4PagePaginationArray[RateLimit]]: """ Fetches the rate limits for a zone. @@ -497,7 +497,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RateLimitDeleteResponse: """ Deletes an existing rate limit. @@ -548,7 +548,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RateLimit: """ Updates an existing rate limit. @@ -616,7 +616,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RateLimit: """ Fetches the details of a rate limit. @@ -657,27 +657,27 @@ def __init__(self, rate_limits: RateLimitsResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rate_limits.create # pyright: ignore[reportDeprecated], + rate_limits.create, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rate_limits.list # pyright: ignore[reportDeprecated], + rate_limits.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rate_limits.delete # pyright: ignore[reportDeprecated], + rate_limits.delete, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rate_limits.edit # pyright: ignore[reportDeprecated], + rate_limits.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - rate_limits.get # pyright: ignore[reportDeprecated], + rate_limits.get, # pyright: ignore[reportDeprecated], ) ) @@ -688,27 +688,27 @@ def __init__(self, rate_limits: AsyncRateLimitsResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rate_limits.create # pyright: ignore[reportDeprecated], + rate_limits.create, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rate_limits.list # pyright: ignore[reportDeprecated], + rate_limits.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rate_limits.delete # pyright: ignore[reportDeprecated], + rate_limits.delete, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rate_limits.edit # pyright: ignore[reportDeprecated], + rate_limits.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - rate_limits.get # pyright: ignore[reportDeprecated], + rate_limits.get, # pyright: ignore[reportDeprecated], ) ) @@ -719,27 +719,27 @@ def __init__(self, rate_limits: RateLimitsResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rate_limits.create # pyright: ignore[reportDeprecated], + rate_limits.create, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rate_limits.list # pyright: ignore[reportDeprecated], + rate_limits.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rate_limits.delete # pyright: ignore[reportDeprecated], + rate_limits.delete, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rate_limits.edit # pyright: ignore[reportDeprecated], + rate_limits.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - rate_limits.get # pyright: ignore[reportDeprecated], + rate_limits.get, # pyright: ignore[reportDeprecated], ) ) @@ -750,26 +750,26 @@ def __init__(self, rate_limits: AsyncRateLimitsResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rate_limits.create # pyright: ignore[reportDeprecated], + rate_limits.create, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rate_limits.list # pyright: ignore[reportDeprecated], + rate_limits.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rate_limits.delete # pyright: ignore[reportDeprecated], + rate_limits.delete, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rate_limits.edit # pyright: ignore[reportDeprecated], + rate_limits.edit, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - rate_limits.get # pyright: ignore[reportDeprecated], + rate_limits.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/registrar/domains.py b/src/cloudflare/resources/registrar/domains.py index ff430f27ff5..714f6fc047f 100644 --- a/src/cloudflare/resources/registrar/domains.py +++ b/src/cloudflare/resources/registrar/domains.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,15 +50,15 @@ def update( domain_name: str, *, account_id: str, - auto_renew: bool | NotGiven = NOT_GIVEN, - locked: bool | NotGiven = NOT_GIVEN, - privacy: bool | NotGiven = NOT_GIVEN, + auto_renew: bool | Omit = omit, + locked: bool | Omit = omit, + privacy: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Update individual domain. @@ -116,7 +116,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Domain]: """ List domains handled by Registrar. @@ -153,7 +153,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Show individual domain. @@ -213,15 +213,15 @@ async def update( domain_name: str, *, account_id: str, - auto_renew: bool | NotGiven = NOT_GIVEN, - locked: bool | NotGiven = NOT_GIVEN, - privacy: bool | NotGiven = NOT_GIVEN, + auto_renew: bool | Omit = omit, + locked: bool | Omit = omit, + privacy: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Update individual domain. @@ -279,7 +279,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Domain, AsyncSinglePage[Domain]]: """ List domains handled by Registrar. @@ -316,7 +316,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Show individual domain. diff --git a/src/cloudflare/resources/request_tracers/traces.py b/src/cloudflare/resources/request_tracers/traces.py index ecca8192117..cd05eafcac4 100644 --- a/src/cloudflare/resources/request_tracers/traces.py +++ b/src/cloudflare/resources/request_tracers/traces.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,24 +50,24 @@ def create( account_id: str, method: str, url: str, - body: trace_create_params.Body | NotGiven = NOT_GIVEN, - context: trace_create_params.Context | NotGiven = NOT_GIVEN, - cookies: Dict[str, str] | NotGiven = NOT_GIVEN, - headers: Dict[str, str] | NotGiven = NOT_GIVEN, - protocol: str | NotGiven = NOT_GIVEN, - skip_response: bool | NotGiven = NOT_GIVEN, + body: trace_create_params.Body | Omit = omit, + context: trace_create_params.Context | Omit = omit, + cookies: Dict[str, str] | Omit = omit, + headers: Dict[str, str] | Omit = omit, + protocol: str | Omit = omit, + skip_response: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TraceCreateResponse]: """ Request Trace Args: - account_id: Identifier + account_id: Identifier. method: HTTP Method of tracing request @@ -145,24 +145,24 @@ async def create( account_id: str, method: str, url: str, - body: trace_create_params.Body | NotGiven = NOT_GIVEN, - context: trace_create_params.Context | NotGiven = NOT_GIVEN, - cookies: Dict[str, str] | NotGiven = NOT_GIVEN, - headers: Dict[str, str] | NotGiven = NOT_GIVEN, - protocol: str | NotGiven = NOT_GIVEN, - skip_response: bool | NotGiven = NOT_GIVEN, + body: trace_create_params.Body | Omit = omit, + context: trace_create_params.Context | Omit = omit, + cookies: Dict[str, str] | Omit = omit, + headers: Dict[str, str] | Omit = omit, + protocol: str | Omit = omit, + skip_response: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TraceCreateResponse]: """ Request Trace Args: - account_id: Identifier + account_id: Identifier. method: HTTP Method of tracing request diff --git a/src/cloudflare/resources/resource_sharing/recipients.py b/src/cloudflare/resources/resource_sharing/recipients.py index c5b02b1b121..317084c89ac 100644 --- a/src/cloudflare/resources/resource_sharing/recipients.py +++ b/src/cloudflare/resources/resource_sharing/recipients.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -19,7 +19,7 @@ from ..._wrappers import ResultWrapper from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ..._base_client import AsyncPaginator, make_request_options -from ...types.resource_sharing import recipient_list_params, recipient_create_params +from ...types.resource_sharing import recipient_get_params, recipient_list_params, recipient_create_params from ...types.resource_sharing.recipient_get_response import RecipientGetResponse from ...types.resource_sharing.recipient_list_response import RecipientListResponse from ...types.resource_sharing.recipient_create_response import RecipientCreateResponse @@ -53,14 +53,14 @@ def create( share_id: str, *, path_account_id: str, - body_account_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecipientCreateResponse]: """ Create a new share recipient @@ -110,14 +110,15 @@ def list( share_id: str, *, account_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + include_resources: bool | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[RecipientListResponse]: """ List share recipients by share ID. @@ -127,6 +128,8 @@ def list( share_id: Share identifier tag. + include_resources: Include resources in the response. + page: Page number. per_page: Number of objects to return per page. @@ -153,6 +156,7 @@ def list( timeout=timeout, query=maybe_transform( { + "include_resources": include_resources, "page": page, "per_page": per_page, }, @@ -173,7 +177,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecipientDeleteResponse]: """ Deletion is not immediate, an updated share recipient object with a new status @@ -218,12 +222,13 @@ def get( *, 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecipientGetResponse]: """ Get share recipient by ID. @@ -235,6 +240,8 @@ def get( recipient_id: Share Recipient identifier tag. + include_resources: Include resources in the response. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -256,6 +263,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform( + {"include_resources": include_resources}, recipient_get_params.RecipientGetParams + ), post_parser=ResultWrapper[Optional[RecipientGetResponse]]._unwrapper, ), cast_to=cast(Type[Optional[RecipientGetResponse]], ResultWrapper[RecipientGetResponse]), @@ -287,14 +297,14 @@ async def create( share_id: str, *, path_account_id: str, - body_account_id: str | NotGiven = NOT_GIVEN, - organization_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecipientCreateResponse]: """ Create a new share recipient @@ -344,14 +354,15 @@ def list( share_id: str, *, account_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + include_resources: bool | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RecipientListResponse, AsyncV4PagePaginationArray[RecipientListResponse]]: """ List share recipients by share ID. @@ -361,6 +372,8 @@ def list( share_id: Share identifier tag. + include_resources: Include resources in the response. + page: Page number. per_page: Number of objects to return per page. @@ -387,6 +400,7 @@ def list( timeout=timeout, query=maybe_transform( { + "include_resources": include_resources, "page": page, "per_page": per_page, }, @@ -407,7 +421,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecipientDeleteResponse]: """ Deletion is not immediate, an updated share recipient object with a new status @@ -452,12 +466,13 @@ async def get( *, 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecipientGetResponse]: """ Get share recipient by ID. @@ -469,6 +484,8 @@ async def get( recipient_id: Share Recipient identifier tag. + include_resources: Include resources in the response. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -490,6 +507,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=await async_maybe_transform( + {"include_resources": include_resources}, recipient_get_params.RecipientGetParams + ), post_parser=ResultWrapper[Optional[RecipientGetResponse]]._unwrapper, ), cast_to=cast(Type[Optional[RecipientGetResponse]], ResultWrapper[RecipientGetResponse]), diff --git a/src/cloudflare/resources/resource_sharing/resource_sharing.py b/src/cloudflare/resources/resource_sharing/resource_sharing.py index f4c1f85c9cc..88d07b557b1 100644 --- a/src/cloudflare/resources/resource_sharing/resource_sharing.py +++ b/src/cloudflare/resources/resource_sharing/resource_sharing.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import List, Type, Iterable, Optional, cast from typing_extensions import Literal import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .resources import ( @@ -37,6 +37,7 @@ from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ..._base_client import AsyncPaginator, make_request_options from ...types.resource_sharing import ( + resource_sharing_get_params, resource_sharing_list_params, resource_sharing_create_params, resource_sharing_update_params, @@ -90,7 +91,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceSharingCreateResponse]: """ Create a new share @@ -141,7 +142,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceSharingUpdateResponse]: """ Updating is not immediate, an updated share object with a new status will be @@ -183,19 +184,32 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - kind: Literal["sent", "received"] | NotGiven = NOT_GIVEN, - order: Literal["name", "created"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - status: Literal["active", "deleting", "deleted"] | NotGiven = NOT_GIVEN, - target_type: Literal["account", "organization"] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + include_recipient_counts: bool | Omit = omit, + include_resources: bool | Omit = omit, + kind: Literal["sent", "received"] | Omit = omit, + order: Literal["name", "created"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + resource_types: List[ + Literal[ + "custom-ruleset", + "widget", + "gateway-policy", + "gateway-destination-ip", + "gateway-block-page-settings", + "gateway-extended-email-matching", + ] + ] + | Omit = omit, + status: Literal["active", "deleting", "deleted"] | Omit = omit, + target_type: Literal["account", "organization"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[ResourceSharingListResponse]: """ Lists all account shares. @@ -205,6 +219,10 @@ def list( direction: Direction to sort objects. + include_recipient_counts: Include recipient counts in the response. + + include_resources: Include resources in the response. + kind: Filter shares by kind. order: Order shares by values in the given field. @@ -213,6 +231,8 @@ def list( per_page: Number of objects to return per page. + resource_types: Filter share resources by resource_types. + status: Filter shares by status. target_type: Filter shares by target_type. @@ -238,10 +258,13 @@ def list( query=maybe_transform( { "direction": direction, + "include_recipient_counts": include_recipient_counts, + "include_resources": include_resources, "kind": kind, "order": order, "page": page, "per_page": per_page, + "resource_types": resource_types, "status": status, "target_type": target_type, }, @@ -261,7 +284,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceSharingDeleteResponse]: """ Deletion is not immediate, an updated share object with a new status will be @@ -301,12 +324,14 @@ def get( share_id: str, *, 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceSharingGetResponse]: """ Fetches share by ID. @@ -316,6 +341,10 @@ def get( share_id: Share identifier tag. + include_recipient_counts: Include recipient counts in the response. + + include_resources: Include resources in the response. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -335,6 +364,13 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform( + { + "include_recipient_counts": include_recipient_counts, + "include_resources": include_resources, + }, + resource_sharing_get_params.ResourceSharingGetParams, + ), post_parser=ResultWrapper[Optional[ResourceSharingGetResponse]]._unwrapper, ), cast_to=cast(Type[Optional[ResourceSharingGetResponse]], ResultWrapper[ResourceSharingGetResponse]), @@ -381,7 +417,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceSharingCreateResponse]: """ Create a new share @@ -432,7 +468,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceSharingUpdateResponse]: """ Updating is not immediate, an updated share object with a new status will be @@ -476,19 +512,32 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - kind: Literal["sent", "received"] | NotGiven = NOT_GIVEN, - order: Literal["name", "created"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - status: Literal["active", "deleting", "deleted"] | NotGiven = NOT_GIVEN, - target_type: Literal["account", "organization"] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + include_recipient_counts: bool | Omit = omit, + include_resources: bool | Omit = omit, + kind: Literal["sent", "received"] | Omit = omit, + order: Literal["name", "created"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + resource_types: List[ + Literal[ + "custom-ruleset", + "widget", + "gateway-policy", + "gateway-destination-ip", + "gateway-block-page-settings", + "gateway-extended-email-matching", + ] + ] + | Omit = omit, + status: Literal["active", "deleting", "deleted"] | Omit = omit, + target_type: Literal["account", "organization"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ResourceSharingListResponse, AsyncV4PagePaginationArray[ResourceSharingListResponse]]: """ Lists all account shares. @@ -498,6 +547,10 @@ def list( direction: Direction to sort objects. + include_recipient_counts: Include recipient counts in the response. + + include_resources: Include resources in the response. + kind: Filter shares by kind. order: Order shares by values in the given field. @@ -506,6 +559,8 @@ def list( per_page: Number of objects to return per page. + resource_types: Filter share resources by resource_types. + status: Filter shares by status. target_type: Filter shares by target_type. @@ -531,10 +586,13 @@ def list( query=maybe_transform( { "direction": direction, + "include_recipient_counts": include_recipient_counts, + "include_resources": include_resources, "kind": kind, "order": order, "page": page, "per_page": per_page, + "resource_types": resource_types, "status": status, "target_type": target_type, }, @@ -554,7 +612,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceSharingDeleteResponse]: """ Deletion is not immediate, an updated share object with a new status will be @@ -594,12 +652,14 @@ async def get( share_id: str, *, 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceSharingGetResponse]: """ Fetches share by ID. @@ -609,6 +669,10 @@ async def get( share_id: Share identifier tag. + include_recipient_counts: Include recipient counts in the response. + + include_resources: Include resources in the response. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -628,6 +692,13 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=await async_maybe_transform( + { + "include_recipient_counts": include_recipient_counts, + "include_resources": include_resources, + }, + resource_sharing_get_params.ResourceSharingGetParams, + ), post_parser=ResultWrapper[Optional[ResourceSharingGetResponse]]._unwrapper, ), cast_to=cast(Type[Optional[ResourceSharingGetResponse]], ResultWrapper[ResourceSharingGetResponse]), diff --git a/src/cloudflare/resources/resource_sharing/resources.py b/src/cloudflare/resources/resource_sharing/resources.py index c557a092e08..ec35ed84afd 100644 --- a/src/cloudflare/resources/resource_sharing/resources.py +++ b/src/cloudflare/resources/resource_sharing/resources.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,13 +58,20 @@ def create( meta: object, resource_account_id: str, resource_id: str, - resource_type: Literal["custom-ruleset", "widget"], + resource_type: Literal[ + "custom-ruleset", + "widget", + "gateway-policy", + "gateway-destination-ip", + "gateway-block-page-settings", + "gateway-extended-email-matching", + ], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceCreateResponse]: """ Create a new share resource @@ -127,7 +134,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceUpdateResponse]: """ Update is not immediate, an updated share resource object with a new status will @@ -174,16 +181,24 @@ def list( share_id: str, *, account_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - resource_type: Literal["custom-ruleset", "widget"] | NotGiven = NOT_GIVEN, - status: Literal["active", "deleting", "deleted"] | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + resource_type: Literal[ + "custom-ruleset", + "widget", + "gateway-policy", + "gateway-destination-ip", + "gateway-block-page-settings", + "gateway-extended-email-matching", + ] + | Omit = omit, + status: Literal["active", "deleting", "deleted"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[ResourceListResponse]: """ List share resources by share ID. @@ -245,7 +260,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceDeleteResponse]: """ Deletion is not immediate, an updated share resource object with a new status @@ -295,7 +310,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceGetResponse]: """ Get share resource by ID. @@ -362,13 +377,20 @@ async def create( meta: object, resource_account_id: str, resource_id: str, - resource_type: Literal["custom-ruleset", "widget"], + resource_type: Literal[ + "custom-ruleset", + "widget", + "gateway-policy", + "gateway-destination-ip", + "gateway-block-page-settings", + "gateway-extended-email-matching", + ], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceCreateResponse]: """ Create a new share resource @@ -431,7 +453,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceUpdateResponse]: """ Update is not immediate, an updated share resource object with a new status will @@ -478,16 +500,24 @@ def list( share_id: str, *, account_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - resource_type: Literal["custom-ruleset", "widget"] | NotGiven = NOT_GIVEN, - status: Literal["active", "deleting", "deleted"] | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + resource_type: Literal[ + "custom-ruleset", + "widget", + "gateway-policy", + "gateway-destination-ip", + "gateway-block-page-settings", + "gateway-extended-email-matching", + ] + | Omit = omit, + status: Literal["active", "deleting", "deleted"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ResourceListResponse, AsyncV4PagePaginationArray[ResourceListResponse]]: """ List share resources by share ID. @@ -549,7 +579,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceDeleteResponse]: """ Deletion is not immediate, an updated share resource object with a new status @@ -599,7 +629,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceGetResponse]: """ Get share resource by ID. diff --git a/src/cloudflare/resources/rules/lists/bulk_operations.py b/src/cloudflare/resources/rules/lists/bulk_operations.py index d9a333b3113..57edc28f206 100644 --- a/src/cloudflare/resources/rules/lists/bulk_operations.py +++ b/src/cloudflare/resources/rules/lists/bulk_operations.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BulkOperationGetResponse: """ Gets the current status of an asynchronous operation on a list. @@ -62,7 +62,7 @@ def get( property will contain a message describing the error. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. operation_id: The unique operation ID of the asynchronous action. @@ -126,7 +126,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BulkOperationGetResponse: """ Gets the current status of an asynchronous operation on a list. @@ -136,7 +136,7 @@ async def get( property will contain a message describing the error. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. operation_id: The unique operation ID of the asynchronous action. diff --git a/src/cloudflare/resources/rules/lists/items.py b/src/cloudflare/resources/rules/lists/items.py index 5c4aef53245..c25f615936c 100644 --- a/src/cloudflare/resources/rules/lists/items.py +++ b/src/cloudflare/resources/rules/lists/items.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import Any, Iterable, cast +from typing import Any, Type, Iterable, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -17,8 +17,9 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ...._base_client import make_request_options -from ....types.rules.lists import item_list_params, item_create_params, item_update_params +from ....pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter +from ...._base_client import AsyncPaginator, make_request_options +from ....types.rules.lists import item_list_params, item_create_params, item_delete_params, item_update_params from ....types.rules.lists.item_get_response import ItemGetResponse from ....types.rules.lists.item_list_response import ItemListResponse from ....types.rules.lists.item_create_response import ItemCreateResponse @@ -59,18 +60,20 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ItemCreateResponse: """Appends new items to the list. This operation is asynchronous. To get current the operation status, invoke the - [Get bulk operation status](/operations/lists-get-bulk-operation-status) - endpoint with the returned `operation_id`. + `Get bulk operation status` endpoint with the returned `operation_id`. + + There is a limit of 1 pending bulk operation per account. If an outstanding bulk + operation is in progress, the request will be rejected. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -86,22 +89,17 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ItemCreateResponse, - self._post( - f"/accounts/{account_id}/rules/lists/{list_id}/items", - body=maybe_transform(body, Iterable[item_create_params.Body]), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ItemCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._post( + f"/accounts/{account_id}/rules/lists/{list_id}/items", + body=maybe_transform(body, Iterable[item_create_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ItemCreateResponse]._unwrapper, ), + cast_to=cast(Type[ItemCreateResponse], ResultWrapper[ItemCreateResponse]), ) def update( @@ -115,18 +113,20 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ItemUpdateResponse: """ Removes all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get current the operation status, invoke the - [Get bulk operation status](/operations/lists-get-bulk-operation-status) - endpoint with the returned `operation_id`. + `Get bulk operation status` endpoint with the returned `operation_id`. + + There is a limit of 1 pending bulk operation per account. If an outstanding bulk + operation is in progress, the request will be rejected. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -142,22 +142,17 @@ def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ItemUpdateResponse, - self._put( - f"/accounts/{account_id}/rules/lists/{list_id}/items", - body=maybe_transform(body, Iterable[item_update_params.Body]), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ItemUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._put( + f"/accounts/{account_id}/rules/lists/{list_id}/items", + body=maybe_transform(body, Iterable[item_update_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ItemUpdateResponse]._unwrapper, ), + cast_to=cast(Type[ItemUpdateResponse], ResultWrapper[ItemUpdateResponse]), ) def list( @@ -165,21 +160,21 @@ def list( list_id: str, *, account_id: str, - cursor: str | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + cursor: str | Omit = omit, + per_page: int | Omit = omit, + search: 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, - ) -> ItemListResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncCursorPaginationAfter[ItemListResponse]: """ Fetches all the items in the list. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -208,29 +203,24 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ItemListResponse, - self._get( - f"/accounts/{account_id}/rules/lists/{list_id}/items", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "cursor": cursor, - "per_page": per_page, - "search": search, - }, - item_list_params.ItemListParams, - ), - post_parser=ResultWrapper[ItemListResponse]._unwrapper, + return self._get_api_list( + f"/accounts/{account_id}/rules/lists/{list_id}/items", + page=SyncCursorPaginationAfter[ItemListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "per_page": per_page, + "search": search, + }, + item_list_params.ItemListParams, ), - cast_to=cast( - Any, ResultWrapper[ItemListResponse] - ), # Union types cannot be passed in as arguments in the type system ), + model=cast(Any, ItemListResponse), # Union types cannot be passed in as arguments in the type system ) def delete( @@ -238,23 +228,26 @@ def delete( list_id: str, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ItemDeleteResponse: """Removes one or more items from a list. This operation is asynchronous. To get current the operation status, invoke the - [Get bulk operation status](/operations/lists-get-bulk-operation-status) - endpoint with the returned `operation_id`. + `Get bulk operation status` endpoint with the returned `operation_id`. + + There is a limit of 1 pending bulk operation per account. If an outstanding bulk + operation is in progress, the request will be rejected. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -270,21 +263,17 @@ def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ItemDeleteResponse, - self._delete( - f"/accounts/{account_id}/rules/lists/{list_id}/items", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemDeleteResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ItemDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._delete( + f"/accounts/{account_id}/rules/lists/{list_id}/items", + body=maybe_transform({"items": items}, item_delete_params.ItemDeleteParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ItemDeleteResponse]._unwrapper, ), + cast_to=cast(Type[ItemDeleteResponse], ResultWrapper[ItemDeleteResponse]), ) def get( @@ -298,13 +287,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ItemGetResponse: """ Fetches a list item in the list. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -373,18 +362,20 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ItemCreateResponse: """Appends new items to the list. This operation is asynchronous. To get current the operation status, invoke the - [Get bulk operation status](/operations/lists-get-bulk-operation-status) - endpoint with the returned `operation_id`. + `Get bulk operation status` endpoint with the returned `operation_id`. + + There is a limit of 1 pending bulk operation per account. If an outstanding bulk + operation is in progress, the request will be rejected. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -400,22 +391,17 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ItemCreateResponse, - await self._post( - f"/accounts/{account_id}/rules/lists/{list_id}/items", - body=await async_maybe_transform(body, Iterable[item_create_params.Body]), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ItemCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._post( + f"/accounts/{account_id}/rules/lists/{list_id}/items", + body=await async_maybe_transform(body, Iterable[item_create_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ItemCreateResponse]._unwrapper, ), + cast_to=cast(Type[ItemCreateResponse], ResultWrapper[ItemCreateResponse]), ) async def update( @@ -429,18 +415,20 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ItemUpdateResponse: """ Removes all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get current the operation status, invoke the - [Get bulk operation status](/operations/lists-get-bulk-operation-status) - endpoint with the returned `operation_id`. + `Get bulk operation status` endpoint with the returned `operation_id`. + + There is a limit of 1 pending bulk operation per account. If an outstanding bulk + operation is in progress, the request will be rejected. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -456,44 +444,39 @@ async def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ItemUpdateResponse, - await self._put( - f"/accounts/{account_id}/rules/lists/{list_id}/items", - body=await async_maybe_transform(body, Iterable[item_update_params.Body]), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ItemUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._put( + f"/accounts/{account_id}/rules/lists/{list_id}/items", + body=await async_maybe_transform(body, Iterable[item_update_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ItemUpdateResponse]._unwrapper, ), + cast_to=cast(Type[ItemUpdateResponse], ResultWrapper[ItemUpdateResponse]), ) - async def list( + def list( self, list_id: str, *, account_id: str, - cursor: str | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + cursor: str | Omit = omit, + per_page: int | Omit = omit, + search: 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, - ) -> ItemListResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ItemListResponse, AsyncCursorPaginationAfter[ItemListResponse]]: """ Fetches all the items in the list. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -522,29 +505,24 @@ async def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ItemListResponse, - await self._get( - f"/accounts/{account_id}/rules/lists/{list_id}/items", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "cursor": cursor, - "per_page": per_page, - "search": search, - }, - item_list_params.ItemListParams, - ), - post_parser=ResultWrapper[ItemListResponse]._unwrapper, + return self._get_api_list( + f"/accounts/{account_id}/rules/lists/{list_id}/items", + page=AsyncCursorPaginationAfter[ItemListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "per_page": per_page, + "search": search, + }, + item_list_params.ItemListParams, ), - cast_to=cast( - Any, ResultWrapper[ItemListResponse] - ), # Union types cannot be passed in as arguments in the type system ), + model=cast(Any, ItemListResponse), # Union types cannot be passed in as arguments in the type system ) async def delete( @@ -552,23 +530,26 @@ async def delete( list_id: str, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ItemDeleteResponse: """Removes one or more items from a list. This operation is asynchronous. To get current the operation status, invoke the - [Get bulk operation status](/operations/lists-get-bulk-operation-status) - endpoint with the returned `operation_id`. + `Get bulk operation status` endpoint with the returned `operation_id`. + + There is a limit of 1 pending bulk operation per account. If an outstanding bulk + operation is in progress, the request will be rejected. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -584,21 +565,17 @@ async def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ItemDeleteResponse, - await self._delete( - f"/accounts/{account_id}/rules/lists/{list_id}/items", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemDeleteResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ItemDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._delete( + f"/accounts/{account_id}/rules/lists/{list_id}/items", + body=await async_maybe_transform({"items": items}, item_delete_params.ItemDeleteParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ItemDeleteResponse]._unwrapper, ), + cast_to=cast(Type[ItemDeleteResponse], ResultWrapper[ItemDeleteResponse]), ) async def get( @@ -612,13 +589,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ItemGetResponse: """ Fetches a list item in the list. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. diff --git a/src/cloudflare/resources/rules/lists/lists.py b/src/cloudflare/resources/rules/lists/lists.py index 8d698ddb452..a9acf30d14d 100644 --- a/src/cloudflare/resources/rules/lists/lists.py +++ b/src/cloudflare/resources/rules/lists/lists.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, cast +from typing import Type, cast from typing_extensions import Literal import httpx @@ -15,7 +15,7 @@ ItemsResourceWithStreamingResponse, AsyncItemsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -26,8 +26,9 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper +from ....pagination import SyncSinglePage, AsyncSinglePage from ....types.rules import list_create_params, list_update_params -from ...._base_client import make_request_options +from ...._base_client import AsyncPaginator, make_request_options from .bulk_operations import ( BulkOperationsResource, AsyncBulkOperationsResource, @@ -36,8 +37,8 @@ BulkOperationsResourceWithStreamingResponse, AsyncBulkOperationsResourceWithStreamingResponse, ) +from ....types.rules.lists_list import ListsList from ....types.rules.list_get_response import ListGetResponse -from ....types.rules.list_list_response import ListListResponse from ....types.rules.list_create_response import ListCreateResponse from ....types.rules.list_delete_response import ListDeleteResponse from ....types.rules.list_update_response import ListUpdateResponse @@ -79,19 +80,19 @@ def create( account_id: str, kind: Literal["ip", "redirect", "hostname", "asn"], name: str, - description: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ListCreateResponse: """ - Creates a new list of the specified type. + Creates a new list of the specified kind. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. kind: The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). @@ -110,29 +111,24 @@ def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - ListCreateResponse, - self._post( - f"/accounts/{account_id}/rules/lists", - body=maybe_transform( - { - "kind": kind, - "name": name, - "description": description, - }, - list_create_params.ListCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ListCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ListCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._post( + f"/accounts/{account_id}/rules/lists", + body=maybe_transform( + { + "kind": kind, + "name": name, + "description": description, + }, + list_create_params.ListCreateParams, ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ListCreateResponse]._unwrapper, + ), + cast_to=cast(Type[ListCreateResponse], ResultWrapper[ListCreateResponse]), ) def update( @@ -140,19 +136,19 @@ def update( list_id: str, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ListUpdateResponse: """ Updates the description of a list. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -170,22 +166,17 @@ def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ListUpdateResponse, - self._put( - f"/accounts/{account_id}/rules/lists/{list_id}", - body=maybe_transform({"description": description}, list_update_params.ListUpdateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ListUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ListUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._put( + f"/accounts/{account_id}/rules/lists/{list_id}", + body=maybe_transform({"description": description}, list_update_params.ListUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ListUpdateResponse]._unwrapper, ), + cast_to=cast(Type[ListUpdateResponse], ResultWrapper[ListUpdateResponse]), ) def list( @@ -197,13 +188,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ListListResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncSinglePage[ListsList]: """ Fetches all lists in the account. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. extra_headers: Send extra headers @@ -215,21 +206,13 @@ def list( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - ListListResponse, - self._get( - f"/accounts/{account_id}/rules/lists", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ListListResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ListListResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get_api_list( + f"/accounts/{account_id}/rules/lists", + page=SyncSinglePage[ListsList], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + model=ListsList, ) def delete( @@ -242,13 +225,13 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ListDeleteResponse: """ Deletes a specific list and all its items. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -264,21 +247,16 @@ def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ListDeleteResponse, - self._delete( - f"/accounts/{account_id}/rules/lists/{list_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ListDeleteResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ListDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._delete( + f"/accounts/{account_id}/rules/lists/{list_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ListDeleteResponse]._unwrapper, ), + cast_to=cast(Type[ListDeleteResponse], ResultWrapper[ListDeleteResponse]), ) def get( @@ -291,13 +269,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ListGetResponse: """ Fetches the details of a list. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -313,21 +291,16 @@ def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ListGetResponse, - self._get( - f"/accounts/{account_id}/rules/lists/{list_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ListGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ListGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get( + f"/accounts/{account_id}/rules/lists/{list_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ListGetResponse]._unwrapper, ), + cast_to=cast(Type[ListGetResponse], ResultWrapper[ListGetResponse]), ) @@ -365,19 +338,19 @@ async def create( account_id: str, kind: Literal["ip", "redirect", "hostname", "asn"], name: str, - description: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ListCreateResponse: """ - Creates a new list of the specified type. + Creates a new list of the specified kind. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. kind: The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). @@ -396,29 +369,24 @@ async def create( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - ListCreateResponse, - await self._post( - f"/accounts/{account_id}/rules/lists", - body=await async_maybe_transform( - { - "kind": kind, - "name": name, - "description": description, - }, - list_create_params.ListCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ListCreateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ListCreateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._post( + f"/accounts/{account_id}/rules/lists", + body=await async_maybe_transform( + { + "kind": kind, + "name": name, + "description": description, + }, + list_create_params.ListCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ListCreateResponse]._unwrapper, ), + cast_to=cast(Type[ListCreateResponse], ResultWrapper[ListCreateResponse]), ) async def update( @@ -426,19 +394,19 @@ async def update( list_id: str, *, account_id: str, - description: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ListUpdateResponse: """ Updates the description of a list. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -456,25 +424,20 @@ async def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ListUpdateResponse, - await self._put( - f"/accounts/{account_id}/rules/lists/{list_id}", - body=await async_maybe_transform({"description": description}, list_update_params.ListUpdateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ListUpdateResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ListUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._put( + f"/accounts/{account_id}/rules/lists/{list_id}", + body=await async_maybe_transform({"description": description}, list_update_params.ListUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ListUpdateResponse]._unwrapper, ), + cast_to=cast(Type[ListUpdateResponse], ResultWrapper[ListUpdateResponse]), ) - async def list( + def list( self, *, account_id: str, @@ -483,13 +446,13 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ListListResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ListsList, AsyncSinglePage[ListsList]]: """ Fetches all lists in the account. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. extra_headers: Send extra headers @@ -501,21 +464,13 @@ async def list( """ if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - return cast( - ListListResponse, - await self._get( - f"/accounts/{account_id}/rules/lists", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ListListResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ListListResponse] - ), # Union types cannot be passed in as arguments in the type system + return self._get_api_list( + f"/accounts/{account_id}/rules/lists", + page=AsyncSinglePage[ListsList], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), + model=ListsList, ) async def delete( @@ -528,13 +483,13 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ListDeleteResponse: """ Deletes a specific list and all its items. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -550,21 +505,16 @@ async def delete( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ListDeleteResponse, - await self._delete( - f"/accounts/{account_id}/rules/lists/{list_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ListDeleteResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ListDeleteResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._delete( + f"/accounts/{account_id}/rules/lists/{list_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ListDeleteResponse]._unwrapper, ), + cast_to=cast(Type[ListDeleteResponse], ResultWrapper[ListDeleteResponse]), ) async def get( @@ -577,13 +527,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ListGetResponse: """ Fetches the details of a list. Args: - account_id: Defines an identifier. + account_id: The Account ID for this resource. list_id: The unique ID of the list. @@ -599,21 +549,16 @@ async def get( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: raise ValueError(f"Expected a non-empty value for `list_id` but received {list_id!r}") - return cast( - ListGetResponse, - await self._get( - f"/accounts/{account_id}/rules/lists/{list_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ListGetResponse]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[ListGetResponse] - ), # Union types cannot be passed in as arguments in the type system + return await self._get( + f"/accounts/{account_id}/rules/lists/{list_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[ListGetResponse]._unwrapper, ), + cast_to=cast(Type[ListGetResponse], ResultWrapper[ListGetResponse]), ) diff --git a/src/cloudflare/resources/rulesets/phases/phases.py b/src/cloudflare/resources/rulesets/phases/phases.py index 9fe22ca199a..15c937b14bc 100644 --- a/src/cloudflare/resources/rulesets/phases/phases.py +++ b/src/cloudflare/resources/rulesets/phases/phases.py @@ -14,7 +14,7 @@ VersionsResourceWithStreamingResponse, AsyncVersionsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -62,17 +62,17 @@ def update( self, ruleset_phase: Phase, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - rules: Iterable[phase_update_params.Rule] | NotGiven = NOT_GIVEN, + 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PhaseUpdateResponse: """ Updates an account or zone entry point ruleset, creating a new version. @@ -136,14 +136,14 @@ def get( self, ruleset_phase: Phase, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PhaseGetResponse: """ Fetches the latest version of the account or zone entry point ruleset for a @@ -219,17 +219,17 @@ async def update( self, ruleset_phase: Phase, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - rules: Iterable[phase_update_params.Rule] | NotGiven = NOT_GIVEN, + 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PhaseUpdateResponse: """ Updates an account or zone entry point ruleset, creating a new version. @@ -293,14 +293,14 @@ async def get( self, ruleset_phase: Phase, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PhaseGetResponse: """ Fetches the latest version of the account or zone entry point ruleset for a diff --git a/src/cloudflare/resources/rulesets/phases/versions.py b/src/cloudflare/resources/rulesets/phases/versions.py index 964a18f3059..4a05765f784 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 NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -50,14 +50,14 @@ def list( self, ruleset_phase: Phase, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[VersionListResponse]: """ Fetches the versions of an account or zone entry point ruleset. @@ -105,14 +105,14 @@ def get( ruleset_version: str, *, ruleset_phase: Phase, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ Fetches a specific version of an account or zone entry point ruleset. @@ -187,14 +187,14 @@ def list( self, ruleset_phase: Phase, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[VersionListResponse, AsyncSinglePage[VersionListResponse]]: """ Fetches the versions of an account or zone entry point ruleset. @@ -242,14 +242,14 @@ async def get( ruleset_version: str, *, ruleset_phase: Phase, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ Fetches a specific version of an account or zone entry point ruleset. diff --git a/src/cloudflare/resources/rulesets/rules.py b/src/cloudflare/resources/rulesets/rules.py index bc9f92181b7..e1f991a9e29 100644 --- a/src/cloudflare/resources/rulesets/rules.py +++ b/src/cloudflare/resources/rulesets/rules.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,25 +53,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["block"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.BlockRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.BlockRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.BlockRulePosition | Omit = omit, + ratelimit: rule_create_params.BlockRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -95,7 +95,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -103,9 +103,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -122,25 +122,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["challenge"] | Omit = omit, + action_parameters: object | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ChallengeRulePosition | Omit = omit, + ratelimit: rule_create_params.ChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -164,7 +164,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -172,9 +172,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -191,25 +191,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["compress_response"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.CompressionRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.CompressionRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.CompressionRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.CompressionRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ResponseCompressionRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ResponseCompressionRulePosition | Omit = omit, + ratelimit: rule_create_params.ResponseCompressionRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -233,7 +233,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -241,9 +241,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -260,25 +260,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["execute"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.ExecuteRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ExecuteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ExecuteRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ExecuteRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.DDoSDynamicRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.DDoSDynamicRulePosition | Omit = omit, + ratelimit: rule_create_params.DDoSDynamicRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -302,7 +302,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -310,9 +310,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -329,26 +329,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["js_challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.JavascriptChallengeRuleExposedCredentialCheck - | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.JavascriptChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.JavascriptChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ExecuteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ExecuteRulePosition | Omit = omit, + ratelimit: rule_create_params.ExecuteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -372,7 +371,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -380,9 +379,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -399,25 +398,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["log"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.LogRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.LogRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.LogRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ForceConnectionCloseRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ForceConnectionCloseRulePosition | Omit = omit, + ratelimit: rule_create_params.ForceConnectionCloseRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -441,7 +440,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -449,9 +448,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -468,25 +467,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["managed_challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ManagedChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ManagedChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ManagedChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.JavaScriptChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.JavaScriptChallengeRulePosition | Omit = omit, + ratelimit: rule_create_params.JavaScriptChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -510,7 +509,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -518,9 +517,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -537,25 +536,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["redirect"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.RedirectRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.RedirectRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.RedirectRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.RedirectRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["log"] | Omit = omit, + action_parameters: object | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.LogRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.LogRulePosition | Omit = omit, + ratelimit: rule_create_params.LogRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -579,7 +578,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -587,9 +586,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -606,25 +605,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["rewrite"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.RewriteRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.RewriteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.RewriteRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.RewriteRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.LogCustomFieldRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.LogCustomFieldRulePosition | Omit = omit, + ratelimit: rule_create_params.LogCustomFieldRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -648,7 +647,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -656,9 +655,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -675,25 +674,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["route"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.OriginRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.OriginRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.OriginRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.OriginRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ManagedChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ManagedChallengeRulePosition | Omit = omit, + ratelimit: rule_create_params.ManagedChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -717,7 +716,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -725,9 +724,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -744,25 +743,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["score"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.ScoreRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ScoreRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ScoreRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ScoreRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.RedirectRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.RedirectRulePosition | Omit = omit, + ratelimit: rule_create_params.RedirectRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -786,7 +785,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -794,9 +793,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -813,25 +812,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["serve_error"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.ServeErrorRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ServeErrorRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ServeErrorRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ServeErrorRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.RewriteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.RewriteRulePosition | Omit = omit, + ratelimit: rule_create_params.RewriteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -855,7 +854,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -863,9 +862,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -882,25 +881,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["set_config"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.SetConfigRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.SetConfigRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.SetConfigRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.SetConfigRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.RouteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.RouteRulePosition | Omit = omit, + ratelimit: rule_create_params.RouteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -924,7 +923,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -932,9 +931,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -951,25 +950,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["skip"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.SkipRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.SkipRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.SkipRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.SkipRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ScoreRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ScoreRulePosition | Omit = omit, + ratelimit: rule_create_params.ScoreRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -993,7 +992,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1001,9 +1000,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1020,25 +1019,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["set_cache_settings"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.SetCacheSettingsRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.SetCacheSettingsRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.SetCacheSettingsRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.SetCacheSettingsRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ServeErrorRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ServeErrorRulePosition | Omit = omit, + ratelimit: rule_create_params.ServeErrorRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -1062,7 +1061,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1070,9 +1069,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1089,25 +1088,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["log_custom_field"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.LogCustomFieldRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.LogCustomFieldRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.LogCustomFieldRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.LogCustomFieldRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.SetCacheSettingsRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.SetCacheSettingsRulePosition | Omit = omit, + ratelimit: rule_create_params.SetCacheSettingsRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -1131,7 +1130,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1139,9 +1138,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1158,25 +1157,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["ddos_dynamic"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.DDoSDynamicRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.DDoSDynamicRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.DDoSDynamicRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.SetConfigurationRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.SetConfigurationRulePosition | Omit = omit, + ratelimit: rule_create_params.SetConfigurationRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -1200,7 +1199,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1208,9 +1207,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1227,26 +1226,25 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["force_connection_close"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ForceConnectionCloseRuleExposedCredentialCheck - | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ForceConnectionCloseRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ForceConnectionCloseRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.SkipRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.SkipRulePosition | Omit = omit, + ratelimit: rule_create_params.SkipRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -1270,7 +1268,7 @@ def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1278,9 +1276,9 @@ def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1296,56 +1294,110 @@ def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, action: Literal["block"] | Literal["challenge"] | Literal["compress_response"] + | Literal["ddos_dynamic"] | Literal["execute"] + | Literal["force_connection_close"] | Literal["js_challenge"] | Literal["log"] + | Literal["log_custom_field"] | Literal["managed_challenge"] | Literal["redirect"] | Literal["rewrite"] | Literal["route"] | Literal["score"] | Literal["serve_error"] + | Literal["set_cache_settings"] | Literal["set_config"] | Literal["skip"] - | Literal["set_cache_settings"] - | Literal["log_custom_field"] - | Literal["ddos_dynamic"] - | Literal["force_connection_close"] - | NotGiven = NOT_GIVEN, + | Omit = omit, action_parameters: rule_create_params.BlockRuleActionParameters | object - | rule_create_params.CompressionRuleActionParameters + | rule_create_params.ResponseCompressionRuleActionParameters | rule_create_params.ExecuteRuleActionParameters + | rule_create_params.LogCustomFieldRuleActionParameters | rule_create_params.RedirectRuleActionParameters | rule_create_params.RewriteRuleActionParameters - | rule_create_params.OriginRuleActionParameters + | rule_create_params.RouteRuleActionParameters | rule_create_params.ScoreRuleActionParameters | rule_create_params.ServeErrorRuleActionParameters - | rule_create_params.SetConfigRuleActionParameters - | rule_create_params.SkipRuleActionParameters | rule_create_params.SetCacheSettingsRuleActionParameters - | rule_create_params.LogCustomFieldRuleActionParameters - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.BlockRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + | rule_create_params.SetConfigurationRuleActionParameters + | rule_create_params.SkipRuleActionParameters + | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck + | rule_create_params.ChallengeRuleExposedCredentialCheck + | rule_create_params.ResponseCompressionRuleExposedCredentialCheck + | rule_create_params.DDoSDynamicRuleExposedCredentialCheck + | rule_create_params.ExecuteRuleExposedCredentialCheck + | rule_create_params.ForceConnectionCloseRuleExposedCredentialCheck + | rule_create_params.JavaScriptChallengeRuleExposedCredentialCheck + | rule_create_params.LogRuleExposedCredentialCheck + | rule_create_params.LogCustomFieldRuleExposedCredentialCheck + | rule_create_params.ManagedChallengeRuleExposedCredentialCheck + | rule_create_params.RedirectRuleExposedCredentialCheck + | rule_create_params.RewriteRuleExposedCredentialCheck + | rule_create_params.RouteRuleExposedCredentialCheck + | rule_create_params.ScoreRuleExposedCredentialCheck + | rule_create_params.ServeErrorRuleExposedCredentialCheck + | rule_create_params.SetCacheSettingsRuleExposedCredentialCheck + | rule_create_params.SetConfigurationRuleExposedCredentialCheck + | rule_create_params.SkipRuleExposedCredentialCheck + | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.BlockRulePosition + | rule_create_params.ChallengeRulePosition + | rule_create_params.ResponseCompressionRulePosition + | rule_create_params.DDoSDynamicRulePosition + | rule_create_params.ExecuteRulePosition + | rule_create_params.ForceConnectionCloseRulePosition + | rule_create_params.JavaScriptChallengeRulePosition + | rule_create_params.LogRulePosition + | rule_create_params.LogCustomFieldRulePosition + | rule_create_params.ManagedChallengeRulePosition + | rule_create_params.RedirectRulePosition + | rule_create_params.RewriteRulePosition + | rule_create_params.RouteRulePosition + | rule_create_params.ScoreRulePosition + | rule_create_params.ServeErrorRulePosition + | rule_create_params.SetCacheSettingsRulePosition + | rule_create_params.SetConfigurationRulePosition + | rule_create_params.SkipRulePosition + | Omit = omit, + ratelimit: rule_create_params.BlockRuleRatelimit + | rule_create_params.ChallengeRuleRatelimit + | rule_create_params.ResponseCompressionRuleRatelimit + | rule_create_params.DDoSDynamicRuleRatelimit + | rule_create_params.ExecuteRuleRatelimit + | rule_create_params.ForceConnectionCloseRuleRatelimit + | rule_create_params.JavaScriptChallengeRuleRatelimit + | rule_create_params.LogRuleRatelimit + | rule_create_params.LogCustomFieldRuleRatelimit + | rule_create_params.ManagedChallengeRuleRatelimit + | rule_create_params.RedirectRuleRatelimit + | rule_create_params.RewriteRuleRatelimit + | rule_create_params.RouteRuleRatelimit + | rule_create_params.ScoreRuleRatelimit + | rule_create_params.ServeErrorRuleRatelimit + | rule_create_params.SetCacheSettingsRuleRatelimit + | rule_create_params.SetConfigurationRuleRatelimit + | rule_create_params.SkipRuleRatelimit + | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") @@ -1394,14 +1446,14 @@ def delete( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleDeleteResponse: """ Deletes an existing rule from an account or zone ruleset. @@ -1457,25 +1509,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["block"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.BlockRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.BlockRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.BlockRulePosition | Omit = omit, + ratelimit: rule_edit_params.BlockRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -1499,7 +1551,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1507,9 +1559,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1527,25 +1579,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["challenge"] | Omit = omit, + action_parameters: object | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ChallengeRulePosition | Omit = omit, + ratelimit: rule_edit_params.ChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -1569,7 +1621,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1577,9 +1629,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1597,25 +1649,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["compress_response"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.CompressionRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.CompressionRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.CompressionRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.CompressionRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ResponseCompressionRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ResponseCompressionRulePosition | Omit = omit, + ratelimit: rule_edit_params.ResponseCompressionRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -1639,7 +1691,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1647,9 +1699,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1667,25 +1719,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["execute"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.ExecuteRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ExecuteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ExecuteRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ExecuteRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.DDoSDynamicRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.DDoSDynamicRulePosition | Omit = omit, + ratelimit: rule_edit_params.DDoSDynamicRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -1709,7 +1761,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1717,9 +1769,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1737,25 +1789,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["js_challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.JavascriptChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.JavascriptChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.JavascriptChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ExecuteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ExecuteRulePosition | Omit = omit, + ratelimit: rule_edit_params.ExecuteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -1779,7 +1831,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1787,9 +1839,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1807,25 +1859,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["log"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.LogRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.LogRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.LogRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ForceConnectionCloseRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ForceConnectionCloseRulePosition | Omit = omit, + ratelimit: rule_edit_params.ForceConnectionCloseRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -1849,7 +1901,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1857,9 +1909,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1877,25 +1929,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["managed_challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ManagedChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ManagedChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ManagedChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.JavaScriptChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.JavaScriptChallengeRulePosition | Omit = omit, + ratelimit: rule_edit_params.JavaScriptChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -1919,7 +1971,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1927,9 +1979,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -1947,25 +1999,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["redirect"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.RedirectRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.RedirectRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.RedirectRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.RedirectRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["log"] | Omit = omit, + action_parameters: object | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.LogRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.LogRulePosition | Omit = omit, + ratelimit: rule_edit_params.LogRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -1989,7 +2041,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -1997,9 +2049,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2017,25 +2069,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["rewrite"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.RewriteRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.RewriteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.RewriteRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.RewriteRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.LogCustomFieldRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.LogCustomFieldRulePosition | Omit = omit, + ratelimit: rule_edit_params.LogCustomFieldRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -2059,7 +2111,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2067,9 +2119,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2087,25 +2139,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["route"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.OriginRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.OriginRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.OriginRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.OriginRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ManagedChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ManagedChallengeRulePosition | Omit = omit, + ratelimit: rule_edit_params.ManagedChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -2129,7 +2181,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2137,9 +2189,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2157,25 +2209,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["score"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.ScoreRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ScoreRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ScoreRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ScoreRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.RedirectRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.RedirectRulePosition | Omit = omit, + ratelimit: rule_edit_params.RedirectRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -2199,7 +2251,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2207,9 +2259,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2227,25 +2279,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["serve_error"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.ServeErrorRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ServeErrorRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ServeErrorRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ServeErrorRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.RewriteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.RewriteRulePosition | Omit = omit, + ratelimit: rule_edit_params.RewriteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -2269,7 +2321,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2277,9 +2329,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2297,25 +2349,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["set_config"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.SetConfigRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.SetConfigRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.SetConfigRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.SetConfigRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.RouteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.RouteRulePosition | Omit = omit, + ratelimit: rule_edit_params.RouteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -2339,7 +2391,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2347,9 +2399,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2367,25 +2419,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["skip"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.SkipRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.SkipRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.SkipRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.SkipRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ScoreRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ScoreRulePosition | Omit = omit, + ratelimit: rule_edit_params.ScoreRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -2409,7 +2461,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2417,9 +2469,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2437,25 +2489,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["set_cache_settings"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.SetCacheSettingsRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.SetCacheSettingsRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.SetCacheSettingsRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.SetCacheSettingsRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ServeErrorRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ServeErrorRulePosition | Omit = omit, + ratelimit: rule_edit_params.ServeErrorRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -2479,7 +2531,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2487,9 +2539,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2507,25 +2559,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["log_custom_field"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.LogCustomFieldRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.LogCustomFieldRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.LogCustomFieldRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.LogCustomFieldRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.SetCacheSettingsRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.SetCacheSettingsRulePosition | Omit = omit, + ratelimit: rule_edit_params.SetCacheSettingsRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -2549,7 +2601,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2557,9 +2609,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2577,25 +2629,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["ddos_dynamic"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.DDoSDynamicRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.DDoSDynamicRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.DDoSDynamicRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.SetConfigurationRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.SetConfigurationRulePosition | Omit = omit, + ratelimit: rule_edit_params.SetConfigurationRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -2619,7 +2671,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2627,9 +2679,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2647,26 +2699,25 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["force_connection_close"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ForceConnectionCloseRuleExposedCredentialCheck - | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ForceConnectionCloseRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ForceConnectionCloseRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.SkipRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.SkipRulePosition | Omit = omit, + ratelimit: rule_edit_params.SkipRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -2690,7 +2741,7 @@ def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2698,9 +2749,9 @@ def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2718,56 +2769,110 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, action: Literal["block"] | Literal["challenge"] | Literal["compress_response"] + | Literal["ddos_dynamic"] | Literal["execute"] + | Literal["force_connection_close"] | Literal["js_challenge"] | Literal["log"] + | Literal["log_custom_field"] | Literal["managed_challenge"] | Literal["redirect"] | Literal["rewrite"] | Literal["route"] | Literal["score"] | Literal["serve_error"] + | Literal["set_cache_settings"] | Literal["set_config"] | Literal["skip"] - | Literal["set_cache_settings"] - | Literal["log_custom_field"] - | Literal["ddos_dynamic"] - | Literal["force_connection_close"] - | NotGiven = NOT_GIVEN, + | Omit = omit, action_parameters: rule_edit_params.BlockRuleActionParameters | object - | rule_edit_params.CompressionRuleActionParameters + | rule_edit_params.ResponseCompressionRuleActionParameters | rule_edit_params.ExecuteRuleActionParameters + | rule_edit_params.LogCustomFieldRuleActionParameters | rule_edit_params.RedirectRuleActionParameters | rule_edit_params.RewriteRuleActionParameters - | rule_edit_params.OriginRuleActionParameters + | rule_edit_params.RouteRuleActionParameters | rule_edit_params.ScoreRuleActionParameters | rule_edit_params.ServeErrorRuleActionParameters - | rule_edit_params.SetConfigRuleActionParameters - | rule_edit_params.SkipRuleActionParameters | rule_edit_params.SetCacheSettingsRuleActionParameters - | rule_edit_params.LogCustomFieldRuleActionParameters - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.BlockRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + | rule_edit_params.SetConfigurationRuleActionParameters + | rule_edit_params.SkipRuleActionParameters + | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck + | rule_edit_params.ChallengeRuleExposedCredentialCheck + | rule_edit_params.ResponseCompressionRuleExposedCredentialCheck + | rule_edit_params.DDoSDynamicRuleExposedCredentialCheck + | rule_edit_params.ExecuteRuleExposedCredentialCheck + | rule_edit_params.ForceConnectionCloseRuleExposedCredentialCheck + | rule_edit_params.JavaScriptChallengeRuleExposedCredentialCheck + | rule_edit_params.LogRuleExposedCredentialCheck + | rule_edit_params.LogCustomFieldRuleExposedCredentialCheck + | rule_edit_params.ManagedChallengeRuleExposedCredentialCheck + | rule_edit_params.RedirectRuleExposedCredentialCheck + | rule_edit_params.RewriteRuleExposedCredentialCheck + | rule_edit_params.RouteRuleExposedCredentialCheck + | rule_edit_params.ScoreRuleExposedCredentialCheck + | rule_edit_params.ServeErrorRuleExposedCredentialCheck + | rule_edit_params.SetCacheSettingsRuleExposedCredentialCheck + | rule_edit_params.SetConfigurationRuleExposedCredentialCheck + | rule_edit_params.SkipRuleExposedCredentialCheck + | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.BlockRulePosition + | rule_edit_params.ChallengeRulePosition + | rule_edit_params.ResponseCompressionRulePosition + | rule_edit_params.DDoSDynamicRulePosition + | rule_edit_params.ExecuteRulePosition + | rule_edit_params.ForceConnectionCloseRulePosition + | rule_edit_params.JavaScriptChallengeRulePosition + | rule_edit_params.LogRulePosition + | rule_edit_params.LogCustomFieldRulePosition + | rule_edit_params.ManagedChallengeRulePosition + | rule_edit_params.RedirectRulePosition + | rule_edit_params.RewriteRulePosition + | rule_edit_params.RouteRulePosition + | rule_edit_params.ScoreRulePosition + | rule_edit_params.ServeErrorRulePosition + | rule_edit_params.SetCacheSettingsRulePosition + | rule_edit_params.SetConfigurationRulePosition + | rule_edit_params.SkipRulePosition + | Omit = omit, + ratelimit: rule_edit_params.BlockRuleRatelimit + | rule_edit_params.ChallengeRuleRatelimit + | rule_edit_params.ResponseCompressionRuleRatelimit + | rule_edit_params.DDoSDynamicRuleRatelimit + | rule_edit_params.ExecuteRuleRatelimit + | rule_edit_params.ForceConnectionCloseRuleRatelimit + | rule_edit_params.JavaScriptChallengeRuleRatelimit + | rule_edit_params.LogRuleRatelimit + | rule_edit_params.LogCustomFieldRuleRatelimit + | rule_edit_params.ManagedChallengeRuleRatelimit + | rule_edit_params.RedirectRuleRatelimit + | rule_edit_params.RewriteRuleRatelimit + | rule_edit_params.RouteRuleRatelimit + | rule_edit_params.ScoreRuleRatelimit + | rule_edit_params.ServeErrorRuleRatelimit + | rule_edit_params.SetCacheSettingsRuleRatelimit + | rule_edit_params.SetConfigurationRuleRatelimit + | rule_edit_params.SkipRuleRatelimit + | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") @@ -2839,25 +2944,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["block"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.BlockRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.BlockRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.BlockRulePosition | Omit = omit, + ratelimit: rule_create_params.BlockRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -2881,7 +2986,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2889,9 +2994,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2908,25 +3013,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["challenge"] | Omit = omit, + action_parameters: object | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ChallengeRulePosition | Omit = omit, + ratelimit: rule_create_params.ChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -2950,7 +3055,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -2958,9 +3063,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -2977,25 +3082,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["compress_response"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.CompressionRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.CompressionRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.CompressionRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.CompressionRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ResponseCompressionRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ResponseCompressionRulePosition | Omit = omit, + ratelimit: rule_create_params.ResponseCompressionRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3019,7 +3124,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3027,9 +3132,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3046,25 +3151,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["execute"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.ExecuteRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ExecuteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ExecuteRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ExecuteRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.DDoSDynamicRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.DDoSDynamicRulePosition | Omit = omit, + ratelimit: rule_create_params.DDoSDynamicRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3088,7 +3193,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3096,9 +3201,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3115,26 +3220,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["js_challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.JavascriptChallengeRuleExposedCredentialCheck - | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.JavascriptChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.JavascriptChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ExecuteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ExecuteRulePosition | Omit = omit, + ratelimit: rule_create_params.ExecuteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3158,7 +3262,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3166,9 +3270,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3185,25 +3289,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["log"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.LogRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.LogRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.LogRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ForceConnectionCloseRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ForceConnectionCloseRulePosition | Omit = omit, + ratelimit: rule_create_params.ForceConnectionCloseRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3227,7 +3331,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3235,9 +3339,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3254,25 +3358,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["managed_challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ManagedChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ManagedChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ManagedChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.JavaScriptChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.JavaScriptChallengeRulePosition | Omit = omit, + ratelimit: rule_create_params.JavaScriptChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3296,7 +3400,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3304,9 +3408,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3323,25 +3427,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["redirect"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.RedirectRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.RedirectRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.RedirectRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.RedirectRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["log"] | Omit = omit, + action_parameters: object | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.LogRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.LogRulePosition | Omit = omit, + ratelimit: rule_create_params.LogRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3365,7 +3469,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3373,9 +3477,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3392,25 +3496,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["rewrite"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.RewriteRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.RewriteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.RewriteRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.RewriteRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.LogCustomFieldRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.LogCustomFieldRulePosition | Omit = omit, + ratelimit: rule_create_params.LogCustomFieldRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3434,7 +3538,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3442,9 +3546,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3461,25 +3565,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["route"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.OriginRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.OriginRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.OriginRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.OriginRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ManagedChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ManagedChallengeRulePosition | Omit = omit, + ratelimit: rule_create_params.ManagedChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3503,7 +3607,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3511,9 +3615,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3530,25 +3634,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["score"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.ScoreRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ScoreRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ScoreRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ScoreRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.RedirectRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.RedirectRulePosition | Omit = omit, + ratelimit: rule_create_params.RedirectRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3572,7 +3676,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3580,9 +3684,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3599,25 +3703,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["serve_error"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.ServeErrorRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ServeErrorRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ServeErrorRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ServeErrorRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.RewriteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.RewriteRulePosition | Omit = omit, + ratelimit: rule_create_params.RewriteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3641,7 +3745,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3649,9 +3753,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3668,25 +3772,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["set_config"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.SetConfigRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.SetConfigRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.SetConfigRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.SetConfigRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.RouteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.RouteRulePosition | Omit = omit, + ratelimit: rule_create_params.RouteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3710,7 +3814,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3718,9 +3822,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3737,25 +3841,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["skip"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.SkipRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.SkipRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.SkipRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.SkipRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ScoreRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ScoreRulePosition | Omit = omit, + ratelimit: rule_create_params.ScoreRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3779,7 +3883,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3787,9 +3891,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3806,25 +3910,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["set_cache_settings"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.SetCacheSettingsRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.SetCacheSettingsRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.SetCacheSettingsRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.SetCacheSettingsRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ServeErrorRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ServeErrorRulePosition | Omit = omit, + ratelimit: rule_create_params.ServeErrorRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3848,7 +3952,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3856,9 +3960,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3875,25 +3979,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["log_custom_field"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.LogCustomFieldRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.LogCustomFieldRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.LogCustomFieldRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.LogCustomFieldRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.SetCacheSettingsRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.SetCacheSettingsRulePosition | Omit = omit, + ratelimit: rule_create_params.SetCacheSettingsRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3917,7 +4021,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3925,9 +4029,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -3944,25 +4048,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["ddos_dynamic"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.DDoSDynamicRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.DDoSDynamicRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.DDoSDynamicRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.SetConfigurationRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.SetConfigurationRulePosition | Omit = omit, + ratelimit: rule_create_params.SetConfigurationRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -3986,7 +4090,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -3994,9 +4098,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4013,26 +4117,25 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["force_connection_close"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.ForceConnectionCloseRuleExposedCredentialCheck - | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.ForceConnectionCloseRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.ForceConnectionCloseRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.SkipRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.SkipRulePosition | Omit = omit, + ratelimit: rule_create_params.SkipRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: """Adds a new rule to an account or zone ruleset. @@ -4056,7 +4159,7 @@ async def create( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4064,9 +4167,9 @@ async def create( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4082,56 +4185,110 @@ async def create( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, action: Literal["block"] | Literal["challenge"] | Literal["compress_response"] + | Literal["ddos_dynamic"] | Literal["execute"] + | Literal["force_connection_close"] | Literal["js_challenge"] | Literal["log"] + | Literal["log_custom_field"] | Literal["managed_challenge"] | Literal["redirect"] | Literal["rewrite"] | Literal["route"] | Literal["score"] | Literal["serve_error"] + | Literal["set_cache_settings"] | Literal["set_config"] | Literal["skip"] - | Literal["set_cache_settings"] - | Literal["log_custom_field"] - | Literal["ddos_dynamic"] - | Literal["force_connection_close"] - | NotGiven = NOT_GIVEN, + | Omit = omit, action_parameters: rule_create_params.BlockRuleActionParameters | object - | rule_create_params.CompressionRuleActionParameters + | rule_create_params.ResponseCompressionRuleActionParameters | rule_create_params.ExecuteRuleActionParameters + | rule_create_params.LogCustomFieldRuleActionParameters | rule_create_params.RedirectRuleActionParameters | rule_create_params.RewriteRuleActionParameters - | rule_create_params.OriginRuleActionParameters + | rule_create_params.RouteRuleActionParameters | rule_create_params.ScoreRuleActionParameters | rule_create_params.ServeErrorRuleActionParameters - | rule_create_params.SetConfigRuleActionParameters - | rule_create_params.SkipRuleActionParameters | rule_create_params.SetCacheSettingsRuleActionParameters - | rule_create_params.LogCustomFieldRuleActionParameters - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_create_params.BlockRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + | rule_create_params.SetConfigurationRuleActionParameters + | rule_create_params.SkipRuleActionParameters + | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck + | rule_create_params.ChallengeRuleExposedCredentialCheck + | rule_create_params.ResponseCompressionRuleExposedCredentialCheck + | rule_create_params.DDoSDynamicRuleExposedCredentialCheck + | rule_create_params.ExecuteRuleExposedCredentialCheck + | rule_create_params.ForceConnectionCloseRuleExposedCredentialCheck + | rule_create_params.JavaScriptChallengeRuleExposedCredentialCheck + | rule_create_params.LogRuleExposedCredentialCheck + | rule_create_params.LogCustomFieldRuleExposedCredentialCheck + | rule_create_params.ManagedChallengeRuleExposedCredentialCheck + | rule_create_params.RedirectRuleExposedCredentialCheck + | rule_create_params.RewriteRuleExposedCredentialCheck + | rule_create_params.RouteRuleExposedCredentialCheck + | rule_create_params.ScoreRuleExposedCredentialCheck + | rule_create_params.ServeErrorRuleExposedCredentialCheck + | rule_create_params.SetCacheSettingsRuleExposedCredentialCheck + | rule_create_params.SetConfigurationRuleExposedCredentialCheck + | rule_create_params.SkipRuleExposedCredentialCheck + | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.BlockRulePosition + | rule_create_params.ChallengeRulePosition + | rule_create_params.ResponseCompressionRulePosition + | rule_create_params.DDoSDynamicRulePosition + | rule_create_params.ExecuteRulePosition + | rule_create_params.ForceConnectionCloseRulePosition + | rule_create_params.JavaScriptChallengeRulePosition + | rule_create_params.LogRulePosition + | rule_create_params.LogCustomFieldRulePosition + | rule_create_params.ManagedChallengeRulePosition + | rule_create_params.RedirectRulePosition + | rule_create_params.RewriteRulePosition + | rule_create_params.RouteRulePosition + | rule_create_params.ScoreRulePosition + | rule_create_params.ServeErrorRulePosition + | rule_create_params.SetCacheSettingsRulePosition + | rule_create_params.SetConfigurationRulePosition + | rule_create_params.SkipRulePosition + | Omit = omit, + ratelimit: rule_create_params.BlockRuleRatelimit + | rule_create_params.ChallengeRuleRatelimit + | rule_create_params.ResponseCompressionRuleRatelimit + | rule_create_params.DDoSDynamicRuleRatelimit + | rule_create_params.ExecuteRuleRatelimit + | rule_create_params.ForceConnectionCloseRuleRatelimit + | rule_create_params.JavaScriptChallengeRuleRatelimit + | rule_create_params.LogRuleRatelimit + | rule_create_params.LogCustomFieldRuleRatelimit + | rule_create_params.ManagedChallengeRuleRatelimit + | rule_create_params.RedirectRuleRatelimit + | rule_create_params.RewriteRuleRatelimit + | rule_create_params.RouteRuleRatelimit + | rule_create_params.ScoreRuleRatelimit + | rule_create_params.ServeErrorRuleRatelimit + | rule_create_params.SetCacheSettingsRuleRatelimit + | rule_create_params.SetConfigurationRuleRatelimit + | rule_create_params.SkipRuleRatelimit + | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleCreateResponse: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") @@ -4180,14 +4337,14 @@ async def delete( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleDeleteResponse: """ Deletes an existing rule from an account or zone ruleset. @@ -4243,25 +4400,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["block"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.BlockRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.BlockRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.BlockRulePosition | Omit = omit, + ratelimit: rule_edit_params.BlockRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4285,7 +4442,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4293,9 +4450,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4313,25 +4470,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["challenge"] | Omit = omit, + action_parameters: object | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ChallengeRulePosition | Omit = omit, + ratelimit: rule_edit_params.ChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4355,7 +4512,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4363,9 +4520,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4383,25 +4540,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["compress_response"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.CompressionRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.CompressionRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.CompressionRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.CompressionRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ResponseCompressionRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ResponseCompressionRulePosition | Omit = omit, + ratelimit: rule_edit_params.ResponseCompressionRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4425,7 +4582,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4433,9 +4590,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4453,25 +4610,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["execute"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.ExecuteRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ExecuteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ExecuteRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ExecuteRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.DDoSDynamicRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.DDoSDynamicRulePosition | Omit = omit, + ratelimit: rule_edit_params.DDoSDynamicRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4495,7 +4652,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4503,9 +4660,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4523,25 +4680,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["js_challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.JavascriptChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.JavascriptChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.JavascriptChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ExecuteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ExecuteRulePosition | Omit = omit, + ratelimit: rule_edit_params.ExecuteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4565,7 +4722,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4573,9 +4730,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4593,25 +4750,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["log"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.LogRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.LogRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.LogRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ForceConnectionCloseRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ForceConnectionCloseRulePosition | Omit = omit, + ratelimit: rule_edit_params.ForceConnectionCloseRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4635,7 +4792,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4643,9 +4800,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4663,25 +4820,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["managed_challenge"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ManagedChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ManagedChallengeRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ManagedChallengeRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.JavaScriptChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.JavaScriptChallengeRulePosition | Omit = omit, + ratelimit: rule_edit_params.JavaScriptChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4705,7 +4862,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4713,9 +4870,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4733,25 +4890,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["redirect"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.RedirectRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.RedirectRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.RedirectRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.RedirectRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["log"] | Omit = omit, + action_parameters: object | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.LogRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.LogRulePosition | Omit = omit, + ratelimit: rule_edit_params.LogRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4775,7 +4932,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4783,9 +4940,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4803,25 +4960,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["rewrite"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.RewriteRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.RewriteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.RewriteRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.RewriteRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.LogCustomFieldRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.LogCustomFieldRulePosition | Omit = omit, + ratelimit: rule_edit_params.LogCustomFieldRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4845,7 +5002,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4853,9 +5010,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4873,25 +5030,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["route"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.OriginRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.OriginRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.OriginRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.OriginRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ManagedChallengeRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ManagedChallengeRulePosition | Omit = omit, + ratelimit: rule_edit_params.ManagedChallengeRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4915,7 +5072,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4923,9 +5080,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -4943,25 +5100,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["score"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.ScoreRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ScoreRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ScoreRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ScoreRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.RedirectRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.RedirectRulePosition | Omit = omit, + ratelimit: rule_edit_params.RedirectRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -4985,7 +5142,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -4993,9 +5150,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -5013,25 +5170,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["serve_error"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.ServeErrorRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ServeErrorRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ServeErrorRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ServeErrorRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.RewriteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.RewriteRulePosition | Omit = omit, + ratelimit: rule_edit_params.RewriteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -5055,7 +5212,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -5063,9 +5220,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -5083,25 +5240,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["set_config"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.SetConfigRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.SetConfigRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.SetConfigRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.SetConfigRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.RouteRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.RouteRulePosition | Omit = omit, + ratelimit: rule_edit_params.RouteRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -5125,7 +5282,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -5133,9 +5290,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -5153,25 +5310,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["skip"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.SkipRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.SkipRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.SkipRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.SkipRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ScoreRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ScoreRulePosition | Omit = omit, + ratelimit: rule_edit_params.ScoreRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -5195,7 +5352,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -5203,9 +5360,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -5223,25 +5380,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["set_cache_settings"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.SetCacheSettingsRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.SetCacheSettingsRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.SetCacheSettingsRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.SetCacheSettingsRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.ServeErrorRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.ServeErrorRulePosition | Omit = omit, + ratelimit: rule_edit_params.ServeErrorRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -5265,7 +5422,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -5273,9 +5430,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -5293,25 +5450,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["log_custom_field"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.LogCustomFieldRuleActionParameters | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.LogCustomFieldRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.LogCustomFieldRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.LogCustomFieldRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.SetCacheSettingsRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.SetCacheSettingsRulePosition | Omit = omit, + ratelimit: rule_edit_params.SetCacheSettingsRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -5335,7 +5492,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -5343,9 +5500,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -5363,25 +5520,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["ddos_dynamic"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.DDoSDynamicRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.DDoSDynamicRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.DDoSDynamicRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.SetConfigurationRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.SetConfigurationRulePosition | Omit = omit, + ratelimit: rule_edit_params.SetConfigurationRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -5405,7 +5562,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -5413,9 +5570,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -5433,26 +5590,25 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, - action: Literal["force_connection_close"] | NotGiven = NOT_GIVEN, - action_parameters: object | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.ForceConnectionCloseRuleExposedCredentialCheck - | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.ForceConnectionCloseRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.ForceConnectionCloseRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + 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, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.SkipRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.SkipRulePosition | Omit = omit, + ratelimit: rule_edit_params.SkipRuleRatelimit | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: """ Updates an existing rule in an account or zone ruleset. @@ -5476,7 +5632,7 @@ async def edit( enabled: Whether the rule should be executed. - exposed_credential_check: Configure checks for exposed credentials. + exposed_credential_check: Configuration for exposed credential checking. expression: The expression defining which traffic will match the rule. @@ -5484,9 +5640,9 @@ async def edit( position: An object configuring where the rule will be placed. - ratelimit: An object configuring the rule's ratelimit behavior. + ratelimit: An object configuring the rule's rate limit behavior. - ref: The reference of the rule (the rule ID by default). + ref: The reference of the rule (the rule's ID by default). extra_headers: Send extra headers @@ -5504,56 +5660,110 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - id: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, action: Literal["block"] | Literal["challenge"] | Literal["compress_response"] + | Literal["ddos_dynamic"] | Literal["execute"] + | Literal["force_connection_close"] | Literal["js_challenge"] | Literal["log"] + | Literal["log_custom_field"] | Literal["managed_challenge"] | Literal["redirect"] | Literal["rewrite"] | Literal["route"] | Literal["score"] | Literal["serve_error"] + | Literal["set_cache_settings"] | Literal["set_config"] | Literal["skip"] - | Literal["set_cache_settings"] - | Literal["log_custom_field"] - | Literal["ddos_dynamic"] - | Literal["force_connection_close"] - | NotGiven = NOT_GIVEN, + | Omit = omit, action_parameters: rule_edit_params.BlockRuleActionParameters | object - | rule_edit_params.CompressionRuleActionParameters + | rule_edit_params.ResponseCompressionRuleActionParameters | rule_edit_params.ExecuteRuleActionParameters + | rule_edit_params.LogCustomFieldRuleActionParameters | rule_edit_params.RedirectRuleActionParameters | rule_edit_params.RewriteRuleActionParameters - | rule_edit_params.OriginRuleActionParameters + | rule_edit_params.RouteRuleActionParameters | rule_edit_params.ScoreRuleActionParameters | rule_edit_params.ServeErrorRuleActionParameters - | rule_edit_params.SetConfigRuleActionParameters - | rule_edit_params.SkipRuleActionParameters | rule_edit_params.SetCacheSettingsRuleActionParameters - | rule_edit_params.LogCustomFieldRuleActionParameters - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, - expression: str | NotGiven = NOT_GIVEN, - logging: LoggingParam | NotGiven = NOT_GIVEN, - position: rule_edit_params.BlockRulePosition | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, - ref: str | NotGiven = NOT_GIVEN, + | rule_edit_params.SetConfigurationRuleActionParameters + | rule_edit_params.SkipRuleActionParameters + | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck + | rule_edit_params.ChallengeRuleExposedCredentialCheck + | rule_edit_params.ResponseCompressionRuleExposedCredentialCheck + | rule_edit_params.DDoSDynamicRuleExposedCredentialCheck + | rule_edit_params.ExecuteRuleExposedCredentialCheck + | rule_edit_params.ForceConnectionCloseRuleExposedCredentialCheck + | rule_edit_params.JavaScriptChallengeRuleExposedCredentialCheck + | rule_edit_params.LogRuleExposedCredentialCheck + | rule_edit_params.LogCustomFieldRuleExposedCredentialCheck + | rule_edit_params.ManagedChallengeRuleExposedCredentialCheck + | rule_edit_params.RedirectRuleExposedCredentialCheck + | rule_edit_params.RewriteRuleExposedCredentialCheck + | rule_edit_params.RouteRuleExposedCredentialCheck + | rule_edit_params.ScoreRuleExposedCredentialCheck + | rule_edit_params.ServeErrorRuleExposedCredentialCheck + | rule_edit_params.SetCacheSettingsRuleExposedCredentialCheck + | rule_edit_params.SetConfigurationRuleExposedCredentialCheck + | rule_edit_params.SkipRuleExposedCredentialCheck + | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.BlockRulePosition + | rule_edit_params.ChallengeRulePosition + | rule_edit_params.ResponseCompressionRulePosition + | rule_edit_params.DDoSDynamicRulePosition + | rule_edit_params.ExecuteRulePosition + | rule_edit_params.ForceConnectionCloseRulePosition + | rule_edit_params.JavaScriptChallengeRulePosition + | rule_edit_params.LogRulePosition + | rule_edit_params.LogCustomFieldRulePosition + | rule_edit_params.ManagedChallengeRulePosition + | rule_edit_params.RedirectRulePosition + | rule_edit_params.RewriteRulePosition + | rule_edit_params.RouteRulePosition + | rule_edit_params.ScoreRulePosition + | rule_edit_params.ServeErrorRulePosition + | rule_edit_params.SetCacheSettingsRulePosition + | rule_edit_params.SetConfigurationRulePosition + | rule_edit_params.SkipRulePosition + | Omit = omit, + ratelimit: rule_edit_params.BlockRuleRatelimit + | rule_edit_params.ChallengeRuleRatelimit + | rule_edit_params.ResponseCompressionRuleRatelimit + | rule_edit_params.DDoSDynamicRuleRatelimit + | rule_edit_params.ExecuteRuleRatelimit + | rule_edit_params.ForceConnectionCloseRuleRatelimit + | rule_edit_params.JavaScriptChallengeRuleRatelimit + | rule_edit_params.LogRuleRatelimit + | rule_edit_params.LogCustomFieldRuleRatelimit + | rule_edit_params.ManagedChallengeRuleRatelimit + | rule_edit_params.RedirectRuleRatelimit + | rule_edit_params.RewriteRuleRatelimit + | rule_edit_params.RouteRuleRatelimit + | rule_edit_params.ScoreRuleRatelimit + | rule_edit_params.ServeErrorRuleRatelimit + | rule_edit_params.SetCacheSettingsRuleRatelimit + | rule_edit_params.SetConfigurationRuleRatelimit + | rule_edit_params.SkipRuleRatelimit + | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RuleEditResponse: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") diff --git a/src/cloudflare/resources/rulesets/rulesets.py b/src/cloudflare/resources/rulesets/rulesets.py index 28e0816d76b..04dcee7244a 100644 --- a/src/cloudflare/resources/rulesets/rulesets.py +++ b/src/cloudflare/resources/rulesets/rulesets.py @@ -14,7 +14,7 @@ RulesResourceWithStreamingResponse, AsyncRulesResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .versions import ( VersionsResource, @@ -92,16 +92,16 @@ def create( kind: Kind, name: str, phase: Phase, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - rules: Iterable[ruleset_create_params.Rule] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RulesetCreateResponse: """ Creates a ruleset. @@ -167,19 +167,19 @@ def update( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - kind: Kind | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - phase: Phase | NotGiven = NOT_GIVEN, - rules: Iterable[ruleset_update_params.Rule] | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + description: str | Omit = omit, + kind: Kind | Omit = omit, + name: str | Omit = omit, + phase: Phase | Omit = omit, + rules: Iterable[ruleset_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RulesetUpdateResponse: """ Updates an account or zone ruleset, creating a new version. @@ -248,16 +248,16 @@ def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - cursor: str | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursorPagination[RulesetListResponse]: """ Fetches all rulesets. @@ -267,9 +267,9 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - cursor: Cursor to use for the next page. + cursor: The cursor to use for the next page. - per_page: Number of rulesets to return per page. + per_page: The number of rulesets to return per page. extra_headers: Send extra headers @@ -314,14 +314,14 @@ def delete( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes all versions of an existing account or zone ruleset. @@ -368,14 +368,14 @@ def get( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RulesetGetResponse: """ Fetches the latest version of an account or zone ruleset. @@ -460,16 +460,16 @@ async def create( kind: Kind, name: str, phase: Phase, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - rules: Iterable[ruleset_create_params.Rule] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RulesetCreateResponse: """ Creates a ruleset. @@ -535,19 +535,19 @@ async def update( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - kind: Kind | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - phase: Phase | NotGiven = NOT_GIVEN, - rules: Iterable[ruleset_update_params.Rule] | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + description: str | Omit = omit, + kind: Kind | Omit = omit, + name: str | Omit = omit, + phase: Phase | Omit = omit, + rules: Iterable[ruleset_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RulesetUpdateResponse: """ Updates an account or zone ruleset, creating a new version. @@ -616,16 +616,16 @@ async def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - cursor: str | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RulesetListResponse, AsyncCursorPagination[RulesetListResponse]]: """ Fetches all rulesets. @@ -635,9 +635,9 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - cursor: Cursor to use for the next page. + cursor: The cursor to use for the next page. - per_page: Number of rulesets to return per page. + per_page: The number of rulesets to return per page. extra_headers: Send extra headers @@ -682,14 +682,14 @@ async def delete( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes all versions of an existing account or zone ruleset. @@ -736,14 +736,14 @@ async def get( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RulesetGetResponse: """ Fetches the latest version of an account or zone ruleset. diff --git a/src/cloudflare/resources/rulesets/versions.py b/src/cloudflare/resources/rulesets/versions.py index 0e2c5cffa3e..3635e9594ce 100644 --- a/src/cloudflare/resources/rulesets/versions.py +++ b/src/cloudflare/resources/rulesets/versions.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -48,14 +48,14 @@ def list( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[VersionListResponse]: """ Fetches the versions of an account or zone ruleset. @@ -103,14 +103,14 @@ def delete( ruleset_version: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes an existing version of an account or zone ruleset. @@ -162,14 +162,14 @@ def get( ruleset_version: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ Fetches a specific version of an account or zone ruleset. @@ -244,14 +244,14 @@ def list( self, ruleset_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[VersionListResponse, AsyncSinglePage[VersionListResponse]]: """ Fetches the versions of an account or zone ruleset. @@ -299,14 +299,14 @@ async def delete( ruleset_version: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes an existing version of an account or zone ruleset. @@ -358,14 +358,14 @@ async def get( ruleset_version: str, *, ruleset_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ Fetches a specific version of an account or zone ruleset. diff --git a/src/cloudflare/resources/rum/rules.py b/src/cloudflare/resources/rum/rules.py index 017fb71fa15..d46b2bf9f63 100644 --- a/src/cloudflare/resources/rum/rules.py +++ b/src/cloudflare/resources/rum/rules.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Iterable, Optional, cast +from typing import Type, Iterable, Optional, cast import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,16 +52,16 @@ def create( ruleset_id: str, *, account_id: str, - host: str | NotGiven = NOT_GIVEN, - inclusive: bool | NotGiven = NOT_GIVEN, - is_paused: bool | NotGiven = NOT_GIVEN, - paths: List[str] | NotGiven = NOT_GIVEN, + host: str | Omit = omit, + inclusive: bool | Omit = omit, + is_paused: bool | Omit = omit, + paths: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RUMRule]: """ Creates a new rule in a Web Analytics ruleset. @@ -114,16 +114,16 @@ def update( *, account_id: str, ruleset_id: str, - host: str | NotGiven = NOT_GIVEN, - inclusive: bool | NotGiven = NOT_GIVEN, - is_paused: bool | NotGiven = NOT_GIVEN, - paths: List[str] | NotGiven = NOT_GIVEN, + host: str | Omit = omit, + inclusive: bool | Omit = omit, + is_paused: bool | Omit = omit, + paths: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RUMRule]: """ Updates a rule in a Web Analytics ruleset. @@ -184,7 +184,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleListResponse]: """ Lists all the rules in a Web Analytics ruleset. @@ -229,7 +229,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleDeleteResponse]: """ Deletes an existing rule from a Web Analytics ruleset. @@ -272,14 +272,14 @@ def bulk_create( ruleset_id: str, *, account_id: str, - delete_rules: List[str] | NotGiven = NOT_GIVEN, - rules: Iterable[rule_bulk_create_params.Rule] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleBulkCreateResponse]: """ Modifies one or more rules in a Web Analytics ruleset with a single request. @@ -350,16 +350,16 @@ async def create( ruleset_id: str, *, account_id: str, - host: str | NotGiven = NOT_GIVEN, - inclusive: bool | NotGiven = NOT_GIVEN, - is_paused: bool | NotGiven = NOT_GIVEN, - paths: List[str] | NotGiven = NOT_GIVEN, + host: str | Omit = omit, + inclusive: bool | Omit = omit, + is_paused: bool | Omit = omit, + paths: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RUMRule]: """ Creates a new rule in a Web Analytics ruleset. @@ -412,16 +412,16 @@ async def update( *, account_id: str, ruleset_id: str, - host: str | NotGiven = NOT_GIVEN, - inclusive: bool | NotGiven = NOT_GIVEN, - is_paused: bool | NotGiven = NOT_GIVEN, - paths: List[str] | NotGiven = NOT_GIVEN, + host: str | Omit = omit, + inclusive: bool | Omit = omit, + is_paused: bool | Omit = omit, + paths: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RUMRule]: """ Updates a rule in a Web Analytics ruleset. @@ -482,7 +482,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleListResponse]: """ Lists all the rules in a Web Analytics ruleset. @@ -527,7 +527,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleDeleteResponse]: """ Deletes an existing rule from a Web Analytics ruleset. @@ -570,14 +570,14 @@ async def bulk_create( ruleset_id: str, *, account_id: str, - delete_rules: List[str] | NotGiven = NOT_GIVEN, - rules: Iterable[rule_bulk_create_params.Rule] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleBulkCreateResponse]: """ Modifies one or more rules in a Web Analytics ruleset with a single request. diff --git a/src/cloudflare/resources/rum/site_info.py b/src/cloudflare/resources/rum/site_info.py index 271943542f5..0f4ca671a88 100644 --- a/src/cloudflare/resources/rum/site_info.py +++ b/src/cloudflare/resources/rum/site_info.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,15 +51,15 @@ def create( self, *, account_id: str, - auto_install: bool | NotGiven = NOT_GIVEN, - host: str | NotGiven = NOT_GIVEN, - zone_tag: str | NotGiven = NOT_GIVEN, + auto_install: bool | Omit = omit, + host: str | Omit = omit, + zone_tag: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Site]: """ Creates a new Web Analytics site. @@ -109,17 +109,17 @@ def update( site_id: str, *, account_id: str, - auto_install: bool | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - host: str | NotGiven = NOT_GIVEN, - lite: bool | NotGiven = NOT_GIVEN, - zone_tag: str | NotGiven = NOT_GIVEN, + auto_install: bool | Omit = omit, + enabled: bool | Omit = omit, + host: str | Omit = omit, + lite: bool | Omit = omit, + zone_tag: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Site]: """ Updates an existing Web Analytics site. @@ -180,15 +180,15 @@ def list( self, *, account_id: str, - order_by: Literal["host", "created"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + order_by: Literal["host", "created"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Site]: """ Lists all Web Analytics sites of an account. @@ -242,7 +242,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SiteInfoDeleteResponse]: """ Deletes an existing Web Analytics site. @@ -286,7 +286,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Site]: """ Retrieves a Web Analytics site. @@ -345,15 +345,15 @@ async def create( self, *, account_id: str, - auto_install: bool | NotGiven = NOT_GIVEN, - host: str | NotGiven = NOT_GIVEN, - zone_tag: str | NotGiven = NOT_GIVEN, + auto_install: bool | Omit = omit, + host: str | Omit = omit, + zone_tag: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Site]: """ Creates a new Web Analytics site. @@ -403,17 +403,17 @@ async def update( site_id: str, *, account_id: str, - auto_install: bool | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - host: str | NotGiven = NOT_GIVEN, - lite: bool | NotGiven = NOT_GIVEN, - zone_tag: str | NotGiven = NOT_GIVEN, + auto_install: bool | Omit = omit, + enabled: bool | Omit = omit, + host: str | Omit = omit, + lite: bool | Omit = omit, + zone_tag: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Site]: """ Updates an existing Web Analytics site. @@ -474,15 +474,15 @@ def list( self, *, account_id: str, - order_by: Literal["host", "created"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + order_by: Literal["host", "created"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Site, AsyncV4PagePaginationArray[Site]]: """ Lists all Web Analytics sites of an account. @@ -536,7 +536,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SiteInfoDeleteResponse]: """ Deletes an existing Web Analytics site. @@ -580,7 +580,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Site]: """ Retrieves a Web Analytics site. diff --git a/src/cloudflare/resources/schema_validation/schemas.py b/src/cloudflare/resources/schema_validation/schemas.py index a47974a15bb..eef468d2de7 100644 --- a/src/cloudflare/resources/schema_validation/schemas.py +++ b/src/cloudflare/resources/schema_validation/schemas.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -63,7 +63,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaCreateResponse: """ Upload a schema @@ -114,16 +114,16 @@ def list( self, *, zone_id: str, - omit_source: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - validation_enabled: bool | NotGiven = NOT_GIVEN, + omit_source: bool | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[SchemaListResponse]: """ List all uploaded schemas @@ -180,7 +180,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaDeleteResponse: """ Delete a schema @@ -219,13 +219,13 @@ def edit( schema_id: str, *, zone_id: str, - validation_enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaEditResponse: """ Edit details of a schema to enable validation @@ -267,13 +267,13 @@ def get( schema_id: str, *, zone_id: str, - omit_source: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaGetResponse: """ Get details of a schema @@ -344,7 +344,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaCreateResponse: """ Upload a schema @@ -395,16 +395,16 @@ def list( self, *, zone_id: str, - omit_source: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - validation_enabled: bool | NotGiven = NOT_GIVEN, + omit_source: bool | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SchemaListResponse, AsyncV4PagePaginationArray[SchemaListResponse]]: """ List all uploaded schemas @@ -461,7 +461,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaDeleteResponse: """ Delete a schema @@ -500,13 +500,13 @@ async def edit( schema_id: str, *, zone_id: str, - validation_enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaEditResponse: """ Edit details of a schema to enable validation @@ -550,13 +550,13 @@ async def get( schema_id: str, *, zone_id: str, - omit_source: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaGetResponse: """ Get details of a schema diff --git a/src/cloudflare/resources/schema_validation/settings/operations.py b/src/cloudflare/resources/schema_validation/settings/operations.py index 781ee165a69..1212c275f42 100644 --- a/src/cloudflare/resources/schema_validation/settings/operations.py +++ b/src/cloudflare/resources/schema_validation/settings/operations.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -65,7 +65,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationUpdateResponse: """ Update per-operation schema validation setting @@ -115,14 +115,14 @@ def list( self, *, zone_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[OperationListResponse]: """ List per-operation schema validation settings @@ -173,7 +173,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationDeleteResponse: """ Delete per-operation schema validation setting @@ -217,7 +217,7 @@ def bulk_edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationBulkEditResponse: """ Bulk edit per-operation schema validation settings @@ -258,7 +258,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationGetResponse: """ Get per-operation schema validation setting @@ -324,7 +324,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationUpdateResponse: """ Update per-operation schema validation setting @@ -374,14 +374,14 @@ def list( self, *, zone_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OperationListResponse, AsyncV4PagePaginationArray[OperationListResponse]]: """ List per-operation schema validation settings @@ -432,7 +432,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationDeleteResponse: """ Delete per-operation schema validation setting @@ -476,7 +476,7 @@ async def bulk_edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationBulkEditResponse: """ Bulk edit per-operation schema validation settings @@ -517,7 +517,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationGetResponse: """ Get per-operation schema validation setting diff --git a/src/cloudflare/resources/schema_validation/settings/settings.py b/src/cloudflare/resources/schema_validation/settings/settings.py index b1591105bbc..82b061c1624 100644 --- a/src/cloudflare/resources/schema_validation/settings/settings.py +++ b/src/cloudflare/resources/schema_validation/settings/settings.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .operations import ( @@ -64,13 +64,13 @@ def update( *, zone_id: str, validation_default_mitigation_action: Literal["none", "log", "block"], - validation_override_mitigation_action: Optional[Literal["none"]] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingUpdateResponse: """ Update global schema validation settings @@ -123,14 +123,14 @@ def edit( self, *, zone_id: str, - validation_default_mitigation_action: Literal["none", "log", "block"] | NotGiven = NOT_GIVEN, - validation_override_mitigation_action: Optional[Literal["none"]] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingEditResponse: """ Edit global schema validation settings @@ -188,7 +188,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingGetResponse: """ Get global schema validation settings @@ -248,13 +248,13 @@ async def update( *, zone_id: str, validation_default_mitigation_action: Literal["none", "log", "block"], - validation_override_mitigation_action: Optional[Literal["none"]] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingUpdateResponse: """ Update global schema validation settings @@ -307,14 +307,14 @@ async def edit( self, *, zone_id: str, - validation_default_mitigation_action: Literal["none", "log", "block"] | NotGiven = NOT_GIVEN, - validation_override_mitigation_action: Optional[Literal["none"]] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingEditResponse: """ Edit global schema validation settings @@ -372,7 +372,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingGetResponse: """ Get global schema validation settings diff --git a/src/cloudflare/resources/secrets_store/quota.py b/src/cloudflare/resources/secrets_store/quota.py index 8a93113f74c..65a7a0eff5a 100644 --- a/src/cloudflare/resources/secrets_store/quota.py +++ b/src/cloudflare/resources/secrets_store/quota.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[QuotaGetResponse]: """ Lists the number of secrets used in the account. @@ -111,7 +111,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[QuotaGetResponse]: """ Lists the number of secrets used in the account. diff --git a/src/cloudflare/resources/secrets_store/stores/secrets.py b/src/cloudflare/resources/secrets_store/stores/secrets.py index 81691e4f625..11d2698f1ce 100644 --- a/src/cloudflare/resources/secrets_store/stores/secrets.py +++ b/src/cloudflare/resources/secrets_store/stores/secrets.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Iterable, Optional, cast +from typing import Type, Iterable, Optional, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -68,7 +68,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SecretCreateResponse]: """ Creates a secret in the account @@ -106,17 +106,18 @@ def list( store_id: str, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["name", "comment", "created", "modified", "status"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["name", "comment", "created", "modified", "status"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + scopes: Iterable[SequenceNotStr[str]] | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[SecretListResponse]: """ Lists all store secrets @@ -134,6 +135,8 @@ def list( per_page: Number of objects to return per page + scopes: Only secrets with the given scopes will be returned + search: Search secrets using a filter string, filtering across name and comment extra_headers: Send extra headers @@ -162,6 +165,7 @@ def list( "order": order, "page": page, "per_page": per_page, + "scopes": scopes, "search": search, }, secret_list_params.SecretListParams, @@ -181,7 +185,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretDeleteResponse]: """ Deletes a single secret @@ -229,7 +233,7 @@ def bulk_delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SecretBulkDeleteResponse]: """ Deletes one or more secrets @@ -268,12 +272,14 @@ def duplicate( account_id: str, store_id: str, name: str, + scopes: SequenceNotStr[str], + comment: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretDuplicateResponse]: """ Duplicates the secret, keeping the value @@ -287,6 +293,10 @@ def duplicate( name: The name of the secret + scopes: The list of services that can use this secret. + + comment: Freeform text describing the secret + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -303,7 +313,14 @@ def duplicate( raise ValueError(f"Expected a non-empty value for `secret_id` but received {secret_id!r}") return self._post( f"/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}/duplicate", - body=maybe_transform({"name": name}, secret_duplicate_params.SecretDuplicateParams), + body=maybe_transform( + { + "name": name, + "scopes": scopes, + "comment": comment, + }, + secret_duplicate_params.SecretDuplicateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -320,15 +337,14 @@ def edit( *, account_id: str, store_id: str, - name: str, - scopes: List[str] | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + scopes: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretEditResponse]: """ Updates a single secret @@ -340,13 +356,10 @@ def edit( secret_id: Secret identifier tag. - name: The name of the secret + comment: Freeform text describing the secret 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. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -365,9 +378,8 @@ def edit( f"/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}", body=maybe_transform( { - "name": name, + "comment": comment, "scopes": scopes, - "value": value, }, secret_edit_params.SecretEditParams, ), @@ -392,7 +404,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretGetResponse]: """ Returns details of a single secret @@ -462,7 +474,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SecretCreateResponse, AsyncSinglePage[SecretCreateResponse]]: """ Creates a secret in the account @@ -500,17 +512,18 @@ def list( store_id: str, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["name", "comment", "created", "modified", "status"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["name", "comment", "created", "modified", "status"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + scopes: Iterable[SequenceNotStr[str]] | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SecretListResponse, AsyncV4PagePaginationArray[SecretListResponse]]: """ Lists all store secrets @@ -528,6 +541,8 @@ def list( per_page: Number of objects to return per page + scopes: Only secrets with the given scopes will be returned + search: Search secrets using a filter string, filtering across name and comment extra_headers: Send extra headers @@ -556,6 +571,7 @@ def list( "order": order, "page": page, "per_page": per_page, + "scopes": scopes, "search": search, }, secret_list_params.SecretListParams, @@ -575,7 +591,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretDeleteResponse]: """ Deletes a single secret @@ -623,7 +639,7 @@ def bulk_delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SecretBulkDeleteResponse, AsyncSinglePage[SecretBulkDeleteResponse]]: """ Deletes one or more secrets @@ -662,12 +678,14 @@ async def duplicate( account_id: str, store_id: str, name: str, + scopes: SequenceNotStr[str], + comment: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretDuplicateResponse]: """ Duplicates the secret, keeping the value @@ -681,6 +699,10 @@ async def duplicate( name: The name of the secret + scopes: The list of services that can use this secret. + + comment: Freeform text describing the secret + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -697,7 +719,14 @@ async def duplicate( raise ValueError(f"Expected a non-empty value for `secret_id` but received {secret_id!r}") return await self._post( f"/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}/duplicate", - body=await async_maybe_transform({"name": name}, secret_duplicate_params.SecretDuplicateParams), + body=await async_maybe_transform( + { + "name": name, + "scopes": scopes, + "comment": comment, + }, + secret_duplicate_params.SecretDuplicateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -714,15 +743,14 @@ async def edit( *, account_id: str, store_id: str, - name: str, - scopes: List[str] | NotGiven = NOT_GIVEN, - value: str | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + scopes: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretEditResponse]: """ Updates a single secret @@ -734,13 +762,10 @@ async def edit( secret_id: Secret identifier tag. - name: The name of the secret + comment: Freeform text describing the secret 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. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -759,9 +784,8 @@ async def edit( f"/accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}", body=await async_maybe_transform( { - "name": name, + "comment": comment, "scopes": scopes, - "value": value, }, secret_edit_params.SecretEditParams, ), @@ -786,7 +810,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretGetResponse]: """ Returns details of a single secret diff --git a/src/cloudflare/resources/secrets_store/stores/stores.py b/src/cloudflare/resources/secrets_store/stores/stores.py index a424093691e..73e3af0171f 100644 --- a/src/cloudflare/resources/secrets_store/stores/stores.py +++ b/src/cloudflare/resources/secrets_store/stores/stores.py @@ -15,7 +15,7 @@ SecretsResourceWithStreamingResponse, AsyncSecretsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -70,7 +70,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[StoreCreateResponse]: """ Creates a store in the account @@ -103,16 +103,16 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["name", "comment", "created", "modified", "status"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["name", "comment", "created", "modified", "status"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[StoreListResponse]: """ Lists all the stores in an account @@ -169,7 +169,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[StoreDeleteResponse]: """ Deletes a single store @@ -238,7 +238,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[StoreCreateResponse, AsyncSinglePage[StoreCreateResponse]]: """ Creates a store in the account @@ -271,16 +271,16 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["name", "comment", "created", "modified", "status"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["name", "comment", "created", "modified", "status"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[StoreListResponse, AsyncV4PagePaginationArray[StoreListResponse]]: """ Lists all the stores in an account @@ -337,7 +337,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[StoreDeleteResponse]: """ Deletes a single store diff --git a/src/cloudflare/resources/security_center/insights/class_.py b/src/cloudflare/resources/security_center/insights/class_.py index c57e1eb5910..beaaaec3809 100644 --- a/src/cloudflare/resources/security_center/insights/class_.py +++ b/src/cloudflare/resources/security_center/insights/class_.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,25 +49,25 @@ def with_streaming_response(self) -> ClassResourceWithStreamingResponse: def get( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + 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, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ClassGetResponse]: """ Get Security Center Insight Counts by Class @@ -149,25 +149,25 @@ def with_streaming_response(self) -> AsyncClassResourceWithStreamingResponse: async def get( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + 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, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ClassGetResponse]: """ Get Security Center Insight Counts by Class diff --git a/src/cloudflare/resources/security_center/insights/insights.py b/src/cloudflare/resources/security_center/insights/insights.py index aad741e3e6f..25f68026709 100644 --- a/src/cloudflare/resources/security_center/insights/insights.py +++ b/src/cloudflare/resources/security_center/insights/insights.py @@ -30,7 +30,7 @@ SeverityResourceWithStreamingResponse, AsyncSeverityResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -86,27 +86,27 @@ def with_streaming_response(self) -> InsightsResourceWithStreamingResponse: def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + 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, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[Optional[InsightListResponse]]: """ Get Security Center Insights @@ -174,15 +174,15 @@ def dismiss( self, issue_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismiss: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InsightDismissResponse: """ Archive Security Center Insight @@ -259,27 +259,27 @@ def with_streaming_response(self) -> AsyncInsightsResourceWithStreamingResponse: def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + 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, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[InsightListResponse], AsyncV4PagePagination[Optional[InsightListResponse]]]: """ Get Security Center Insights @@ -347,15 +347,15 @@ async def dismiss( self, issue_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismiss: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InsightDismissResponse: """ Archive Security Center Insight diff --git a/src/cloudflare/resources/security_center/insights/severity.py b/src/cloudflare/resources/security_center/insights/severity.py index b62ccde3677..5e3b4bdb125 100644 --- a/src/cloudflare/resources/security_center/insights/severity.py +++ b/src/cloudflare/resources/security_center/insights/severity.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,25 +49,25 @@ def with_streaming_response(self) -> SeverityResourceWithStreamingResponse: def get( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + 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, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SeverityGetResponse]: """ Get Security Center Insight Counts by Severity @@ -149,25 +149,25 @@ def with_streaming_response(self) -> AsyncSeverityResourceWithStreamingResponse: async def get( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + 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, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SeverityGetResponse]: """ Get Security Center Insight Counts by Severity diff --git a/src/cloudflare/resources/security_center/insights/type.py b/src/cloudflare/resources/security_center/insights/type.py index 02652b10c31..ef3e4327ec8 100644 --- a/src/cloudflare/resources/security_center/insights/type.py +++ b/src/cloudflare/resources/security_center/insights/type.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,25 +49,25 @@ def with_streaming_response(self) -> TypeResourceWithStreamingResponse: def get( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + 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, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TypeGetResponse]: """ Get Security Center Insight Counts by Type @@ -149,25 +149,25 @@ def with_streaming_response(self) -> AsyncTypeResourceWithStreamingResponse: async def get( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - dismissed: bool | NotGiven = NOT_GIVEN, - issue_class: List[str] | NotGiven = NOT_GIVEN, - issue_class_neq: List[str] | NotGiven = NOT_GIVEN, - issue_type: List[IssueType] | NotGiven = NOT_GIVEN, - issue_type_neq: List[IssueType] | NotGiven = NOT_GIVEN, - product: List[str] | NotGiven = NOT_GIVEN, - product_neq: List[str] | NotGiven = NOT_GIVEN, - severity: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - severity_neq: List[SeverityQueryParam] | NotGiven = NOT_GIVEN, - subject: List[str] | NotGiven = NOT_GIVEN, - subject_neq: List[str] | NotGiven = NOT_GIVEN, + 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, + issue_type: List[IssueType] | Omit = omit, + issue_type_neq: List[IssueType] | Omit = omit, + product: SequenceNotStr[str] | Omit = omit, + product_neq: SequenceNotStr[str] | Omit = omit, + severity: List[SeverityQueryParam] | Omit = omit, + severity_neq: List[SeverityQueryParam] | Omit = omit, + subject: SequenceNotStr[str] | Omit = omit, + subject_neq: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TypeGetResponse]: """ Get Security Center Insight Counts by Type diff --git a/src/cloudflare/resources/security_txt.py b/src/cloudflare/resources/security_txt.py index efcba5441c8..07ecb6adbde 100644 --- a/src/cloudflare/resources/security_txt.py +++ b/src/cloudflare/resources/security_txt.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +from typing import Type, Union, Optional, cast from datetime import datetime import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,21 +51,21 @@ def update( self, *, zone_id: str, - acknowledgments: List[str] | NotGiven = NOT_GIVEN, - canonical: List[str] | NotGiven = NOT_GIVEN, - contact: List[str] | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - encryption: List[str] | NotGiven = NOT_GIVEN, - expires: Union[str, datetime] | NotGiven = NOT_GIVEN, - hiring: List[str] | NotGiven = NOT_GIVEN, - policy: List[str] | NotGiven = NOT_GIVEN, - preferred_languages: str | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecurityTXTUpdateResponse: """ Update security.txt @@ -114,7 +114,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecurityTXTDeleteResponse: """ Delete security.txt @@ -149,7 +149,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecurityTXTGetResponse]: """ Get security.txt @@ -204,21 +204,21 @@ async def update( self, *, zone_id: str, - acknowledgments: List[str] | NotGiven = NOT_GIVEN, - canonical: List[str] | NotGiven = NOT_GIVEN, - contact: List[str] | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - encryption: List[str] | NotGiven = NOT_GIVEN, - expires: Union[str, datetime] | NotGiven = NOT_GIVEN, - hiring: List[str] | NotGiven = NOT_GIVEN, - policy: List[str] | NotGiven = NOT_GIVEN, - preferred_languages: str | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecurityTXTUpdateResponse: """ Update security.txt @@ -267,7 +267,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecurityTXTDeleteResponse: """ Delete security.txt @@ -302,7 +302,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecurityTXTGetResponse]: """ Get security.txt diff --git a/src/cloudflare/resources/snippets/content.py b/src/cloudflare/resources/snippets/content.py index 92f1ffef2f8..be4473336d9 100644 --- a/src/cloudflare/resources/snippets/content.py +++ b/src/cloudflare/resources/snippets/content.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -52,15 +52,15 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """ - Snippet Content + Fetches the content of a snippet belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. - snippet_name: Snippet identifying name + snippet_name: The identifying name of the snippet. extra_headers: Send extra headers @@ -114,15 +114,15 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """ - Snippet Content + Fetches the content of a snippet belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. - snippet_name: Snippet identifying name + snippet_name: The identifying name of the snippet. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/snippets/rules.py b/src/cloudflare/resources/snippets/rules.py index 51785fd67ab..60f627b1c83 100644 --- a/src/cloudflare/resources/snippets/rules.py +++ b/src/cloudflare/resources/snippets/rules.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -50,21 +50,21 @@ def update( self, *, zone_id: str, - rules: Iterable[rule_update_params.Rule] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[RuleUpdateResponse]: """ - Put Rules + Updates all snippet rules belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. - rules: List of snippet rules + rules: A list of snippet rules. extra_headers: Send extra headers @@ -96,13 +96,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[RuleListResponse]: """ - Rules + Fetches all snippet rules belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. extra_headers: Send extra headers @@ -132,13 +132,13 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RuleDeleteResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncSinglePage[RuleDeleteResponse]: """ - Delete All Rules + Deletes all snippet rules belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. extra_headers: Send extra headers @@ -150,12 +150,14 @@ def delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._delete( + return self._get_api_list( f"/zones/{zone_id}/snippets/snippet_rules", + page=SyncSinglePage[RuleDeleteResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RuleDeleteResponse, + model=RuleDeleteResponse, + method="delete", ) @@ -183,21 +185,21 @@ def update( self, *, zone_id: str, - rules: Iterable[rule_update_params.Rule] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RuleUpdateResponse, AsyncSinglePage[RuleUpdateResponse]]: """ - Put Rules + Updates all snippet rules belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. - rules: List of snippet rules + rules: A list of snippet rules. extra_headers: Send extra headers @@ -229,13 +231,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RuleListResponse, AsyncSinglePage[RuleListResponse]]: """ - Rules + Fetches all snippet rules belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. extra_headers: Send extra headers @@ -256,7 +258,7 @@ def list( model=RuleListResponse, ) - async def delete( + def delete( self, *, zone_id: str, @@ -265,13 +267,13 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RuleDeleteResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[RuleDeleteResponse, AsyncSinglePage[RuleDeleteResponse]]: """ - Delete All Rules + Deletes all snippet rules belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. extra_headers: Send extra headers @@ -283,12 +285,14 @@ async def delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return await self._delete( + return self._get_api_list( f"/zones/{zone_id}/snippets/snippet_rules", + page=AsyncSinglePage[RuleDeleteResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RuleDeleteResponse, + model=RuleDeleteResponse, + method="delete", ) diff --git a/src/cloudflare/resources/snippets/snippets.py b/src/cloudflare/resources/snippets/snippets.py index 98fb8e4aa61..aa40465dcb3 100644 --- a/src/cloudflare/resources/snippets/snippets.py +++ b/src/cloudflare/resources/snippets/snippets.py @@ -22,7 +22,7 @@ ContentResourceWithStreamingResponse, AsyncContentResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -33,11 +33,13 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...pagination import SyncSinglePage, AsyncSinglePage +from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ..._base_client import AsyncPaginator, make_request_options -from ...types.snippets import snippet_update_params -from ...types.snippets.snippet import Snippet +from ...types.snippets import snippet_list_params, snippet_update_params +from ...types.snippets.snippet_get_response import SnippetGetResponse +from ...types.snippets.snippet_list_response import SnippetListResponse from ...types.snippets.snippet_delete_response import SnippetDeleteResponse +from ...types.snippets.snippet_update_response import SnippetUpdateResponse __all__ = ["SnippetsResource", "AsyncSnippetsResource"] @@ -75,24 +77,23 @@ def update( snippet_name: str, *, zone_id: str, - files: str | NotGiven = NOT_GIVEN, - metadata: snippet_update_params.Metadata | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Snippet]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SnippetUpdateResponse: """ - Put Snippet + Creates or updates a snippet belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. - snippet_name: Snippet identifying name + snippet_name: The identifying name of the snippet. - files: Content files of uploaded snippet + metadata: Metadata about the snippet. extra_headers: Send extra headers @@ -112,39 +113,40 @@ def update( extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._put( f"/zones/{zone_id}/snippets/{snippet_name}", - body=maybe_transform( - { - "files": files, - "metadata": metadata, - }, - snippet_update_params.SnippetUpdateParams, - ), + body=maybe_transform({"metadata": metadata}, snippet_update_params.SnippetUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Snippet]]._unwrapper, + multipart_syntax="json", + post_parser=ResultWrapper[SnippetUpdateResponse]._unwrapper, ), - cast_to=cast(Type[Optional[Snippet]], ResultWrapper[Snippet]), + cast_to=cast(Type[SnippetUpdateResponse], ResultWrapper[SnippetUpdateResponse]), ) def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[Snippet]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[SnippetListResponse]: """ - All Snippets + Fetches all snippets belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. + + page: The current page number. + + per_page: The number of results to return per page. extra_headers: Send extra headers @@ -158,11 +160,21 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/snippets", - page=SyncSinglePage[Snippet], + page=SyncV4PagePaginationArray[SnippetListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + snippet_list_params.SnippetListParams, + ), ), - model=Snippet, + model=SnippetListResponse, ) def delete( @@ -175,15 +187,15 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SnippetDeleteResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> str: """ - Delete Snippet + Deletes a snippet belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. - snippet_name: Snippet identifying name + snippet_name: The identifying name of the snippet. extra_headers: Send extra headers @@ -200,9 +212,13 @@ def delete( return self._delete( f"/zones/{zone_id}/snippets/{snippet_name}", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[SnippetDeleteResponse]]._unwrapper, ), - cast_to=SnippetDeleteResponse, + cast_to=cast(Type[str], ResultWrapper[str]), ) def get( @@ -215,15 +231,15 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Snippet]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SnippetGetResponse: """ - Snippet + Fetches a snippet belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. - snippet_name: Snippet identifying name + snippet_name: The identifying name of the snippet. extra_headers: Send extra headers @@ -244,9 +260,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Snippet]]._unwrapper, + post_parser=ResultWrapper[SnippetGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[Snippet]], ResultWrapper[Snippet]), + cast_to=cast(Type[SnippetGetResponse], ResultWrapper[SnippetGetResponse]), ) @@ -283,24 +299,23 @@ async def update( snippet_name: str, *, zone_id: str, - files: str | NotGiven = NOT_GIVEN, - metadata: snippet_update_params.Metadata | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Snippet]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SnippetUpdateResponse: """ - Put Snippet + Creates or updates a snippet belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. - snippet_name: Snippet identifying name + snippet_name: The identifying name of the snippet. - files: Content files of uploaded snippet + metadata: Metadata about the snippet. extra_headers: Send extra headers @@ -320,39 +335,40 @@ async def update( extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._put( f"/zones/{zone_id}/snippets/{snippet_name}", - body=await async_maybe_transform( - { - "files": files, - "metadata": metadata, - }, - snippet_update_params.SnippetUpdateParams, - ), + body=await async_maybe_transform({"metadata": metadata}, snippet_update_params.SnippetUpdateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Snippet]]._unwrapper, + multipart_syntax="json", + post_parser=ResultWrapper[SnippetUpdateResponse]._unwrapper, ), - cast_to=cast(Type[Optional[Snippet]], ResultWrapper[Snippet]), + cast_to=cast(Type[SnippetUpdateResponse], ResultWrapper[SnippetUpdateResponse]), ) def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[Snippet, AsyncSinglePage[Snippet]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[SnippetListResponse, AsyncV4PagePaginationArray[SnippetListResponse]]: """ - All Snippets + Fetches all snippets belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. + + page: The current page number. + + per_page: The number of results to return per page. extra_headers: Send extra headers @@ -366,11 +382,21 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/snippets", - page=AsyncSinglePage[Snippet], + page=AsyncV4PagePaginationArray[SnippetListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + snippet_list_params.SnippetListParams, + ), ), - model=Snippet, + model=SnippetListResponse, ) async def delete( @@ -383,15 +409,15 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SnippetDeleteResponse: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> str: """ - Delete Snippet + Deletes a snippet belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. - snippet_name: Snippet identifying name + snippet_name: The identifying name of the snippet. extra_headers: Send extra headers @@ -408,9 +434,13 @@ async def delete( return await self._delete( f"/zones/{zone_id}/snippets/{snippet_name}", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[SnippetDeleteResponse]]._unwrapper, ), - cast_to=SnippetDeleteResponse, + cast_to=cast(Type[str], ResultWrapper[str]), ) async def get( @@ -423,15 +453,15 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Snippet]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SnippetGetResponse: """ - Snippet + Fetches a snippet belonging to the zone. Args: - zone_id: Identifier + zone_id: The unique ID of the zone. - snippet_name: Snippet identifying name + snippet_name: The identifying name of the snippet. extra_headers: Send extra headers @@ -452,9 +482,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Snippet]]._unwrapper, + post_parser=ResultWrapper[SnippetGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[Snippet]], ResultWrapper[Snippet]), + cast_to=cast(Type[SnippetGetResponse], ResultWrapper[SnippetGetResponse]), ) diff --git a/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py b/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py index 43859442389..6d4e68dec73 100644 --- a/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py +++ b/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,14 +48,14 @@ def get( self, *, zone_id: str, - app_id: str | NotGiven = NOT_GIVEN, - colo_name: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CurrentGetResponse]: """ Retrieves analytics aggregated from the last minute of usage on Spectrum @@ -123,14 +123,14 @@ async def get( self, *, zone_id: str, - app_id: str | NotGiven = NOT_GIVEN, - colo_name: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CurrentGetResponse]: """ Retrieves analytics aggregated from the last minute of usage on Spectrum diff --git a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py index 02d44316420..4eed5839911 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py +++ b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,23 +52,23 @@ def get( *, zone_id: str, time_delta: Literal["year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"], - dimensions: List[Dimension] | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, + dimensions: List[Dimension] | Omit = omit, + filters: str | Omit = omit, metrics: List[ Literal[ "count", "bytesIngress", "bytesEgress", "durationAvg", "durationMedian", "duration90th", "duration99th" ] ] - | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: List[str] | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: SequenceNotStr[str] | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BytimeGetResponse]: """ Retrieves a list of aggregate metrics grouped by time interval. @@ -186,23 +186,23 @@ async def get( *, zone_id: str, time_delta: Literal["year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"], - dimensions: List[Dimension] | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, + dimensions: List[Dimension] | Omit = omit, + filters: str | Omit = omit, metrics: List[ Literal[ "count", "bytesIngress", "bytesEgress", "durationAvg", "durationMedian", "duration90th", "duration99th" ] ] - | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: List[str] | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: SequenceNotStr[str] | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BytimeGetResponse]: """ Retrieves a list of aggregate metrics grouped by time interval. diff --git a/src/cloudflare/resources/spectrum/analytics/events/summaries.py b/src/cloudflare/resources/spectrum/analytics/events/summaries.py index 570a43d52b8..8c66f98dad7 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/summaries.py +++ b/src/cloudflare/resources/spectrum/analytics/events/summaries.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,23 +51,23 @@ def get( self, *, zone_id: str, - dimensions: List[Dimension] | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, + dimensions: List[Dimension] | Omit = omit, + filters: str | Omit = omit, metrics: List[ Literal[ "count", "bytesIngress", "bytesEgress", "durationAvg", "durationMedian", "duration90th", "duration99th" ] ] - | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: List[str] | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: SequenceNotStr[str] | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SummaryGetResponse]: """ Retrieves a list of summarised aggregate metrics over a given time period. @@ -181,23 +181,23 @@ async def get( self, *, zone_id: str, - dimensions: List[Dimension] | NotGiven = NOT_GIVEN, - filters: str | NotGiven = NOT_GIVEN, + dimensions: List[Dimension] | Omit = omit, + filters: str | Omit = omit, metrics: List[ Literal[ "count", "bytesIngress", "bytesEgress", "durationAvg", "durationMedian", "duration90th", "duration99th" ] ] - | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - sort: List[str] | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + | Omit = omit, + since: Union[str, datetime] | Omit = omit, + sort: SequenceNotStr[str] | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SummaryGetResponse]: """ Retrieves a list of summarised aggregate metrics over a given time period. diff --git a/src/cloudflare/resources/spectrum/apps.py b/src/cloudflare/resources/spectrum/apps.py index 63a56b7ec41..72ebe0c4bfa 100644 --- a/src/cloudflare/resources/spectrum/apps.py +++ b/src/cloudflare/resources/spectrum/apps.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Any, List, Type, Optional, cast +from typing import Any, Type, Optional, cast from typing_extensions import Literal, overload import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -60,22 +60,22 @@ def create( *, zone_id: str, dns: DNSParam, - ip_firewall: bool, protocol: str, - proxy_protocol: Literal["off", "v1", "v2", "simple"], - tls: Literal["off", "flexible", "full", "strict"], traffic_type: Literal["direct", "http", "https"], - argo_smart_routing: bool | NotGiven = NOT_GIVEN, - edge_ips: EdgeIPsParam | NotGiven = NOT_GIVEN, - origin_direct: List[str] | NotGiven = NOT_GIVEN, - origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, - origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + argo_smart_routing: bool | Omit = omit, + edge_ips: EdgeIPsParam | Omit = omit, + ip_firewall: bool | Omit = omit, + origin_direct: SequenceNotStr[str] | Omit = omit, + origin_dns: OriginDNSParam | Omit = omit, + origin_port: OriginPortParam | Omit = omit, + proxy_protocol: Literal["off", "v1", "v2", "simple"] | Omit = omit, + tls: Literal["off", "flexible", "full", "strict"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppCreateResponse]: """ Creates a new Spectrum application from a configuration using a name for the @@ -86,19 +86,9 @@ def create( dns: The name and type of DNS record for the Spectrum application. - ip_firewall: Enables IP Access Rules for this application. Notes: Only available for TCP - applications. - protocol: The port configuration at Cloudflare's edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. - proxy_protocol: Enables Proxy Protocol to the origin. Refer to - [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) - for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple - Proxy Protocol. - - tls: The type of TLS termination associated with the application. - traffic_type: Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol`. When set to "http" or "https", Spectrum will @@ -110,6 +100,9 @@ def create( edge_ips: The anycast edge IP configuration for the hostname of this application. + ip_firewall: Enables IP Access Rules for this application. Notes: Only available for TCP + applications. + origin_direct: List of origin IP addresses. Array may contain multiple IP addresses for load balancing. @@ -121,6 +114,13 @@ def create( `"1000-2000"`. Notes: If specifying a port range, the number of ports in the range must match the number of ports specified in the "protocol" field. + proxy_protocol: Enables Proxy Protocol to the origin. Refer to + [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) + for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple + Proxy Protocol. + + tls: The type of TLS termination associated with the application. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -138,13 +138,13 @@ def create( zone_id: str, dns: DNSParam, protocol: str, - origin_direct: List[str] | NotGiven = NOT_GIVEN, + origin_direct: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppCreateResponse]: """ Creates a new Spectrum application from a configuration using a name for the @@ -171,31 +171,28 @@ def create( """ ... - @required_args( - ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "dns", "protocol"], - ) + @required_args(["zone_id", "dns", "protocol", "traffic_type"], ["zone_id", "dns", "protocol"]) def create( self, *, zone_id: str, dns: DNSParam, - ip_firewall: bool | NotGiven = NOT_GIVEN, protocol: str, - proxy_protocol: Literal["off", "v1", "v2", "simple"] | NotGiven = NOT_GIVEN, - tls: Literal["off", "flexible", "full", "strict"] | NotGiven = NOT_GIVEN, - traffic_type: Literal["direct", "http", "https"] | NotGiven = NOT_GIVEN, - argo_smart_routing: bool | NotGiven = NOT_GIVEN, - edge_ips: EdgeIPsParam | NotGiven = NOT_GIVEN, - origin_direct: List[str] | NotGiven = NOT_GIVEN, - origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, - origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + traffic_type: Literal["direct", "http", "https"] | Omit = omit, + argo_smart_routing: bool | Omit = omit, + edge_ips: EdgeIPsParam | Omit = omit, + ip_firewall: bool | Omit = omit, + origin_direct: SequenceNotStr[str] | Omit = omit, + origin_dns: OriginDNSParam | Omit = omit, + origin_port: OriginPortParam | Omit = omit, + proxy_protocol: Literal["off", "v1", "v2", "simple"] | Omit = omit, + tls: Literal["off", "flexible", "full", "strict"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppCreateResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -206,16 +203,16 @@ def create( body=maybe_transform( { "dns": dns, - "ip_firewall": ip_firewall, "protocol": protocol, - "proxy_protocol": proxy_protocol, - "tls": tls, "traffic_type": traffic_type, "argo_smart_routing": argo_smart_routing, "edge_ips": edge_ips, + "ip_firewall": ip_firewall, "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, + "proxy_protocol": proxy_protocol, + "tls": tls, }, app_create_params.AppCreateParams, ), @@ -239,22 +236,22 @@ def update( *, zone_id: str, dns: DNSParam, - ip_firewall: bool, protocol: str, - proxy_protocol: Literal["off", "v1", "v2", "simple"], - tls: Literal["off", "flexible", "full", "strict"], traffic_type: Literal["direct", "http", "https"], - argo_smart_routing: bool | NotGiven = NOT_GIVEN, - edge_ips: EdgeIPsParam | NotGiven = NOT_GIVEN, - origin_direct: List[str] | NotGiven = NOT_GIVEN, - origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, - origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + argo_smart_routing: bool | Omit = omit, + edge_ips: EdgeIPsParam | Omit = omit, + ip_firewall: bool | Omit = omit, + origin_direct: SequenceNotStr[str] | Omit = omit, + origin_dns: OriginDNSParam | Omit = omit, + origin_port: OriginPortParam | Omit = omit, + proxy_protocol: Literal["off", "v1", "v2", "simple"] | Omit = omit, + tls: Literal["off", "flexible", "full", "strict"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppUpdateResponse]: """ Updates a previously existing application's configuration that uses a name for @@ -267,19 +264,9 @@ def update( dns: The name and type of DNS record for the Spectrum application. - ip_firewall: Enables IP Access Rules for this application. Notes: Only available for TCP - applications. - protocol: The port configuration at Cloudflare's edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. - proxy_protocol: Enables Proxy Protocol to the origin. Refer to - [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) - for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple - Proxy Protocol. - - tls: The type of TLS termination associated with the application. - traffic_type: Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol`. When set to "http" or "https", Spectrum will @@ -291,6 +278,9 @@ def update( edge_ips: The anycast edge IP configuration for the hostname of this application. + ip_firewall: Enables IP Access Rules for this application. Notes: Only available for TCP + applications. + origin_direct: List of origin IP addresses. Array may contain multiple IP addresses for load balancing. @@ -302,6 +292,13 @@ def update( `"1000-2000"`. Notes: If specifying a port range, the number of ports in the range must match the number of ports specified in the "protocol" field. + proxy_protocol: Enables Proxy Protocol to the origin. Refer to + [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) + for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple + Proxy Protocol. + + tls: The type of TLS termination associated with the application. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -320,13 +317,13 @@ def update( zone_id: str, dns: DNSParam, protocol: str, - origin_direct: List[str] | NotGiven = NOT_GIVEN, + origin_direct: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppUpdateResponse]: """ Updates a previously existing application's configuration that uses a name for @@ -355,32 +352,29 @@ def update( """ ... - @required_args( - ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "dns", "protocol"], - ) + @required_args(["zone_id", "dns", "protocol", "traffic_type"], ["zone_id", "dns", "protocol"]) def update( self, app_id: str, *, zone_id: str, dns: DNSParam, - ip_firewall: bool | NotGiven = NOT_GIVEN, protocol: str, - proxy_protocol: Literal["off", "v1", "v2", "simple"] | NotGiven = NOT_GIVEN, - tls: Literal["off", "flexible", "full", "strict"] | NotGiven = NOT_GIVEN, - traffic_type: Literal["direct", "http", "https"] | NotGiven = NOT_GIVEN, - argo_smart_routing: bool | NotGiven = NOT_GIVEN, - edge_ips: EdgeIPsParam | NotGiven = NOT_GIVEN, - origin_direct: List[str] | NotGiven = NOT_GIVEN, - origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, - origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + traffic_type: Literal["direct", "http", "https"] | Omit = omit, + argo_smart_routing: bool | Omit = omit, + edge_ips: EdgeIPsParam | Omit = omit, + ip_firewall: bool | Omit = omit, + origin_direct: SequenceNotStr[str] | Omit = omit, + origin_dns: OriginDNSParam | Omit = omit, + origin_port: OriginPortParam | Omit = omit, + proxy_protocol: Literal["off", "v1", "v2", "simple"] | Omit = omit, + tls: Literal["off", "flexible", "full", "strict"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppUpdateResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -393,16 +387,16 @@ def update( body=maybe_transform( { "dns": dns, - "ip_firewall": ip_firewall, "protocol": protocol, - "proxy_protocol": proxy_protocol, - "tls": tls, "traffic_type": traffic_type, "argo_smart_routing": argo_smart_routing, "edge_ips": edge_ips, + "ip_firewall": ip_firewall, "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, + "proxy_protocol": proxy_protocol, + "tls": tls, }, app_update_params.AppUpdateParams, ), @@ -423,16 +417,16 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["protocol", "app_id", "created_on", "modified_on", "dns"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["protocol", "app_id", "created_on", "modified_on", "dns"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Optional[AppListResponse]]: """ Retrieves a list of currently existing Spectrum applications inside a zone. @@ -491,7 +485,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppDeleteResponse]: """ Deletes a previously existing application. @@ -535,7 +529,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppGetResponse]: """ Gets the application configuration of a specific application inside a zone. @@ -601,22 +595,22 @@ async def create( *, zone_id: str, dns: DNSParam, - ip_firewall: bool, protocol: str, - proxy_protocol: Literal["off", "v1", "v2", "simple"], - tls: Literal["off", "flexible", "full", "strict"], traffic_type: Literal["direct", "http", "https"], - argo_smart_routing: bool | NotGiven = NOT_GIVEN, - edge_ips: EdgeIPsParam | NotGiven = NOT_GIVEN, - origin_direct: List[str] | NotGiven = NOT_GIVEN, - origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, - origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + argo_smart_routing: bool | Omit = omit, + edge_ips: EdgeIPsParam | Omit = omit, + ip_firewall: bool | Omit = omit, + origin_direct: SequenceNotStr[str] | Omit = omit, + origin_dns: OriginDNSParam | Omit = omit, + origin_port: OriginPortParam | Omit = omit, + proxy_protocol: Literal["off", "v1", "v2", "simple"] | Omit = omit, + tls: Literal["off", "flexible", "full", "strict"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppCreateResponse]: """ Creates a new Spectrum application from a configuration using a name for the @@ -627,19 +621,9 @@ async def create( dns: The name and type of DNS record for the Spectrum application. - ip_firewall: Enables IP Access Rules for this application. Notes: Only available for TCP - applications. - protocol: The port configuration at Cloudflare's edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. - proxy_protocol: Enables Proxy Protocol to the origin. Refer to - [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) - for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple - Proxy Protocol. - - tls: The type of TLS termination associated with the application. - traffic_type: Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol`. When set to "http" or "https", Spectrum will @@ -651,6 +635,9 @@ async def create( edge_ips: The anycast edge IP configuration for the hostname of this application. + ip_firewall: Enables IP Access Rules for this application. Notes: Only available for TCP + applications. + origin_direct: List of origin IP addresses. Array may contain multiple IP addresses for load balancing. @@ -662,6 +649,13 @@ async def create( `"1000-2000"`. Notes: If specifying a port range, the number of ports in the range must match the number of ports specified in the "protocol" field. + proxy_protocol: Enables Proxy Protocol to the origin. Refer to + [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) + for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple + Proxy Protocol. + + tls: The type of TLS termination associated with the application. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -679,13 +673,13 @@ async def create( zone_id: str, dns: DNSParam, protocol: str, - origin_direct: List[str] | NotGiven = NOT_GIVEN, + origin_direct: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppCreateResponse]: """ Creates a new Spectrum application from a configuration using a name for the @@ -712,31 +706,28 @@ async def create( """ ... - @required_args( - ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "dns", "protocol"], - ) + @required_args(["zone_id", "dns", "protocol", "traffic_type"], ["zone_id", "dns", "protocol"]) async def create( self, *, zone_id: str, dns: DNSParam, - ip_firewall: bool | NotGiven = NOT_GIVEN, protocol: str, - proxy_protocol: Literal["off", "v1", "v2", "simple"] | NotGiven = NOT_GIVEN, - tls: Literal["off", "flexible", "full", "strict"] | NotGiven = NOT_GIVEN, - traffic_type: Literal["direct", "http", "https"] | NotGiven = NOT_GIVEN, - argo_smart_routing: bool | NotGiven = NOT_GIVEN, - edge_ips: EdgeIPsParam | NotGiven = NOT_GIVEN, - origin_direct: List[str] | NotGiven = NOT_GIVEN, - origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, - origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + traffic_type: Literal["direct", "http", "https"] | Omit = omit, + argo_smart_routing: bool | Omit = omit, + edge_ips: EdgeIPsParam | Omit = omit, + ip_firewall: bool | Omit = omit, + origin_direct: SequenceNotStr[str] | Omit = omit, + origin_dns: OriginDNSParam | Omit = omit, + origin_port: OriginPortParam | Omit = omit, + proxy_protocol: Literal["off", "v1", "v2", "simple"] | Omit = omit, + tls: Literal["off", "flexible", "full", "strict"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppCreateResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -747,16 +738,16 @@ async def create( body=await async_maybe_transform( { "dns": dns, - "ip_firewall": ip_firewall, "protocol": protocol, - "proxy_protocol": proxy_protocol, - "tls": tls, "traffic_type": traffic_type, "argo_smart_routing": argo_smart_routing, "edge_ips": edge_ips, + "ip_firewall": ip_firewall, "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, + "proxy_protocol": proxy_protocol, + "tls": tls, }, app_create_params.AppCreateParams, ), @@ -780,22 +771,22 @@ async def update( *, zone_id: str, dns: DNSParam, - ip_firewall: bool, protocol: str, - proxy_protocol: Literal["off", "v1", "v2", "simple"], - tls: Literal["off", "flexible", "full", "strict"], traffic_type: Literal["direct", "http", "https"], - argo_smart_routing: bool | NotGiven = NOT_GIVEN, - edge_ips: EdgeIPsParam | NotGiven = NOT_GIVEN, - origin_direct: List[str] | NotGiven = NOT_GIVEN, - origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, - origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + argo_smart_routing: bool | Omit = omit, + edge_ips: EdgeIPsParam | Omit = omit, + ip_firewall: bool | Omit = omit, + origin_direct: SequenceNotStr[str] | Omit = omit, + origin_dns: OriginDNSParam | Omit = omit, + origin_port: OriginPortParam | Omit = omit, + proxy_protocol: Literal["off", "v1", "v2", "simple"] | Omit = omit, + tls: Literal["off", "flexible", "full", "strict"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppUpdateResponse]: """ Updates a previously existing application's configuration that uses a name for @@ -808,19 +799,9 @@ async def update( dns: The name and type of DNS record for the Spectrum application. - ip_firewall: Enables IP Access Rules for this application. Notes: Only available for TCP - applications. - protocol: The port configuration at Cloudflare's edge. May specify a single port, for example `"tcp/1000"`, or a range of ports, for example `"tcp/1000-2000"`. - proxy_protocol: Enables Proxy Protocol to the origin. Refer to - [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) - for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple - Proxy Protocol. - - tls: The type of TLS termination associated with the application. - traffic_type: Determines how data travels from the edge to your origin. When set to "direct", Spectrum will send traffic directly to your origin, and the application's type is derived from the `protocol`. When set to "http" or "https", Spectrum will @@ -832,6 +813,9 @@ async def update( edge_ips: The anycast edge IP configuration for the hostname of this application. + ip_firewall: Enables IP Access Rules for this application. Notes: Only available for TCP + applications. + origin_direct: List of origin IP addresses. Array may contain multiple IP addresses for load balancing. @@ -843,6 +827,13 @@ async def update( `"1000-2000"`. Notes: If specifying a port range, the number of ports in the range must match the number of ports specified in the "protocol" field. + proxy_protocol: Enables Proxy Protocol to the origin. Refer to + [Enable Proxy protocol](https://developers.cloudflare.com/spectrum/getting-started/proxy-protocol/) + for implementation details on PROXY Protocol V1, PROXY Protocol V2, and Simple + Proxy Protocol. + + tls: The type of TLS termination associated with the application. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -861,13 +852,13 @@ async def update( zone_id: str, dns: DNSParam, protocol: str, - origin_direct: List[str] | NotGiven = NOT_GIVEN, + origin_direct: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppUpdateResponse]: """ Updates a previously existing application's configuration that uses a name for @@ -896,32 +887,29 @@ async def update( """ ... - @required_args( - ["zone_id", "dns", "ip_firewall", "protocol", "proxy_protocol", "tls", "traffic_type"], - ["zone_id", "dns", "protocol"], - ) + @required_args(["zone_id", "dns", "protocol", "traffic_type"], ["zone_id", "dns", "protocol"]) async def update( self, app_id: str, *, zone_id: str, dns: DNSParam, - ip_firewall: bool | NotGiven = NOT_GIVEN, protocol: str, - proxy_protocol: Literal["off", "v1", "v2", "simple"] | NotGiven = NOT_GIVEN, - tls: Literal["off", "flexible", "full", "strict"] | NotGiven = NOT_GIVEN, - traffic_type: Literal["direct", "http", "https"] | NotGiven = NOT_GIVEN, - argo_smart_routing: bool | NotGiven = NOT_GIVEN, - edge_ips: EdgeIPsParam | NotGiven = NOT_GIVEN, - origin_direct: List[str] | NotGiven = NOT_GIVEN, - origin_dns: OriginDNSParam | NotGiven = NOT_GIVEN, - origin_port: OriginPortParam | NotGiven = NOT_GIVEN, + traffic_type: Literal["direct", "http", "https"] | Omit = omit, + argo_smart_routing: bool | Omit = omit, + edge_ips: EdgeIPsParam | Omit = omit, + ip_firewall: bool | Omit = omit, + origin_direct: SequenceNotStr[str] | Omit = omit, + origin_dns: OriginDNSParam | Omit = omit, + origin_port: OriginPortParam | Omit = omit, + proxy_protocol: Literal["off", "v1", "v2", "simple"] | Omit = omit, + tls: Literal["off", "flexible", "full", "strict"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppUpdateResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -934,16 +922,16 @@ async def update( body=await async_maybe_transform( { "dns": dns, - "ip_firewall": ip_firewall, "protocol": protocol, - "proxy_protocol": proxy_protocol, - "tls": tls, "traffic_type": traffic_type, "argo_smart_routing": argo_smart_routing, "edge_ips": edge_ips, + "ip_firewall": ip_firewall, "origin_direct": origin_direct, "origin_dns": origin_dns, "origin_port": origin_port, + "proxy_protocol": proxy_protocol, + "tls": tls, }, app_update_params.AppUpdateParams, ), @@ -964,16 +952,16 @@ def list( self, *, zone_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["protocol", "app_id", "created_on", "modified_on", "dns"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["protocol", "app_id", "created_on", "modified_on", "dns"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[AppListResponse], AsyncV4PagePaginationArray[Optional[AppListResponse]]]: """ Retrieves a list of currently existing Spectrum applications inside a zone. @@ -1032,7 +1020,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppDeleteResponse]: """ Deletes a previously existing application. @@ -1076,7 +1064,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppGetResponse]: """ Gets the application configuration of a specific application inside a zone. diff --git a/src/cloudflare/resources/speed/availabilities.py b/src/cloudflare/resources/speed/availabilities.py index 1b0ac1d6167..2f7f75fd060 100644 --- a/src/cloudflare/resources/speed/availabilities.py +++ b/src/cloudflare/resources/speed/availabilities.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -51,7 +51,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Availability]: """ Retrieves quota for all plans, as well as the current zone quota. @@ -111,7 +111,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Availability]: """ Retrieves quota for all plans, as well as the current zone quota. diff --git a/src/cloudflare/resources/speed/pages/pages.py b/src/cloudflare/resources/speed/pages/pages.py index f3316af1884..145cb4a88a9 100644 --- a/src/cloudflare/resources/speed/pages/pages.py +++ b/src/cloudflare/resources/speed/pages/pages.py @@ -16,7 +16,7 @@ TestsResourceWithStreamingResponse, AsyncTestsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -69,7 +69,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PageListResponse]: """ Lists all webpages which have been tested. @@ -128,13 +128,13 @@ def trend( ], start: Union[str, datetime], tz: str, - end: Union[str, datetime] | NotGiven = NOT_GIVEN, + end: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Trend]: """ Lists the core web vital metrics trend over time for a specific page. @@ -221,7 +221,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PageListResponse, AsyncSinglePage[PageListResponse]]: """ Lists all webpages which have been tested. @@ -280,13 +280,13 @@ async def trend( ], start: Union[str, datetime], tz: str, - end: Union[str, datetime] | NotGiven = NOT_GIVEN, + end: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Trend]: """ Lists the core web vital metrics trend over time for a specific page. diff --git a/src/cloudflare/resources/speed/pages/tests.py b/src/cloudflare/resources/speed/pages/tests.py index 0ed7fa3b606..bc17097085f 100644 --- a/src/cloudflare/resources/speed/pages/tests.py +++ b/src/cloudflare/resources/speed/pages/tests.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -77,13 +77,13 @@ def create( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Test]: """ Starts a test for a specific webpage, in a specific region. @@ -125,8 +125,8 @@ def list( url: str, *, zone_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "asia-east1", "asia-northeast1", @@ -150,13 +150,13 @@ def list( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Test]: """ Test history (list of tests) for a specific webpage. @@ -228,13 +228,13 @@ def delete( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TestDeleteResponse]: """Deletes all tests for a specific webpage from a specific region. @@ -284,7 +284,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Test]: """ Retrieves the result of a specific test. @@ -369,13 +369,13 @@ async def create( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Test]: """ Starts a test for a specific webpage, in a specific region. @@ -417,8 +417,8 @@ def list( url: str, *, zone_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "asia-east1", "asia-northeast1", @@ -442,13 +442,13 @@ def list( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Test, AsyncV4PagePaginationArray[Test]]: """ Test history (list of tests) for a specific webpage. @@ -520,13 +520,13 @@ async def delete( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TestDeleteResponse]: """Deletes all tests for a specific webpage from a specific region. @@ -576,7 +576,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Test]: """ Retrieves the result of a specific test. diff --git a/src/cloudflare/resources/speed/schedule.py b/src/cloudflare/resources/speed/schedule.py index b91af263f19..6c822983901 100644 --- a/src/cloudflare/resources/speed/schedule.py +++ b/src/cloudflare/resources/speed/schedule.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -75,13 +75,13 @@ def create( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ScheduleCreateResponse]: """ Creates a scheduled test for a page. @@ -146,13 +146,13 @@ def delete( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ScheduleDeleteResponse]: """ Deletes a scheduled test for a page. @@ -217,13 +217,13 @@ def get( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Schedule]: """ Retrieves the test schedule for a page in a specific region. @@ -309,13 +309,13 @@ async def create( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ScheduleCreateResponse]: """ Creates a scheduled test for a page. @@ -380,13 +380,13 @@ async def delete( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ScheduleDeleteResponse]: """ Deletes a scheduled test for a page. @@ -451,13 +451,13 @@ async def get( "us-south1", "us-west1", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Schedule]: """ Retrieves the test schedule for a page in a specific region. diff --git a/src/cloudflare/resources/ssl/analyze.py b/src/cloudflare/resources/ssl/analyze.py index 5eb71de0b52..4d979fdab27 100644 --- a/src/cloudflare/resources/ssl/analyze.py +++ b/src/cloudflare/resources/ssl/analyze.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,14 +49,14 @@ def create( self, *, zone_id: str, - bundle_method: BundleMethod | NotGiven = NOT_GIVEN, - certificate: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Returns the set of hostnames, the signature algorithm, and the expiration date @@ -126,14 +126,14 @@ async def create( self, *, zone_id: str, - bundle_method: BundleMethod | NotGiven = NOT_GIVEN, - certificate: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Returns the set of hostnames, the signature algorithm, and the expiration date diff --git a/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py b/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py index c1c5010f9fb..55ec6284ea3 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py +++ b/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx @@ -15,7 +15,7 @@ QuotaResourceWithStreamingResponse, AsyncQuotaResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -66,17 +66,17 @@ def create( *, zone_id: str, certificate_authority: Literal["google", "lets_encrypt", "ssl_com"], - hosts: List[Host], + hosts: SequenceNotStr[Host], type: Literal["advanced"], validation_method: Literal["txt", "http", "email"], validity_days: Literal[14, 30, 90, 365], - cloudflare_branding: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificatePackCreateResponse]: """ For a given zone, order an advanced certificate pack. @@ -137,13 +137,13 @@ def list( self, *, zone_id: str, - status: Literal["all"] | NotGiven = NOT_GIVEN, + status: Literal["all"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[object]: """ For a given zone, list all active certificate packs. @@ -186,7 +186,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificatePackDeleteResponse]: """ For a given zone, delete an advanced certificate pack. @@ -227,13 +227,13 @@ def edit( certificate_pack_id: str, *, zone_id: str, - cloudflare_branding: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificatePackEditResponse]: """ For a given zone, restart validation or add cloudflare branding for an advanced @@ -287,7 +287,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ For a given zone, get a certificate pack. @@ -353,17 +353,17 @@ async def create( *, zone_id: str, certificate_authority: Literal["google", "lets_encrypt", "ssl_com"], - hosts: List[Host], + hosts: SequenceNotStr[Host], type: Literal["advanced"], validation_method: Literal["txt", "http", "email"], validity_days: Literal[14, 30, 90, 365], - cloudflare_branding: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificatePackCreateResponse]: """ For a given zone, order an advanced certificate pack. @@ -424,13 +424,13 @@ def list( self, *, zone_id: str, - status: Literal["all"] | NotGiven = NOT_GIVEN, + status: Literal["all"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[object, AsyncSinglePage[object]]: """ For a given zone, list all active certificate packs. @@ -473,7 +473,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificatePackDeleteResponse]: """ For a given zone, delete an advanced certificate pack. @@ -514,13 +514,13 @@ async def edit( certificate_pack_id: str, *, zone_id: str, - cloudflare_branding: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificatePackEditResponse]: """ For a given zone, restart validation or add cloudflare branding for an advanced @@ -574,7 +574,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ For a given zone, get a certificate pack. diff --git a/src/cloudflare/resources/ssl/certificate_packs/quota.py b/src/cloudflare/resources/ssl/certificate_packs/quota.py index a85acddc937..9dc81bd7913 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/quota.py +++ b/src/cloudflare/resources/ssl/certificate_packs/quota.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[QuotaGetResponse]: """ For a given zone, list certificate pack quotas. @@ -111,7 +111,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[QuotaGetResponse]: """ For a given zone, list certificate pack quotas. diff --git a/src/cloudflare/resources/ssl/recommendations.py b/src/cloudflare/resources/ssl/recommendations.py index 512e55ba1b3..c9d81d87c87 100644 --- a/src/cloudflare/resources/ssl/recommendations.py +++ b/src/cloudflare/resources/ssl/recommendations.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing import Type, Optional, cast +import typing_extensions +from typing import Type, cast import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -42,6 +43,7 @@ def with_streaming_response(self) -> RecommendationsResourceWithStreamingRespons """ return RecommendationsResourceWithStreamingResponse(self) + @typing_extensions.deprecated("SSL/TLS Recommender has been decommissioned in favor of Automatic SSL/TLS") def get( self, *, @@ -51,14 +53,12 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecommendationGetResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RecommendationGetResponse: """ Retrieve the SSL/TLS Recommender's recommendation for a zone. Args: - zone_id: Identifier. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -76,9 +76,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecommendationGetResponse]]._unwrapper, + post_parser=ResultWrapper[RecommendationGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), + cast_to=cast(Type[RecommendationGetResponse], ResultWrapper[RecommendationGetResponse]), ) @@ -102,6 +102,7 @@ def with_streaming_response(self) -> AsyncRecommendationsResourceWithStreamingRe """ return AsyncRecommendationsResourceWithStreamingResponse(self) + @typing_extensions.deprecated("SSL/TLS Recommender has been decommissioned in favor of Automatic SSL/TLS") async def get( self, *, @@ -111,14 +112,12 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecommendationGetResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RecommendationGetResponse: """ Retrieve the SSL/TLS Recommender's recommendation for a zone. Args: - zone_id: Identifier. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -136,9 +135,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RecommendationGetResponse]]._unwrapper, + post_parser=ResultWrapper[RecommendationGetResponse]._unwrapper, ), - cast_to=cast(Type[Optional[RecommendationGetResponse]], ResultWrapper[RecommendationGetResponse]), + cast_to=cast(Type[RecommendationGetResponse], ResultWrapper[RecommendationGetResponse]), ) @@ -146,8 +145,10 @@ class RecommendationsResourceWithRawResponse: def __init__(self, recommendations: RecommendationsResource) -> None: self._recommendations = recommendations - self.get = to_raw_response_wrapper( - recommendations.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + recommendations.get, # pyright: ignore[reportDeprecated], + ) ) @@ -155,8 +156,10 @@ class AsyncRecommendationsResourceWithRawResponse: def __init__(self, recommendations: AsyncRecommendationsResource) -> None: self._recommendations = recommendations - self.get = async_to_raw_response_wrapper( - recommendations.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + recommendations.get, # pyright: ignore[reportDeprecated], + ) ) @@ -164,8 +167,10 @@ class RecommendationsResourceWithStreamingResponse: def __init__(self, recommendations: RecommendationsResource) -> None: self._recommendations = recommendations - self.get = to_streamed_response_wrapper( - recommendations.get, + self.get = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + recommendations.get, # pyright: ignore[reportDeprecated], + ) ) @@ -173,6 +178,8 @@ class AsyncRecommendationsResourceWithStreamingResponse: def __init__(self, recommendations: AsyncRecommendationsResource) -> None: self._recommendations = recommendations - self.get = async_to_streamed_response_wrapper( - recommendations.get, + self.get = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + recommendations.get, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/cloudflare/resources/ssl/universal/settings.py b/src/cloudflare/resources/ssl/universal/settings.py index b2e889ebeb5..a16e956a36f 100644 --- a/src/cloudflare/resources/ssl/universal/settings.py +++ b/src/cloudflare/resources/ssl/universal/settings.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,13 +48,13 @@ def edit( self, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UniversalSSLSettings]: """ Patch Universal SSL Settings for a Zone. @@ -120,7 +120,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UniversalSSLSettings]: """ Get Universal SSL Settings for a Zone. @@ -175,13 +175,13 @@ async def edit( self, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UniversalSSLSettings]: """ Patch Universal SSL Settings for a Zone. @@ -247,7 +247,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UniversalSSLSettings]: """ Get Universal SSL Settings for a Zone. diff --git a/src/cloudflare/resources/ssl/verification.py b/src/cloudflare/resources/ssl/verification.py index 2f7f327c993..7262218e55a 100644 --- a/src/cloudflare/resources/ssl/verification.py +++ b/src/cloudflare/resources/ssl/verification.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -57,7 +57,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VerificationEditResponse]: """Edit SSL validation method for a certificate pack. @@ -106,13 +106,13 @@ def get( self, *, zone_id: str, - retry: Literal[True] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VerificationGetResponse]: """ Get SSL Verification Info for a Zone. @@ -177,7 +177,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VerificationEditResponse]: """Edit SSL validation method for a certificate pack. @@ -226,13 +226,13 @@ async def get( self, *, zone_id: str, - retry: Literal[True] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VerificationGetResponse]: """ Get SSL Verification Info for a Zone. diff --git a/src/cloudflare/resources/stream/audio_tracks.py b/src/cloudflare/resources/stream/audio_tracks.py index ad01e4bf14d..ddb3e34af20 100644 --- a/src/cloudflare/resources/stream/audio_tracks.py +++ b/src/cloudflare/resources/stream/audio_tracks.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -57,7 +57,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Deletes additional audio tracks on a video. @@ -103,13 +103,13 @@ def copy( *, account_id: str, label: str, - url: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Audio]: """ Adds an additional audio track to a video using the provided audio track URL. @@ -163,14 +163,14 @@ def edit( *, account_id: str, identifier: str, - default: bool | NotGiven = NOT_GIVEN, - label: str | NotGiven = NOT_GIVEN, + default: bool | Omit = omit, + label: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Audio]: """Edits additional audio tracks on a video. @@ -233,7 +233,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Audio]: """Lists additional audio tracks on a video. @@ -298,7 +298,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Deletes additional audio tracks on a video. @@ -344,13 +344,13 @@ async def copy( *, account_id: str, label: str, - url: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Audio]: """ Adds an additional audio track to a video using the provided audio track URL. @@ -404,14 +404,14 @@ async def edit( *, account_id: str, identifier: str, - default: bool | NotGiven = NOT_GIVEN, - label: str | NotGiven = NOT_GIVEN, + default: bool | Omit = omit, + label: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Audio]: """Edits additional audio tracks on a video. @@ -474,7 +474,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Audio, AsyncSinglePage[Audio]]: """Lists additional audio tracks on a video. diff --git a/src/cloudflare/resources/stream/captions/captions.py b/src/cloudflare/resources/stream/captions/captions.py index b32cb6d1aaf..18ee4b239ee 100644 --- a/src/cloudflare/resources/stream/captions/captions.py +++ b/src/cloudflare/resources/stream/captions/captions.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -62,7 +62,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Caption]: """ Lists the available captions or subtitles for a specific video. @@ -128,7 +128,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Caption, AsyncSinglePage[Caption]]: """ Lists the available captions or subtitles for a specific video. diff --git a/src/cloudflare/resources/stream/captions/language/language.py b/src/cloudflare/resources/stream/captions/language/language.py index a5f875e235b..c93200cc835 100644 --- a/src/cloudflare/resources/stream/captions/language/language.py +++ b/src/cloudflare/resources/stream/captions/language/language.py @@ -14,7 +14,7 @@ VttResourceWithStreamingResponse, AsyncVttResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -68,7 +68,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Caption]: """ Generate captions or subtitles for provided language via AI. @@ -118,7 +118,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Caption]: """ Uploads the caption or subtitle file to the endpoint for a specific BCP47 @@ -175,7 +175,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Removes the captions or subtitles from a video. @@ -224,7 +224,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Caption]: """ Lists the captions or subtitles for provided language. @@ -298,7 +298,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Caption]: """ Generate captions or subtitles for provided language via AI. @@ -348,7 +348,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Caption]: """ Uploads the caption or subtitle file to the endpoint for a specific BCP47 @@ -405,7 +405,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Removes the captions or subtitles from a video. @@ -454,7 +454,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Caption]: """ Lists the captions or subtitles for provided language. diff --git a/src/cloudflare/resources/stream/captions/language/vtt.py b/src/cloudflare/resources/stream/captions/language/vtt.py index 7b3508b1452..40884504871 100644 --- a/src/cloudflare/resources/stream/captions/language/vtt.py +++ b/src/cloudflare/resources/stream/captions/language/vtt.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -49,7 +49,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Return WebVTT captions for a provided language. @@ -116,7 +116,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Return WebVTT captions for a provided language. diff --git a/src/cloudflare/resources/stream/clip.py b/src/cloudflare/resources/stream/clip.py index 6cdb7e4f76c..d9c8a4c6560 100644 --- a/src/cloudflare/resources/stream/clip.py +++ b/src/cloudflare/resources/stream/clip.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,18 +52,18 @@ def create( clipped_from_video_uid: str, end_time_seconds: int, start_time_seconds: int, - allowed_origins: List[AllowedOrigins] | NotGiven = NOT_GIVEN, - creator: str | NotGiven = NOT_GIVEN, - max_duration_seconds: int | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, - thumbnail_timestamp_pct: float | NotGiven = NOT_GIVEN, - watermark: clip_create_params.Watermark | NotGiven = NOT_GIVEN, + allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, + creator: str | Omit = omit, + max_duration_seconds: int | Omit = omit, + require_signed_urls: bool | Omit = omit, + thumbnail_timestamp_pct: float | Omit = omit, + watermark: clip_create_params.Watermark | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Clip]: """ Clips a video based on the specified start and end times provided in seconds. @@ -160,18 +160,18 @@ async def create( clipped_from_video_uid: str, end_time_seconds: int, start_time_seconds: int, - allowed_origins: List[AllowedOrigins] | NotGiven = NOT_GIVEN, - creator: str | NotGiven = NOT_GIVEN, - max_duration_seconds: int | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, - thumbnail_timestamp_pct: float | NotGiven = NOT_GIVEN, - watermark: clip_create_params.Watermark | NotGiven = NOT_GIVEN, + allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, + creator: str | Omit = omit, + max_duration_seconds: int | Omit = omit, + require_signed_urls: bool | Omit = omit, + thumbnail_timestamp_pct: float | Omit = omit, + watermark: clip_create_params.Watermark | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Clip]: """ Clips a video based on the specified start and end times provided in seconds. diff --git a/src/cloudflare/resources/stream/copy.py b/src/cloudflare/resources/stream/copy.py index 3d58f535f6c..d41f535afec 100644 --- a/src/cloudflare/resources/stream/copy.py +++ b/src/cloudflare/resources/stream/copy.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +from typing import Type, Union, Optional, cast from datetime import datetime import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -51,20 +51,20 @@ def create( *, account_id: str, url: str, - allowed_origins: List[AllowedOrigins] | NotGiven = NOT_GIVEN, - creator: str | NotGiven = NOT_GIVEN, - meta: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, - scheduled_deletion: Union[str, datetime] | NotGiven = NOT_GIVEN, - thumbnail_timestamp_pct: float | NotGiven = NOT_GIVEN, - watermark: copy_create_params.Watermark | NotGiven = NOT_GIVEN, - upload_creator: str | NotGiven = NOT_GIVEN, + allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, + creator: str | Omit = omit, + meta: object | Omit = omit, + require_signed_urls: bool | Omit = omit, + scheduled_deletion: Union[str, datetime] | Omit = omit, + thumbnail_timestamp_pct: float | Omit = omit, + watermark: copy_create_params.Watermark | Omit = omit, + upload_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Video]: """ Uploads a video to Stream from a provided URL. @@ -161,20 +161,20 @@ async def create( *, account_id: str, url: str, - allowed_origins: List[AllowedOrigins] | NotGiven = NOT_GIVEN, - creator: str | NotGiven = NOT_GIVEN, - meta: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, - scheduled_deletion: Union[str, datetime] | NotGiven = NOT_GIVEN, - thumbnail_timestamp_pct: float | NotGiven = NOT_GIVEN, - watermark: copy_create_params.Watermark | NotGiven = NOT_GIVEN, - upload_creator: str | NotGiven = NOT_GIVEN, + allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, + creator: str | Omit = omit, + meta: object | Omit = omit, + require_signed_urls: bool | Omit = omit, + scheduled_deletion: Union[str, datetime] | Omit = omit, + thumbnail_timestamp_pct: float | Omit = omit, + watermark: copy_create_params.Watermark | Omit = omit, + upload_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Video]: """ Uploads a video to Stream from a provided URL. diff --git a/src/cloudflare/resources/stream/direct_upload.py b/src/cloudflare/resources/stream/direct_upload.py index 018607f1ea7..e1bcd10bfe5 100644 --- a/src/cloudflare/resources/stream/direct_upload.py +++ b/src/cloudflare/resources/stream/direct_upload.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +from typing import Type, Union, Optional, cast from datetime import datetime import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -51,21 +51,21 @@ def create( *, account_id: str, max_duration_seconds: int, - allowed_origins: List[AllowedOrigins] | NotGiven = NOT_GIVEN, - creator: str | NotGiven = NOT_GIVEN, - expiry: Union[str, datetime] | NotGiven = NOT_GIVEN, - meta: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, - scheduled_deletion: Union[str, datetime] | NotGiven = NOT_GIVEN, - thumbnail_timestamp_pct: float | NotGiven = NOT_GIVEN, - watermark: direct_upload_create_params.Watermark | NotGiven = NOT_GIVEN, - upload_creator: str | NotGiven = NOT_GIVEN, + allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, + creator: str | Omit = omit, + expiry: Union[str, datetime] | Omit = omit, + meta: object | Omit = omit, + require_signed_urls: bool | Omit = omit, + scheduled_deletion: Union[str, datetime] | Omit = omit, + thumbnail_timestamp_pct: float | Omit = omit, + watermark: direct_upload_create_params.Watermark | Omit = omit, + upload_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DirectUploadCreateResponse]: """ Creates a direct upload that allows video uploads without an API key. @@ -166,21 +166,21 @@ async def create( *, account_id: str, max_duration_seconds: int, - allowed_origins: List[AllowedOrigins] | NotGiven = NOT_GIVEN, - creator: str | NotGiven = NOT_GIVEN, - expiry: Union[str, datetime] | NotGiven = NOT_GIVEN, - meta: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, - scheduled_deletion: Union[str, datetime] | NotGiven = NOT_GIVEN, - thumbnail_timestamp_pct: float | NotGiven = NOT_GIVEN, - watermark: direct_upload_create_params.Watermark | NotGiven = NOT_GIVEN, - upload_creator: str | NotGiven = NOT_GIVEN, + allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, + creator: str | Omit = omit, + expiry: Union[str, datetime] | Omit = omit, + meta: object | Omit = omit, + require_signed_urls: bool | Omit = omit, + scheduled_deletion: Union[str, datetime] | Omit = omit, + thumbnail_timestamp_pct: float | Omit = omit, + watermark: direct_upload_create_params.Watermark | Omit = omit, + upload_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DirectUploadCreateResponse]: """ Creates a direct upload that allows video uploads without an API key. diff --git a/src/cloudflare/resources/stream/downloads.py b/src/cloudflare/resources/stream/downloads.py index e131d401bd3..7d8e839d6e2 100644 --- a/src/cloudflare/resources/stream/downloads.py +++ b/src/cloudflare/resources/stream/downloads.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,10 +55,13 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: - """ - Creates a download for a video when a video is ready to view. + """Creates a download for a video when a video is ready to view. + + Use + `/downloads/{download_type}` instead for type-specific downloads. Available + types are `default` and `audio`. Args: account_id: Identifier. @@ -100,10 +103,12 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: - """ - Delete the downloads for a video. + """Delete the downloads for a video. + + Use `/downloads/{download_type}` instead for + type-specific downloads. Available types are `default` and `audio`. Args: account_id: Identifier. @@ -144,7 +149,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Lists the downloads created for a video. @@ -210,10 +215,13 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: - """ - Creates a download for a video when a video is ready to view. + """Creates a download for a video when a video is ready to view. + + Use + `/downloads/{download_type}` instead for type-specific downloads. Available + types are `default` and `audio`. Args: account_id: Identifier. @@ -255,10 +263,12 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: - """ - Delete the downloads for a video. + """Delete the downloads for a video. + + Use `/downloads/{download_type}` instead for + type-specific downloads. Available types are `default` and `audio`. Args: account_id: Identifier. @@ -299,7 +309,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Lists the downloads created for a video. diff --git a/src/cloudflare/resources/stream/embed.py b/src/cloudflare/resources/stream/embed.py index 1f142723fe6..ab5d6ec594b 100644 --- a/src/cloudflare/resources/stream/embed.py +++ b/src/cloudflare/resources/stream/embed.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -48,7 +48,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Fetches an HTML code snippet to embed a video in a web page delivered through @@ -111,7 +111,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Fetches an HTML code snippet to embed a video in a web page delivered through diff --git a/src/cloudflare/resources/stream/keys.py b/src/cloudflare/resources/stream/keys.py index afe1369014d..3b0f5dbac2f 100644 --- a/src/cloudflare/resources/stream/keys.py +++ b/src/cloudflare/resources/stream/keys.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -57,7 +57,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Keys]: """Creates an RSA private key in PEM and JWK formats. @@ -101,7 +101,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Deletes signing keys and revokes all signed URLs generated with the key. @@ -144,7 +144,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[KeyGetResponse]: """ Lists the video ID and creation date and time when a signing key was created. @@ -202,7 +202,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Keys]: """Creates an RSA private key in PEM and JWK formats. @@ -246,7 +246,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Deletes signing keys and revokes all signed URLs generated with the key. @@ -289,7 +289,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[KeyGetResponse, AsyncSinglePage[KeyGetResponse]]: """ Lists the video ID and creation date and time when a signing key was created. diff --git a/src/cloudflare/resources/stream/live_inputs/live_inputs.py b/src/cloudflare/resources/stream/live_inputs/live_inputs.py index f20769c18bc..25a527c5b09 100644 --- a/src/cloudflare/resources/stream/live_inputs/live_inputs.py +++ b/src/cloudflare/resources/stream/live_inputs/live_inputs.py @@ -14,7 +14,7 @@ OutputsResourceWithStreamingResponse, AsyncOutputsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -61,16 +61,16 @@ def create( self, *, account_id: str, - default_creator: str | NotGiven = NOT_GIVEN, - delete_recording_after_days: float | NotGiven = NOT_GIVEN, - meta: object | NotGiven = NOT_GIVEN, - recording: live_input_create_params.Recording | NotGiven = NOT_GIVEN, + default_creator: str | Omit = omit, + delete_recording_after_days: float | Omit = omit, + meta: object | Omit = omit, + recording: live_input_create_params.Recording | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LiveInput]: """ Creates a live input, and returns credentials that you or your users can use to @@ -130,16 +130,16 @@ def update( live_input_identifier: str, *, account_id: str, - default_creator: str | NotGiven = NOT_GIVEN, - delete_recording_after_days: float | NotGiven = NOT_GIVEN, - meta: object | NotGiven = NOT_GIVEN, - recording: live_input_update_params.Recording | NotGiven = NOT_GIVEN, + default_creator: str | Omit = omit, + delete_recording_after_days: float | Omit = omit, + meta: object | Omit = omit, + recording: live_input_update_params.Recording | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LiveInput]: """ Updates a specified live input. @@ -203,13 +203,13 @@ def list( self, *, account_id: str, - include_counts: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LiveInputListResponse]: """Lists the live inputs created for an account. @@ -255,7 +255,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Prevents a live input from being streamed to and makes the live input @@ -299,7 +299,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LiveInput]: """ Retrieves details of an existing live input. @@ -364,16 +364,16 @@ async def create( self, *, account_id: str, - default_creator: str | NotGiven = NOT_GIVEN, - delete_recording_after_days: float | NotGiven = NOT_GIVEN, - meta: object | NotGiven = NOT_GIVEN, - recording: live_input_create_params.Recording | NotGiven = NOT_GIVEN, + default_creator: str | Omit = omit, + delete_recording_after_days: float | Omit = omit, + meta: object | Omit = omit, + recording: live_input_create_params.Recording | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LiveInput]: """ Creates a live input, and returns credentials that you or your users can use to @@ -433,16 +433,16 @@ async def update( live_input_identifier: str, *, account_id: str, - default_creator: str | NotGiven = NOT_GIVEN, - delete_recording_after_days: float | NotGiven = NOT_GIVEN, - meta: object | NotGiven = NOT_GIVEN, - recording: live_input_update_params.Recording | NotGiven = NOT_GIVEN, + default_creator: str | Omit = omit, + delete_recording_after_days: float | Omit = omit, + meta: object | Omit = omit, + recording: live_input_update_params.Recording | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LiveInput]: """ Updates a specified live input. @@ -506,13 +506,13 @@ async def list( self, *, account_id: str, - include_counts: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LiveInputListResponse]: """Lists the live inputs created for an account. @@ -560,7 +560,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Prevents a live input from being streamed to and makes the live input @@ -604,7 +604,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LiveInput]: """ Retrieves details of an existing live input. diff --git a/src/cloudflare/resources/stream/live_inputs/outputs.py b/src/cloudflare/resources/stream/live_inputs/outputs.py index d7a4445ec7a..ee3ab054e87 100644 --- a/src/cloudflare/resources/stream/live_inputs/outputs.py +++ b/src/cloudflare/resources/stream/live_inputs/outputs.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -52,13 +52,13 @@ def create( account_id: str, stream_key: str, url: str, - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Output]: """ Creates a new output that can be used to simulcast or restream live video to @@ -126,7 +126,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Output]: """ Updates the state of an output. @@ -183,7 +183,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Output]: """ Retrieves all outputs associated with a specified live input. @@ -227,7 +227,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes an output and removes it from the associated live input. @@ -292,13 +292,13 @@ async def create( account_id: str, stream_key: str, url: str, - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Output]: """ Creates a new output that can be used to simulcast or restream live video to @@ -366,7 +366,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Output]: """ Updates the state of an output. @@ -423,7 +423,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Output, AsyncSinglePage[Output]]: """ Retrieves all outputs associated with a specified live input. @@ -467,7 +467,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes an output and removes it from the associated live input. diff --git a/src/cloudflare/resources/stream/stream.py b/src/cloudflare/resources/stream/stream.py index f818bb943bd..354a05c45fc 100644 --- a/src/cloudflare/resources/stream/stream.py +++ b/src/cloudflare/resources/stream/stream.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Union, Optional, cast +from typing import Type, Union, Optional, cast from datetime import datetime from typing_extensions import Literal @@ -56,7 +56,7 @@ VideosResourceWithStreamingResponse, AsyncVideosResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, strip_not_given, async_maybe_transform from .webhooks import ( WebhooksResource, @@ -211,15 +211,15 @@ def create( body: object, tus_resumable: Literal["1.0.0"], upload_length: int, - direct_user: bool | NotGiven = NOT_GIVEN, - upload_creator: str | NotGiven = NOT_GIVEN, - upload_metadata: str | NotGiven = NOT_GIVEN, + direct_user: bool | Omit = omit, + upload_creator: str | Omit = omit, + upload_metadata: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """Initiates a video upload using the TUS protocol. @@ -286,21 +286,22 @@ def list( self, *, account_id: str, - asc: bool | NotGiven = NOT_GIVEN, - creator: str | NotGiven = NOT_GIVEN, - end: Union[str, datetime] | NotGiven = NOT_GIVEN, - include_counts: bool | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - start: Union[str, datetime] | NotGiven = NOT_GIVEN, - status: Literal["pendingupload", "downloading", "queued", "inprogress", "ready", "error"] - | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + asc: bool | Omit = omit, + creator: str | Omit = omit, + end: Union[str, datetime] | Omit = omit, + include_counts: bool | Omit = omit, + search: str | Omit = omit, + start: Union[str, datetime] | Omit = omit, + status: Literal["pendingupload", "downloading", "queued", "inprogress", "ready", "error", "live-inprogress"] + | Omit = omit, + type: str | Omit = omit, + video_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Video]: """Lists up to 1000 videos from a single request. @@ -319,8 +320,8 @@ def list( include_counts: Includes the total number of videos associated with the submitted query parameters. - search: Searches over the `name` key in the `meta` field. This field can be set with or - after the upload request. + search: Provides a partial word match of the `name` key in the `meta` field. Slow for + medium to large video libraries. May be unavailable for very large libraries. start: Lists videos created after the specified date. @@ -328,6 +329,8 @@ def list( type: Specifies whether the video is `vod` or `live`. + video_name: Provides a fast, exact string match on the `name` key in the `meta` field. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -356,6 +359,7 @@ def list( "start": start, "status": status, "type": type, + "video_name": video_name, }, stream_list_params.StreamListParams, ), @@ -373,7 +377,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes a video and its copies from Cloudflare Stream. @@ -409,20 +413,20 @@ def edit( identifier: str, *, account_id: str, - allowed_origins: List[AllowedOrigins] | NotGiven = NOT_GIVEN, - creator: str | NotGiven = NOT_GIVEN, - max_duration_seconds: int | NotGiven = NOT_GIVEN, - meta: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, - scheduled_deletion: Union[str, datetime] | NotGiven = NOT_GIVEN, - thumbnail_timestamp_pct: float | NotGiven = NOT_GIVEN, - upload_expiry: Union[str, datetime] | NotGiven = NOT_GIVEN, + allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, + creator: str | Omit = omit, + max_duration_seconds: int | Omit = omit, + meta: object | Omit = omit, + require_signed_urls: bool | Omit = omit, + scheduled_deletion: Union[str, datetime] | Omit = omit, + thumbnail_timestamp_pct: float | Omit = omit, + upload_expiry: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Video]: """ Edit details for a single video. @@ -508,7 +512,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Video]: """ Fetches details for a single video. @@ -622,15 +626,15 @@ async def create( body: object, tus_resumable: Literal["1.0.0"], upload_length: int, - direct_user: bool | NotGiven = NOT_GIVEN, - upload_creator: str | NotGiven = NOT_GIVEN, - upload_metadata: str | NotGiven = NOT_GIVEN, + direct_user: bool | Omit = omit, + upload_creator: str | Omit = omit, + upload_metadata: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """Initiates a video upload using the TUS protocol. @@ -699,21 +703,22 @@ def list( self, *, account_id: str, - asc: bool | NotGiven = NOT_GIVEN, - creator: str | NotGiven = NOT_GIVEN, - end: Union[str, datetime] | NotGiven = NOT_GIVEN, - include_counts: bool | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - start: Union[str, datetime] | NotGiven = NOT_GIVEN, - status: Literal["pendingupload", "downloading", "queued", "inprogress", "ready", "error"] - | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + asc: bool | Omit = omit, + creator: str | Omit = omit, + end: Union[str, datetime] | Omit = omit, + include_counts: bool | Omit = omit, + search: str | Omit = omit, + start: Union[str, datetime] | Omit = omit, + status: Literal["pendingupload", "downloading", "queued", "inprogress", "ready", "error", "live-inprogress"] + | Omit = omit, + type: str | Omit = omit, + video_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Video, AsyncSinglePage[Video]]: """Lists up to 1000 videos from a single request. @@ -732,8 +737,8 @@ def list( include_counts: Includes the total number of videos associated with the submitted query parameters. - search: Searches over the `name` key in the `meta` field. This field can be set with or - after the upload request. + search: Provides a partial word match of the `name` key in the `meta` field. Slow for + medium to large video libraries. May be unavailable for very large libraries. start: Lists videos created after the specified date. @@ -741,6 +746,8 @@ def list( type: Specifies whether the video is `vod` or `live`. + video_name: Provides a fast, exact string match on the `name` key in the `meta` field. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -769,6 +776,7 @@ def list( "start": start, "status": status, "type": type, + "video_name": video_name, }, stream_list_params.StreamListParams, ), @@ -786,7 +794,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes a video and its copies from Cloudflare Stream. @@ -822,20 +830,20 @@ async def edit( identifier: str, *, account_id: str, - allowed_origins: List[AllowedOrigins] | NotGiven = NOT_GIVEN, - creator: str | NotGiven = NOT_GIVEN, - max_duration_seconds: int | NotGiven = NOT_GIVEN, - meta: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, - scheduled_deletion: Union[str, datetime] | NotGiven = NOT_GIVEN, - thumbnail_timestamp_pct: float | NotGiven = NOT_GIVEN, - upload_expiry: Union[str, datetime] | NotGiven = NOT_GIVEN, + allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, + creator: str | Omit = omit, + max_duration_seconds: int | Omit = omit, + meta: object | Omit = omit, + require_signed_urls: bool | Omit = omit, + scheduled_deletion: Union[str, datetime] | Omit = omit, + thumbnail_timestamp_pct: float | Omit = omit, + upload_expiry: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Video]: """ Edit details for a single video. @@ -921,7 +929,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Video]: """ Fetches details for a single video. diff --git a/src/cloudflare/resources/stream/token.py b/src/cloudflare/resources/stream/token.py index 621f31d7286..dd45a718d9c 100644 --- a/src/cloudflare/resources/stream/token.py +++ b/src/cloudflare/resources/stream/token.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,18 +49,18 @@ def create( identifier: str, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - access_rules: Iterable[token_create_params.AccessRule] | NotGiven = NOT_GIVEN, - downloadable: bool | NotGiven = NOT_GIVEN, - exp: int | NotGiven = NOT_GIVEN, - nbf: int | NotGiven = NOT_GIVEN, - pem: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + access_rules: Iterable[token_create_params.AccessRule] | Omit = omit, + downloadable: bool | Omit = omit, + exp: int | Omit = omit, + nbf: int | Omit = omit, + pem: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenCreateResponse]: """Creates a signed URL token for a video. @@ -154,18 +154,18 @@ async def create( identifier: str, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - access_rules: Iterable[token_create_params.AccessRule] | NotGiven = NOT_GIVEN, - downloadable: bool | NotGiven = NOT_GIVEN, - exp: int | NotGiven = NOT_GIVEN, - nbf: int | NotGiven = NOT_GIVEN, - pem: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + access_rules: Iterable[token_create_params.AccessRule] | Omit = omit, + downloadable: bool | Omit = omit, + exp: int | Omit = omit, + nbf: int | Omit = omit, + pem: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenCreateResponse]: """Creates a signed URL token for a video. diff --git a/src/cloudflare/resources/stream/videos.py b/src/cloudflare/resources/stream/videos.py index 30f29b15368..2d8d2355ff1 100644 --- a/src/cloudflare/resources/stream/videos.py +++ b/src/cloudflare/resources/stream/videos.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,13 +48,13 @@ def storage_usage( self, *, account_id: str, - creator: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VideoStorageUsageResponse]: """ Returns information about an account's storage use. @@ -112,13 +112,13 @@ async def storage_usage( self, *, account_id: str, - creator: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[VideoStorageUsageResponse]: """ Returns information about an account's storage use. diff --git a/src/cloudflare/resources/stream/watermarks.py b/src/cloudflare/resources/stream/watermarks.py index bf9dcddf8b1..75f58cd1441 100644 --- a/src/cloudflare/resources/stream/watermarks.py +++ b/src/cloudflare/resources/stream/watermarks.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,17 +51,17 @@ def create( *, account_id: str, file: str, - name: str | NotGiven = NOT_GIVEN, - opacity: float | NotGiven = NOT_GIVEN, - padding: float | NotGiven = NOT_GIVEN, - position: str | NotGiven = NOT_GIVEN, - scale: float | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + opacity: float | Omit = omit, + padding: float | Omit = omit, + position: str | Omit = omit, + scale: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Watermark]: """ Creates watermark profiles using a single `HTTP POST multipart/form-data` @@ -137,7 +137,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Watermark]: """ Lists all watermark profiles for an account. @@ -174,7 +174,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Deletes a watermark profile. @@ -218,7 +218,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Watermark]: """ Retrieves details for a single watermark profile. @@ -278,17 +278,17 @@ async def create( *, account_id: str, file: str, - name: str | NotGiven = NOT_GIVEN, - opacity: float | NotGiven = NOT_GIVEN, - padding: float | NotGiven = NOT_GIVEN, - position: str | NotGiven = NOT_GIVEN, - scale: float | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + opacity: float | Omit = omit, + padding: float | Omit = omit, + position: str | Omit = omit, + scale: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Watermark]: """ Creates watermark profiles using a single `HTTP POST multipart/form-data` @@ -364,7 +364,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Watermark, AsyncSinglePage[Watermark]]: """ Lists all watermark profiles for an account. @@ -401,7 +401,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Deletes a watermark profile. @@ -445,7 +445,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Watermark]: """ Retrieves details for a single watermark profile. diff --git a/src/cloudflare/resources/stream/webhooks.py b/src/cloudflare/resources/stream/webhooks.py index f3412ae853c..3ff062d0e0e 100644 --- a/src/cloudflare/resources/stream/webhooks.py +++ b/src/cloudflare/resources/stream/webhooks.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,7 +54,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Creates a webhook notification. @@ -96,7 +96,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Deletes a webhook. @@ -135,7 +135,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Retrieves a list of webhooks. @@ -196,7 +196,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Creates a webhook notification. @@ -240,7 +240,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Deletes a webhook. @@ -279,7 +279,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Retrieves a list of webhooks. diff --git a/src/cloudflare/resources/turnstile/widgets.py b/src/cloudflare/resources/turnstile/widgets.py index d2a7c8c660b..4e6de68e2bf 100644 --- a/src/cloudflare/resources/turnstile/widgets.py +++ b/src/cloudflare/resources/turnstile/widgets.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -57,24 +57,24 @@ def create( self, *, account_id: str, - domains: List[WidgetDomain], + domains: SequenceNotStr[WidgetDomain], mode: Literal["non-interactive", "invisible", "managed"], name: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["id", "sitekey", "name", "created_on", "modified_on"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - bot_fight_mode: bool | NotGiven = NOT_GIVEN, - clearance_level: Literal["no_clearance", "jschallenge", "managed", "interactive"] | NotGiven = NOT_GIVEN, - ephemeral_id: bool | NotGiven = NOT_GIVEN, - offlabel: bool | NotGiven = NOT_GIVEN, - region: Literal["world", "china"] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["id", "sitekey", "name", "created_on", "modified_on"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + bot_fight_mode: bool | Omit = omit, + clearance_level: Literal["no_clearance", "jschallenge", "managed", "interactive"] | Omit = omit, + ephemeral_id: bool | Omit = omit, + offlabel: bool | Omit = omit, + region: Literal["world", "china"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Widget]: """ Lists challenge widgets. @@ -157,20 +157,20 @@ def update( sitekey: str, *, account_id: str, - domains: List[WidgetDomain], + domains: SequenceNotStr[WidgetDomain], mode: Literal["non-interactive", "invisible", "managed"], name: str, - bot_fight_mode: bool | NotGiven = NOT_GIVEN, - clearance_level: Literal["no_clearance", "jschallenge", "managed", "interactive"] | NotGiven = NOT_GIVEN, - ephemeral_id: bool | NotGiven = NOT_GIVEN, - offlabel: bool | NotGiven = NOT_GIVEN, - region: Literal["world", "china"] | NotGiven = NOT_GIVEN, + bot_fight_mode: bool | Omit = omit, + clearance_level: Literal["no_clearance", "jschallenge", "managed", "interactive"] | Omit = omit, + ephemeral_id: bool | Omit = omit, + offlabel: bool | Omit = omit, + region: Literal["world", "china"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Widget]: """ Update the configuration of a widget. @@ -239,16 +239,16 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["id", "sitekey", "name", "created_on", "modified_on"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["id", "sitekey", "name", "created_on", "modified_on"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[WidgetListResponse]: """ Lists all turnstile widgets of an account. @@ -305,7 +305,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Widget]: """ Destroy a Turnstile Widget. @@ -349,7 +349,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Widget]: """ Show a single challenge widget configuration. @@ -388,13 +388,13 @@ def rotate_secret( sitekey: str, *, account_id: str, - invalidate_immediately: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Widget]: """Generate a new secret key for this widget. @@ -464,24 +464,24 @@ async def create( self, *, account_id: str, - domains: List[WidgetDomain], + domains: SequenceNotStr[WidgetDomain], mode: Literal["non-interactive", "invisible", "managed"], name: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["id", "sitekey", "name", "created_on", "modified_on"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - bot_fight_mode: bool | NotGiven = NOT_GIVEN, - clearance_level: Literal["no_clearance", "jschallenge", "managed", "interactive"] | NotGiven = NOT_GIVEN, - ephemeral_id: bool | NotGiven = NOT_GIVEN, - offlabel: bool | NotGiven = NOT_GIVEN, - region: Literal["world", "china"] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["id", "sitekey", "name", "created_on", "modified_on"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + bot_fight_mode: bool | Omit = omit, + clearance_level: Literal["no_clearance", "jschallenge", "managed", "interactive"] | Omit = omit, + ephemeral_id: bool | Omit = omit, + offlabel: bool | Omit = omit, + region: Literal["world", "china"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Widget]: """ Lists challenge widgets. @@ -564,20 +564,20 @@ async def update( sitekey: str, *, account_id: str, - domains: List[WidgetDomain], + domains: SequenceNotStr[WidgetDomain], mode: Literal["non-interactive", "invisible", "managed"], name: str, - bot_fight_mode: bool | NotGiven = NOT_GIVEN, - clearance_level: Literal["no_clearance", "jschallenge", "managed", "interactive"] | NotGiven = NOT_GIVEN, - ephemeral_id: bool | NotGiven = NOT_GIVEN, - offlabel: bool | NotGiven = NOT_GIVEN, - region: Literal["world", "china"] | NotGiven = NOT_GIVEN, + bot_fight_mode: bool | Omit = omit, + clearance_level: Literal["no_clearance", "jschallenge", "managed", "interactive"] | Omit = omit, + ephemeral_id: bool | Omit = omit, + offlabel: bool | Omit = omit, + region: Literal["world", "china"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Widget]: """ Update the configuration of a widget. @@ -646,16 +646,16 @@ def list( self, *, account_id: str, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - order: Literal["id", "sitekey", "name", "created_on", "modified_on"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + order: Literal["id", "sitekey", "name", "created_on", "modified_on"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WidgetListResponse, AsyncV4PagePaginationArray[WidgetListResponse]]: """ Lists all turnstile widgets of an account. @@ -712,7 +712,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Widget]: """ Destroy a Turnstile Widget. @@ -756,7 +756,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Widget]: """ Show a single challenge widget configuration. @@ -795,13 +795,13 @@ async def rotate_secret( sitekey: str, *, account_id: str, - invalidate_immediately: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Widget]: """Generate a new secret key for this widget. diff --git a/src/cloudflare/resources/url_normalization.py b/src/cloudflare/resources/url_normalization.py index 2279dad3668..2d69292f055 100644 --- a/src/cloudflare/resources/url_normalization.py +++ b/src/cloudflare/resources/url_normalization.py @@ -7,7 +7,7 @@ import httpx -from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +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 @@ -50,14 +50,14 @@ def update( self, *, zone_id: str, - scope: Literal["incoming", "both"], + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> URLNormalizationUpdateResponse: """ Updates the URL Normalization settings. @@ -107,7 +107,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes the URL Normalization settings. @@ -143,7 +143,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> URLNormalizationGetResponse: """ Fetches the current URL Normalization settings. @@ -198,14 +198,14 @@ async def update( self, *, zone_id: str, - scope: Literal["incoming", "both"], + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> URLNormalizationUpdateResponse: """ Updates the URL Normalization settings. @@ -255,7 +255,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Deletes the URL Normalization settings. @@ -291,7 +291,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> URLNormalizationGetResponse: """ Fetches the current URL Normalization settings. diff --git a/src/cloudflare/resources/url_scanner/responses.py b/src/cloudflare/resources/url_scanner/responses.py index 8ff974e8007..d7380f1688f 100644 --- a/src/cloudflare/resources/url_scanner/responses.py +++ b/src/cloudflare/resources/url_scanner/responses.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -48,7 +48,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Returns the raw response of the network request. @@ -112,7 +112,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Returns the raw response of the network request. diff --git a/src/cloudflare/resources/url_scanner/scans.py b/src/cloudflare/resources/url_scanner/scans.py index a825774b4c9..b1fad6e2dfa 100644 --- a/src/cloudflare/resources/url_scanner/scans.py +++ b/src/cloudflare/resources/url_scanner/scans.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -258,18 +258,18 @@ def create( "ZM", "ZW", ] - | NotGiven = NOT_GIVEN, - customagent: str | NotGiven = NOT_GIVEN, - custom_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - referer: str | NotGiven = NOT_GIVEN, - screenshots_resolutions: List[Literal["desktop", "mobile", "tablet"]] | NotGiven = NOT_GIVEN, - visibility: Literal["Public", "Unlisted"] | NotGiven = NOT_GIVEN, + | Omit = omit, + customagent: str | Omit = omit, + custom_headers: Dict[str, str] | Omit = omit, + referer: str | Omit = omit, + screenshots_resolutions: List[Literal["desktop", "mobile", "tablet"]] | Omit = omit, + visibility: Literal["Public", "Unlisted"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScanCreateResponse: """Submit a URL to scan. @@ -325,14 +325,14 @@ def list( self, *, account_id: str, - q: str | NotGiven = NOT_GIVEN, - size: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScanListResponse: """Use a subset of ElasticSearch Query syntax to filter scans. @@ -384,13 +384,13 @@ def bulk_create( self, *, account_id: str, - body: Iterable[scan_bulk_create_params.Body] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScanBulkCreateResponse: """Submit URLs to scan. @@ -433,7 +433,7 @@ def dom( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Returns a plain text response, with the scan's DOM content as rendered by @@ -475,7 +475,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScanGetResponse: """ Get URL scan by uuid @@ -515,7 +515,7 @@ def har( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScanHARResponse: """Get a URL scan's HAR file. @@ -552,13 +552,13 @@ def screenshot( scan_id: str, *, account_id: str, - resolution: Literal["desktop", "mobile", "tablet"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """ Get scan's screenshot by resolution (desktop/mobile/tablet). @@ -818,18 +818,18 @@ async def create( "ZM", "ZW", ] - | NotGiven = NOT_GIVEN, - customagent: str | NotGiven = NOT_GIVEN, - custom_headers: Dict[str, str] | NotGiven = NOT_GIVEN, - referer: str | NotGiven = NOT_GIVEN, - screenshots_resolutions: List[Literal["desktop", "mobile", "tablet"]] | NotGiven = NOT_GIVEN, - visibility: Literal["Public", "Unlisted"] | NotGiven = NOT_GIVEN, + | Omit = omit, + customagent: str | Omit = omit, + custom_headers: Dict[str, str] | Omit = omit, + referer: str | Omit = omit, + screenshots_resolutions: List[Literal["desktop", "mobile", "tablet"]] | Omit = omit, + visibility: Literal["Public", "Unlisted"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScanCreateResponse: """Submit a URL to scan. @@ -885,14 +885,14 @@ async def list( self, *, account_id: str, - q: str | NotGiven = NOT_GIVEN, - size: int | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScanListResponse: """Use a subset of ElasticSearch Query syntax to filter scans. @@ -944,13 +944,13 @@ async def bulk_create( self, *, account_id: str, - body: Iterable[scan_bulk_create_params.Body] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScanBulkCreateResponse: """Submit URLs to scan. @@ -993,7 +993,7 @@ async def dom( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Returns a plain text response, with the scan's DOM content as rendered by @@ -1035,7 +1035,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScanGetResponse: """ Get URL scan by uuid @@ -1075,7 +1075,7 @@ async def har( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScanHARResponse: """Get a URL scan's HAR file. @@ -1112,13 +1112,13 @@ async def screenshot( scan_id: str, *, account_id: str, - resolution: Literal["desktop", "mobile", "tablet"] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """ Get scan's screenshot by resolution (desktop/mobile/tablet). diff --git a/src/cloudflare/resources/user/audit_logs.py b/src/cloudflare/resources/user/audit_logs.py index 876dd035112..20c235345c0 100644 --- a/src/cloudflare/resources/user/audit_logs.py +++ b/src/cloudflare/resources/user/audit_logs.py @@ -8,7 +8,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,23 +49,23 @@ def with_streaming_response(self) -> AuditLogsResourceWithStreamingResponse: def list( self, *, - id: str | NotGiven = NOT_GIVEN, - action: audit_log_list_params.Action | NotGiven = NOT_GIVEN, - actor: audit_log_list_params.Actor | NotGiven = NOT_GIVEN, - before: Union[Union[str, date], Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - export: bool | NotGiven = NOT_GIVEN, - hide_user_logs: bool | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - since: Union[Union[str, date], Union[str, datetime]] | NotGiven = NOT_GIVEN, - zone: audit_log_list_params.Zone | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[AuditLog]: """Gets a list of audit logs for a user account. @@ -151,23 +151,23 @@ def with_streaming_response(self) -> AsyncAuditLogsResourceWithStreamingResponse def list( self, *, - id: str | NotGiven = NOT_GIVEN, - action: audit_log_list_params.Action | NotGiven = NOT_GIVEN, - actor: audit_log_list_params.Actor | NotGiven = NOT_GIVEN, - before: Union[Union[str, date], Union[str, datetime]] | NotGiven = NOT_GIVEN, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - export: bool | NotGiven = NOT_GIVEN, - hide_user_logs: bool | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - since: Union[Union[str, date], Union[str, datetime]] | NotGiven = NOT_GIVEN, - zone: audit_log_list_params.Zone | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AuditLog, AsyncV4PagePaginationArray[AuditLog]]: """Gets a list of audit logs for a user account. diff --git a/src/cloudflare/resources/user/billing/history.py b/src/cloudflare/resources/user/billing/history.py index 44464d63dc9..870295b9764 100644 --- a/src/cloudflare/resources/user/billing/history.py +++ b/src/cloudflare/resources/user/billing/history.py @@ -9,7 +9,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,18 +51,18 @@ def with_streaming_response(self) -> HistoryResourceWithStreamingResponse: def list( self, *, - action: str | NotGiven = NOT_GIVEN, - occurred_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - order: Literal["type", "occurred_at", "action"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + action: str | Omit = omit, + occurred_at: Union[str, datetime] | Omit = omit, + order: Literal["type", "occurred_at", "action"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[BillingHistory]: """ Accesses your billing history object. @@ -136,18 +136,18 @@ def with_streaming_response(self) -> AsyncHistoryResourceWithStreamingResponse: def list( self, *, - action: str | NotGiven = NOT_GIVEN, - occurred_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - order: Literal["type", "occurred_at", "action"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + action: str | Omit = omit, + occurred_at: Union[str, datetime] | Omit = omit, + order: Literal["type", "occurred_at", "action"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + type: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[BillingHistory, AsyncV4PagePaginationArray[BillingHistory]]: """ Accesses your billing history object. @@ -203,7 +203,7 @@ def __init__(self, history: HistoryResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - history.list # pyright: ignore[reportDeprecated], + history.list, # pyright: ignore[reportDeprecated], ) ) @@ -214,7 +214,7 @@ def __init__(self, history: AsyncHistoryResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - history.list # pyright: ignore[reportDeprecated], + history.list, # pyright: ignore[reportDeprecated], ) ) @@ -225,7 +225,7 @@ def __init__(self, history: HistoryResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - history.list # pyright: ignore[reportDeprecated], + history.list, # pyright: ignore[reportDeprecated], ) ) @@ -236,6 +236,6 @@ def __init__(self, history: AsyncHistoryResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - history.list # pyright: ignore[reportDeprecated], + history.list, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/user/billing/profile.py b/src/cloudflare/resources/user/billing/profile.py index cae0264f156..93456e90682 100644 --- a/src/cloudflare/resources/user/billing/profile.py +++ b/src/cloudflare/resources/user/billing/profile.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProfileGetResponse: """Accesses your billing profile object.""" return self._get( @@ -97,7 +97,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProfileGetResponse: """Accesses your billing profile object.""" return await self._get( @@ -119,7 +119,7 @@ def __init__(self, profile: ProfileResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - profile.get # pyright: ignore[reportDeprecated], + profile.get, # pyright: ignore[reportDeprecated], ) ) @@ -130,7 +130,7 @@ def __init__(self, profile: AsyncProfileResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - profile.get # pyright: ignore[reportDeprecated], + profile.get, # pyright: ignore[reportDeprecated], ) ) @@ -141,7 +141,7 @@ def __init__(self, profile: ProfileResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - profile.get # pyright: ignore[reportDeprecated], + profile.get, # pyright: ignore[reportDeprecated], ) ) @@ -152,6 +152,6 @@ def __init__(self, profile: AsyncProfileResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - profile.get # pyright: ignore[reportDeprecated], + profile.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/user/invites.py b/src/cloudflare/resources/user/invites.py index fb64c1b5956..6bfa26e944a 100644 --- a/src/cloudflare/resources/user/invites.py +++ b/src/cloudflare/resources/user/invites.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,7 +54,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Invite]: """Lists all invitations associated with my user.""" return self._get_api_list( @@ -76,7 +76,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Invite]: """ Responds to an invitation. @@ -118,7 +118,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Invite]: """ Gets the details of an invitation. @@ -177,7 +177,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Invite, AsyncSinglePage[Invite]]: """Lists all invitations associated with my user.""" return self._get_api_list( @@ -199,7 +199,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Invite]: """ Responds to an invitation. @@ -241,7 +241,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Invite]: """ Gets the details of an invitation. diff --git a/src/cloudflare/resources/user/organizations.py b/src/cloudflare/resources/user/organizations.py index 41fcbf9876b..dd4099e4097 100644 --- a/src/cloudflare/resources/user/organizations.py +++ b/src/cloudflare/resources/user/organizations.py @@ -8,7 +8,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,19 +52,19 @@ def with_streaming_response(self) -> OrganizationsResourceWithStreamingResponse: def list( self, *, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["id", "name", "status"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["member", "invited"] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + name: str | Omit = omit, + order: Literal["id", "name", "status"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["member", "invited"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Organization]: """ Lists organizations the user is associated with. @@ -126,7 +126,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationDeleteResponse: """ Removes association to an organization. @@ -162,7 +162,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Gets a specific organization the user is associated with. @@ -217,19 +217,19 @@ def with_streaming_response(self) -> AsyncOrganizationsResourceWithStreamingResp def list( self, *, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["id", "name", "status"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["member", "invited"] | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + name: str | Omit = omit, + order: Literal["id", "name", "status"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["member", "invited"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Organization, AsyncV4PagePaginationArray[Organization]]: """ Lists organizations the user is associated with. @@ -291,7 +291,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OrganizationDeleteResponse: """ Removes association to an organization. @@ -327,7 +327,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Gets a specific organization the user is associated with. @@ -364,17 +364,17 @@ def __init__(self, organizations: OrganizationsResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - organizations.list # pyright: ignore[reportDeprecated], + organizations.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - organizations.delete # pyright: ignore[reportDeprecated], + organizations.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - organizations.get # pyright: ignore[reportDeprecated], + organizations.get, # pyright: ignore[reportDeprecated], ) ) @@ -385,17 +385,17 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - organizations.list # pyright: ignore[reportDeprecated], + organizations.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - organizations.delete # pyright: ignore[reportDeprecated], + organizations.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - organizations.get # pyright: ignore[reportDeprecated], + organizations.get, # pyright: ignore[reportDeprecated], ) ) @@ -406,17 +406,17 @@ def __init__(self, organizations: OrganizationsResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - organizations.list # pyright: ignore[reportDeprecated], + organizations.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - organizations.delete # pyright: ignore[reportDeprecated], + organizations.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - organizations.get # pyright: ignore[reportDeprecated], + organizations.get, # pyright: ignore[reportDeprecated], ) ) @@ -427,16 +427,16 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - organizations.list # pyright: ignore[reportDeprecated], + organizations.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - organizations.delete # pyright: ignore[reportDeprecated], + organizations.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - organizations.get # pyright: ignore[reportDeprecated], + organizations.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/user/subscriptions.py b/src/cloudflare/resources/user/subscriptions.py index 157352b7e87..7b5684234d6 100644 --- a/src/cloudflare/resources/user/subscriptions.py +++ b/src/cloudflare/resources/user/subscriptions.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,14 +53,14 @@ def update( self, identifier: str, *, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubscriptionUpdateResponse: """ Updates a user's subscriptions. @@ -115,7 +115,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubscriptionDeleteResponse: """ Deletes a user's subscription. @@ -149,7 +149,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Subscription]: """Lists all of a user's subscriptions.""" return self._get_api_list( @@ -186,14 +186,14 @@ async def update( self, identifier: str, *, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubscriptionUpdateResponse: """ Updates a user's subscriptions. @@ -248,7 +248,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubscriptionDeleteResponse: """ Deletes a user's subscription. @@ -282,7 +282,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Subscription, AsyncSinglePage[Subscription]]: """Lists all of a user's subscriptions.""" return self._get_api_list( diff --git a/src/cloudflare/resources/user/tokens/permission_groups.py b/src/cloudflare/resources/user/tokens/permission_groups.py index 87479a4720e..a1bdcdc2e1a 100644 --- a/src/cloudflare/resources/user/tokens/permission_groups.py +++ b/src/cloudflare/resources/user/tokens/permission_groups.py @@ -4,7 +4,8 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 ( @@ -15,6 +16,7 @@ ) from ....pagination import SyncSinglePage, AsyncSinglePage from ...._base_client import AsyncPaginator, make_request_options +from ....types.user.tokens import permission_group_list_params from ....types.user.tokens.permission_group_list_response import PermissionGroupListResponse __all__ = ["PermissionGroupsResource", "AsyncPermissionGroupsResource"] @@ -43,19 +45,46 @@ def with_streaming_response(self) -> PermissionGroupsResourceWithStreamingRespon def list( self, *, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[PermissionGroupListResponse]: - """Find all available permission groups for API Tokens""" + """ + Find all available permission groups for API Tokens + + Args: + name: Filter by the name of the permission group. The value must be URL-encoded. + + scope: Filter by the scope of the permission group. The value must be URL-encoded. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( "/user/tokens/permission_groups", page=SyncSinglePage[PermissionGroupListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "name": name, + "scope": scope, + }, + permission_group_list_params.PermissionGroupListParams, + ), ), model=PermissionGroupListResponse, ) @@ -84,19 +113,46 @@ def with_streaming_response(self) -> AsyncPermissionGroupsResourceWithStreamingR def list( self, *, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PermissionGroupListResponse, AsyncSinglePage[PermissionGroupListResponse]]: - """Find all available permission groups for API Tokens""" + """ + Find all available permission groups for API Tokens + + Args: + name: Filter by the name of the permission group. The value must be URL-encoded. + + scope: Filter by the scope of the permission group. The value must be URL-encoded. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( "/user/tokens/permission_groups", page=AsyncSinglePage[PermissionGroupListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "name": name, + "scope": scope, + }, + permission_group_list_params.PermissionGroupListParams, + ), ), model=PermissionGroupListResponse, ) diff --git a/src/cloudflare/resources/user/tokens/tokens.py b/src/cloudflare/resources/user/tokens/tokens.py index a3a10f41216..01277f2610d 100644 --- a/src/cloudflare/resources/user/tokens/tokens.py +++ b/src/cloudflare/resources/user/tokens/tokens.py @@ -16,7 +16,7 @@ ValueResourceWithStreamingResponse, AsyncValueResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -80,15 +80,15 @@ def create( *, name: str, policies: Iterable[TokenPolicy], - condition: token_create_params.Condition | NotGiven = NOT_GIVEN, - expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + condition: token_create_params.Condition | Omit = omit, + expires_on: Union[str, datetime] | Omit = omit, + not_before: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenCreateResponse]: """ Create a new access token. @@ -139,16 +139,16 @@ def update( *, name: str, policies: Iterable[TokenPolicy], - status: Literal["active", "disabled", "expired"], - condition: token_update_params.Condition | NotGiven = NOT_GIVEN, - expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + condition: token_update_params.Condition | Omit = omit, + expires_on: Union[str, datetime] | Omit = omit, + not_before: Union[str, datetime] | Omit = omit, + status: Literal["active", "disabled", "expired"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Token]: """ Update an existing token. @@ -160,13 +160,13 @@ def update( policies: List of access policies assigned to the token. - status: Status of the token. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for processing. not_before: The time before which the token MUST NOT be accepted for processing. + status: Status of the token. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -183,10 +183,10 @@ def update( { "name": name, "policies": policies, - "status": status, "condition": condition, "expires_on": expires_on, "not_before": not_before, + "status": status, }, token_update_params.TokenUpdateParams, ), @@ -203,15 +203,15 @@ def update( def list( self, *, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Token]: """ List all access tokens you created. @@ -260,7 +260,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenDeleteResponse]: """ Destroy a token. @@ -299,7 +299,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Token]: """ Get information about a specific token. @@ -337,7 +337,7 @@ def verify( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenVerifyResponse]: """Test whether a token works.""" return self._get( @@ -386,15 +386,15 @@ async def create( *, name: str, policies: Iterable[TokenPolicy], - condition: token_create_params.Condition | NotGiven = NOT_GIVEN, - expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + condition: token_create_params.Condition | Omit = omit, + expires_on: Union[str, datetime] | Omit = omit, + not_before: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenCreateResponse]: """ Create a new access token. @@ -445,16 +445,16 @@ async def update( *, name: str, policies: Iterable[TokenPolicy], - status: Literal["active", "disabled", "expired"], - condition: token_update_params.Condition | NotGiven = NOT_GIVEN, - expires_on: Union[str, datetime] | NotGiven = NOT_GIVEN, - not_before: Union[str, datetime] | NotGiven = NOT_GIVEN, + condition: token_update_params.Condition | Omit = omit, + expires_on: Union[str, datetime] | Omit = omit, + not_before: Union[str, datetime] | Omit = omit, + status: Literal["active", "disabled", "expired"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Token]: """ Update an existing token. @@ -466,13 +466,13 @@ async def update( policies: List of access policies assigned to the token. - status: Status of the token. - expires_on: The expiration time on or after which the JWT MUST NOT be accepted for processing. not_before: The time before which the token MUST NOT be accepted for processing. + status: Status of the token. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -489,10 +489,10 @@ async def update( { "name": name, "policies": policies, - "status": status, "condition": condition, "expires_on": expires_on, "not_before": not_before, + "status": status, }, token_update_params.TokenUpdateParams, ), @@ -509,15 +509,15 @@ async def update( def list( self, *, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Token, AsyncV4PagePaginationArray[Token]]: """ List all access tokens you created. @@ -566,7 +566,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenDeleteResponse]: """ Destroy a token. @@ -605,7 +605,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Token]: """ Get information about a specific token. @@ -643,7 +643,7 @@ async def verify( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TokenVerifyResponse]: """Test whether a token works.""" return await self._get( diff --git a/src/cloudflare/resources/user/tokens/value.py b/src/cloudflare/resources/user/tokens/value.py index defc50b0c9d..063d76b1e91 100644 --- a/src/cloudflare/resources/user/tokens/value.py +++ b/src/cloudflare/resources/user/tokens/value.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,7 +54,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Roll the token secret. @@ -116,7 +116,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Roll the token secret. diff --git a/src/cloudflare/resources/user/user.py b/src/cloudflare/resources/user/user.py index 961875a9428..da999f1c09e 100644 --- a/src/cloudflare/resources/user/user.py +++ b/src/cloudflare/resources/user/user.py @@ -14,7 +14,7 @@ InvitesResourceWithStreamingResponse, AsyncInvitesResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .audit_logs import ( @@ -120,17 +120,17 @@ def with_streaming_response(self) -> UserResourceWithStreamingResponse: def edit( self, *, - country: Optional[str] | NotGiven = NOT_GIVEN, - first_name: Optional[str] | NotGiven = NOT_GIVEN, - last_name: Optional[str] | NotGiven = NOT_GIVEN, - telephone: Optional[str] | NotGiven = NOT_GIVEN, - zipcode: Optional[str] | NotGiven = NOT_GIVEN, + country: Optional[str] | Omit = omit, + first_name: Optional[str] | Omit = omit, + last_name: Optional[str] | Omit = omit, + telephone: Optional[str] | Omit = omit, + zipcode: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserEditResponse]: """ Edit part of your user details. @@ -184,7 +184,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserGetResponse]: """User Details""" return self._get( @@ -247,17 +247,17 @@ def with_streaming_response(self) -> AsyncUserResourceWithStreamingResponse: async def edit( self, *, - country: Optional[str] | NotGiven = NOT_GIVEN, - first_name: Optional[str] | NotGiven = NOT_GIVEN, - last_name: Optional[str] | NotGiven = NOT_GIVEN, - telephone: Optional[str] | NotGiven = NOT_GIVEN, - zipcode: Optional[str] | NotGiven = NOT_GIVEN, + country: Optional[str] | Omit = omit, + first_name: Optional[str] | Omit = omit, + last_name: Optional[str] | Omit = omit, + telephone: Optional[str] | Omit = omit, + zipcode: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserEditResponse]: """ Edit part of your user details. @@ -311,7 +311,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserGetResponse]: """User Details""" return await self._get( diff --git a/src/cloudflare/resources/vectorize/indexes/indexes.py b/src/cloudflare/resources/vectorize/indexes/indexes.py index 8b34eb74d96..a001e62b7fb 100644 --- a/src/cloudflare/resources/vectorize/indexes/indexes.py +++ b/src/cloudflare/resources/vectorize/indexes/indexes.py @@ -2,12 +2,22 @@ from __future__ import annotations -from typing import Any, List, Type, Iterable, Optional, cast +from typing import Any, Type, Iterable, Optional, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import ( + Body, + Omit, + Query, + Headers, + NotGiven, + FileTypes, + SequenceNotStr, + omit, + not_given, +) from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -34,6 +44,7 @@ index_insert_params, index_upsert_params, index_get_by_ids_params, + index_list_vectors_params, index_delete_by_ids_params, ) from ....types.vectorize.create_index import CreateIndex @@ -42,6 +53,7 @@ from ....types.vectorize.index_delete_response import IndexDeleteResponse from ....types.vectorize.index_insert_response import IndexInsertResponse from ....types.vectorize.index_upsert_response import IndexUpsertResponse +from ....types.vectorize.index_list_vectors_response import IndexListVectorsResponse from ....types.vectorize.index_delete_by_ids_response import IndexDeleteByIDsResponse __all__ = ["IndexesResource", "AsyncIndexesResource"] @@ -77,13 +89,13 @@ def create( account_id: str, config: index_create_params.Config, name: str, - description: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CreateIndex]: """ Creates and returns a new Vectorize Index. @@ -134,7 +146,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CreateIndex]: """ Returns a list of Vectorize Indexes @@ -171,7 +183,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexDeleteResponse]: """ Deletes the specified Vectorize Index. @@ -213,13 +225,13 @@ def delete_by_ids( index_name: str, *, account_id: str, - ids: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexDeleteByIDsResponse]: """ Delete a set of vectors from an index by their vector identifiers. @@ -264,7 +276,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CreateIndex]: """ Returns the specified Vectorize Index. @@ -301,13 +313,13 @@ def get_by_ids( index_name: str, *, account_id: str, - ids: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Get a set of vectors from an index by their vector identifiers. @@ -352,7 +364,7 @@ def info( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexInfoResponse]: """ Get information about a vectorize index. @@ -389,14 +401,14 @@ def insert( index_name: str, *, account_id: str, - body: str, - unparsable_behavior: Literal["error", "discard"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexInsertResponse]: """ Inserts vectors into the specified index and returns a mutation id corresponding @@ -437,22 +449,77 @@ def insert( cast_to=cast(Type[Optional[IndexInsertResponse]], ResultWrapper[IndexInsertResponse]), ) + def list_vectors( + self, + index_name: str, + *, + 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. + # The extra values given here take precedence over values defined on the client or passed to this 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[IndexListVectorsResponse]: + """ + Returns a paginated list of vector identifiers from the specified index. + + Args: + account_id: Identifier + + count: Maximum number of vectors to return + + cursor: Cursor for pagination to get the next page of results + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 index_name: + raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}") + return self._get( + f"/accounts/{account_id}/vectorize/v2/indexes/{index_name}/list", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "count": count, + "cursor": cursor, + }, + index_list_vectors_params.IndexListVectorsParams, + ), + post_parser=ResultWrapper[Optional[IndexListVectorsResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[IndexListVectorsResponse]], ResultWrapper[IndexListVectorsResponse]), + ) + def query( self, index_name: str, *, account_id: str, vector: Iterable[float], - filter: object | NotGiven = NOT_GIVEN, - return_metadata: Literal["none", "indexed", "all"] | NotGiven = NOT_GIVEN, - return_values: bool | NotGiven = NOT_GIVEN, - top_k: float | NotGiven = NOT_GIVEN, + filter: object | Omit = omit, + return_metadata: Literal["none", "indexed", "all"] | Omit = omit, + return_values: bool | Omit = omit, + top_k: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexQueryResponse]: """ Finds vectors closest to a given vector in an index. @@ -510,14 +577,14 @@ def upsert( index_name: str, *, account_id: str, - body: str, - unparsable_behavior: Literal["error", "discard"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexUpsertResponse]: """ Upserts vectors into the specified index, creating them if they do not exist and @@ -589,13 +656,13 @@ async def create( account_id: str, config: index_create_params.Config, name: str, - description: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CreateIndex]: """ Creates and returns a new Vectorize Index. @@ -646,7 +713,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CreateIndex, AsyncSinglePage[CreateIndex]]: """ Returns a list of Vectorize Indexes @@ -683,7 +750,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexDeleteResponse]: """ Deletes the specified Vectorize Index. @@ -725,13 +792,13 @@ async def delete_by_ids( index_name: str, *, account_id: str, - ids: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexDeleteByIDsResponse]: """ Delete a set of vectors from an index by their vector identifiers. @@ -776,7 +843,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CreateIndex]: """ Returns the specified Vectorize Index. @@ -813,13 +880,13 @@ async def get_by_ids( index_name: str, *, account_id: str, - ids: List[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Get a set of vectors from an index by their vector identifiers. @@ -864,7 +931,7 @@ async def info( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexInfoResponse]: """ Get information about a vectorize index. @@ -901,14 +968,14 @@ async def insert( index_name: str, *, account_id: str, - body: str, - unparsable_behavior: Literal["error", "discard"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexInsertResponse]: """ Inserts vectors into the specified index and returns a mutation id corresponding @@ -949,22 +1016,77 @@ async def insert( cast_to=cast(Type[Optional[IndexInsertResponse]], ResultWrapper[IndexInsertResponse]), ) + async def list_vectors( + self, + index_name: str, + *, + 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. + # The extra values given here take precedence over values defined on the client or passed to this 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[IndexListVectorsResponse]: + """ + Returns a paginated list of vector identifiers from the specified index. + + Args: + account_id: Identifier + + count: Maximum number of vectors to return + + cursor: Cursor for pagination to get the next page of results + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 index_name: + raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}") + return await self._get( + f"/accounts/{account_id}/vectorize/v2/indexes/{index_name}/list", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "count": count, + "cursor": cursor, + }, + index_list_vectors_params.IndexListVectorsParams, + ), + post_parser=ResultWrapper[Optional[IndexListVectorsResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[IndexListVectorsResponse]], ResultWrapper[IndexListVectorsResponse]), + ) + async def query( self, index_name: str, *, account_id: str, vector: Iterable[float], - filter: object | NotGiven = NOT_GIVEN, - return_metadata: Literal["none", "indexed", "all"] | NotGiven = NOT_GIVEN, - return_values: bool | NotGiven = NOT_GIVEN, - top_k: float | NotGiven = NOT_GIVEN, + filter: object | Omit = omit, + return_metadata: Literal["none", "indexed", "all"] | Omit = omit, + return_values: bool | Omit = omit, + top_k: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexQueryResponse]: """ Finds vectors closest to a given vector in an index. @@ -1022,14 +1144,14 @@ async def upsert( index_name: str, *, account_id: str, - body: str, - unparsable_behavior: Literal["error", "discard"] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndexUpsertResponse]: """ Upserts vectors into the specified index, creating them if they do not exist and @@ -1099,6 +1221,9 @@ def __init__(self, indexes: IndexesResource) -> None: self.insert = to_raw_response_wrapper( indexes.insert, ) + self.list_vectors = to_raw_response_wrapper( + indexes.list_vectors, + ) self.query = to_raw_response_wrapper( indexes.query, ) @@ -1139,6 +1264,9 @@ def __init__(self, indexes: AsyncIndexesResource) -> None: self.insert = async_to_raw_response_wrapper( indexes.insert, ) + self.list_vectors = async_to_raw_response_wrapper( + indexes.list_vectors, + ) self.query = async_to_raw_response_wrapper( indexes.query, ) @@ -1179,6 +1307,9 @@ def __init__(self, indexes: IndexesResource) -> None: self.insert = to_streamed_response_wrapper( indexes.insert, ) + self.list_vectors = to_streamed_response_wrapper( + indexes.list_vectors, + ) self.query = to_streamed_response_wrapper( indexes.query, ) @@ -1219,6 +1350,9 @@ def __init__(self, indexes: AsyncIndexesResource) -> None: self.insert = async_to_streamed_response_wrapper( indexes.insert, ) + self.list_vectors = async_to_streamed_response_wrapper( + indexes.list_vectors, + ) self.query = async_to_streamed_response_wrapper( indexes.query, ) diff --git a/src/cloudflare/resources/vectorize/indexes/metadata_index.py b/src/cloudflare/resources/vectorize/indexes/metadata_index.py index c852d1cb920..36b3d445971 100644 --- a/src/cloudflare/resources/vectorize/indexes/metadata_index.py +++ b/src/cloudflare/resources/vectorize/indexes/metadata_index.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -59,7 +59,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MetadataIndexCreateResponse]: """Enable metadata filtering based on metadata property. @@ -113,7 +113,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MetadataIndexListResponse]: """ List Metadata Indexes for the specified Vectorize Index. @@ -156,7 +156,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MetadataIndexDeleteResponse]: """ Allow Vectorize to delete the specified metadata index. @@ -226,7 +226,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MetadataIndexCreateResponse]: """Enable metadata filtering based on metadata property. @@ -280,7 +280,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MetadataIndexListResponse]: """ List Metadata Indexes for the specified Vectorize Index. @@ -323,7 +323,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MetadataIndexDeleteResponse]: """ Allow Vectorize to delete the specified metadata index. diff --git a/src/cloudflare/resources/waiting_rooms/events/details.py b/src/cloudflare/resources/waiting_rooms/events/details.py index 566c55506fa..0d73f1971a2 100644 --- a/src/cloudflare/resources/waiting_rooms/events/details.py +++ b/src/cloudflare/resources/waiting_rooms/events/details.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -53,7 +53,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DetailGetResponse: """Previews an event's configuration as if it was active. @@ -121,7 +121,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DetailGetResponse: """Previews an event's configuration as if it was active. diff --git a/src/cloudflare/resources/waiting_rooms/events/events.py b/src/cloudflare/resources/waiting_rooms/events/events.py index 9988a366864..8acaec8e460 100644 --- a/src/cloudflare/resources/waiting_rooms/events/events.py +++ b/src/cloudflare/resources/waiting_rooms/events/events.py @@ -15,7 +15,7 @@ DetailsResourceWithStreamingResponse, AsyncDetailsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -67,25 +67,25 @@ def create( event_end_time: str, event_start_time: str, name: str, - custom_page_html: Optional[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: Optional[bool] | NotGiven = NOT_GIVEN, - new_users_per_minute: Optional[int] | NotGiven = NOT_GIVEN, - prequeue_start_time: Optional[str] | NotGiven = NOT_GIVEN, - queueing_method: Optional[str] | NotGiven = NOT_GIVEN, - session_duration: Optional[int] | NotGiven = NOT_GIVEN, - shuffle_at_event_start: bool | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - total_active_users: Optional[int] | NotGiven = NOT_GIVEN, - turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN, + custom_page_html: Optional[str] | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: Optional[bool] | Omit = omit, + new_users_per_minute: Optional[int] | Omit = omit, + prequeue_start_time: Optional[str] | Omit = omit, + queueing_method: Optional[str] | Omit = omit, + session_duration: Optional[int] | Omit = omit, + shuffle_at_event_start: bool | Omit = omit, + suspended: bool | Omit = omit, + total_active_users: Optional[int] | Omit = omit, + turnstile_action: Optional[Literal["log", "infinite_queue"]] | Omit = omit, turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Event: """Only available for the Waiting Room Advanced subscription. @@ -203,25 +203,25 @@ def update( event_end_time: str, event_start_time: str, name: str, - custom_page_html: Optional[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: Optional[bool] | NotGiven = NOT_GIVEN, - new_users_per_minute: Optional[int] | NotGiven = NOT_GIVEN, - prequeue_start_time: Optional[str] | NotGiven = NOT_GIVEN, - queueing_method: Optional[str] | NotGiven = NOT_GIVEN, - session_duration: Optional[int] | NotGiven = NOT_GIVEN, - shuffle_at_event_start: bool | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - total_active_users: Optional[int] | NotGiven = NOT_GIVEN, - turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN, + custom_page_html: Optional[str] | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: Optional[bool] | Omit = omit, + new_users_per_minute: Optional[int] | Omit = omit, + prequeue_start_time: Optional[str] | Omit = omit, + queueing_method: Optional[str] | Omit = omit, + session_duration: Optional[int] | Omit = omit, + shuffle_at_event_start: bool | Omit = omit, + suspended: bool | Omit = omit, + total_active_users: Optional[int] | Omit = omit, + turnstile_action: Optional[Literal["log", "infinite_queue"]] | Omit = omit, turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Event: """ Updates a configured event for a waiting room. @@ -331,14 +331,14 @@ def list( waiting_room_id: str, *, zone_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Event]: """ Lists events for a waiting room. @@ -392,7 +392,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventDeleteResponse: """ Deletes an event for a waiting room. @@ -435,25 +435,25 @@ def edit( event_end_time: str, event_start_time: str, name: str, - custom_page_html: Optional[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: Optional[bool] | NotGiven = NOT_GIVEN, - new_users_per_minute: Optional[int] | NotGiven = NOT_GIVEN, - prequeue_start_time: Optional[str] | NotGiven = NOT_GIVEN, - queueing_method: Optional[str] | NotGiven = NOT_GIVEN, - session_duration: Optional[int] | NotGiven = NOT_GIVEN, - shuffle_at_event_start: bool | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - total_active_users: Optional[int] | NotGiven = NOT_GIVEN, - turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN, + custom_page_html: Optional[str] | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: Optional[bool] | Omit = omit, + new_users_per_minute: Optional[int] | Omit = omit, + prequeue_start_time: Optional[str] | Omit = omit, + queueing_method: Optional[str] | Omit = omit, + session_duration: Optional[int] | Omit = omit, + shuffle_at_event_start: bool | Omit = omit, + suspended: bool | Omit = omit, + total_active_users: Optional[int] | Omit = omit, + turnstile_action: Optional[Literal["log", "infinite_queue"]] | Omit = omit, turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Event: """ Patches a configured event for a waiting room. @@ -569,7 +569,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Event: """ Fetches a single configured event for a waiting room. @@ -636,25 +636,25 @@ async def create( event_end_time: str, event_start_time: str, name: str, - custom_page_html: Optional[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: Optional[bool] | NotGiven = NOT_GIVEN, - new_users_per_minute: Optional[int] | NotGiven = NOT_GIVEN, - prequeue_start_time: Optional[str] | NotGiven = NOT_GIVEN, - queueing_method: Optional[str] | NotGiven = NOT_GIVEN, - session_duration: Optional[int] | NotGiven = NOT_GIVEN, - shuffle_at_event_start: bool | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - total_active_users: Optional[int] | NotGiven = NOT_GIVEN, - turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN, + custom_page_html: Optional[str] | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: Optional[bool] | Omit = omit, + new_users_per_minute: Optional[int] | Omit = omit, + prequeue_start_time: Optional[str] | Omit = omit, + queueing_method: Optional[str] | Omit = omit, + session_duration: Optional[int] | Omit = omit, + shuffle_at_event_start: bool | Omit = omit, + suspended: bool | Omit = omit, + total_active_users: Optional[int] | Omit = omit, + turnstile_action: Optional[Literal["log", "infinite_queue"]] | Omit = omit, turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Event: """Only available for the Waiting Room Advanced subscription. @@ -772,25 +772,25 @@ async def update( event_end_time: str, event_start_time: str, name: str, - custom_page_html: Optional[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: Optional[bool] | NotGiven = NOT_GIVEN, - new_users_per_minute: Optional[int] | NotGiven = NOT_GIVEN, - prequeue_start_time: Optional[str] | NotGiven = NOT_GIVEN, - queueing_method: Optional[str] | NotGiven = NOT_GIVEN, - session_duration: Optional[int] | NotGiven = NOT_GIVEN, - shuffle_at_event_start: bool | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - total_active_users: Optional[int] | NotGiven = NOT_GIVEN, - turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN, + custom_page_html: Optional[str] | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: Optional[bool] | Omit = omit, + new_users_per_minute: Optional[int] | Omit = omit, + prequeue_start_time: Optional[str] | Omit = omit, + queueing_method: Optional[str] | Omit = omit, + session_duration: Optional[int] | Omit = omit, + shuffle_at_event_start: bool | Omit = omit, + suspended: bool | Omit = omit, + total_active_users: Optional[int] | Omit = omit, + turnstile_action: Optional[Literal["log", "infinite_queue"]] | Omit = omit, turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Event: """ Updates a configured event for a waiting room. @@ -900,14 +900,14 @@ def list( waiting_room_id: str, *, zone_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Event, AsyncV4PagePaginationArray[Event]]: """ Lists events for a waiting room. @@ -961,7 +961,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EventDeleteResponse: """ Deletes an event for a waiting room. @@ -1004,25 +1004,25 @@ async def edit( event_end_time: str, event_start_time: str, name: str, - custom_page_html: Optional[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: Optional[bool] | NotGiven = NOT_GIVEN, - new_users_per_minute: Optional[int] | NotGiven = NOT_GIVEN, - prequeue_start_time: Optional[str] | NotGiven = NOT_GIVEN, - queueing_method: Optional[str] | NotGiven = NOT_GIVEN, - session_duration: Optional[int] | NotGiven = NOT_GIVEN, - shuffle_at_event_start: bool | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - total_active_users: Optional[int] | NotGiven = NOT_GIVEN, - turnstile_action: Optional[Literal["log", "infinite_queue"]] | NotGiven = NOT_GIVEN, + custom_page_html: Optional[str] | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: Optional[bool] | Omit = omit, + new_users_per_minute: Optional[int] | Omit = omit, + prequeue_start_time: Optional[str] | Omit = omit, + queueing_method: Optional[str] | Omit = omit, + session_duration: Optional[int] | Omit = omit, + shuffle_at_event_start: bool | Omit = omit, + suspended: bool | Omit = omit, + total_active_users: Optional[int] | Omit = omit, + turnstile_action: Optional[Literal["log", "infinite_queue"]] | Omit = omit, turnstile_mode: Optional[Literal["off", "invisible", "visible_non_interactive", "visible_managed"]] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Event: """ Patches a configured event for a waiting room. @@ -1138,7 +1138,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Event: """ Fetches a single configured event for a waiting room. diff --git a/src/cloudflare/resources/waiting_rooms/page.py b/src/cloudflare/resources/waiting_rooms/page.py index 57ef8357247..feb0406b555 100644 --- a/src/cloudflare/resources/waiting_rooms/page.py +++ b/src/cloudflare/resources/waiting_rooms/page.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,7 +54,7 @@ def preview( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PagePreviewResponse: """Creates a waiting room page preview. @@ -174,7 +174,7 @@ async def preview( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PagePreviewResponse: """Creates a waiting room page preview. diff --git a/src/cloudflare/resources/waiting_rooms/rules.py b/src/cloudflare/resources/waiting_rooms/rules.py index 1f95c86bf5c..7bf2947760f 100644 --- a/src/cloudflare/resources/waiting_rooms/rules.py +++ b/src/cloudflare/resources/waiting_rooms/rules.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[WaitingRoomRule]: """Only available for the Waiting Room Advanced subscription. @@ -100,7 +100,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[WaitingRoomRule]: """Only available for the Waiting Room Advanced subscription. @@ -144,7 +144,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[WaitingRoomRule]: """ Deletes a rule for a waiting room. @@ -186,15 +186,15 @@ def edit( waiting_room_id: str, action: Literal["bypass_waiting_room"], expression: str, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - position: rule_edit_params.Position | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + enabled: bool | Omit = omit, + position: rule_edit_params.Position | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[WaitingRoomRule]: """ Patches a rule for a waiting room. @@ -258,7 +258,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[WaitingRoomRule]: """ Lists rules for a waiting room. @@ -319,7 +319,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WaitingRoomRule, AsyncSinglePage[WaitingRoomRule]]: """Only available for the Waiting Room Advanced subscription. @@ -363,7 +363,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WaitingRoomRule, AsyncSinglePage[WaitingRoomRule]]: """Only available for the Waiting Room Advanced subscription. @@ -407,7 +407,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WaitingRoomRule, AsyncSinglePage[WaitingRoomRule]]: """ Deletes a rule for a waiting room. @@ -449,15 +449,15 @@ def edit( waiting_room_id: str, action: Literal["bypass_waiting_room"], expression: str, - description: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - position: rule_edit_params.Position | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + enabled: bool | Omit = omit, + position: rule_edit_params.Position | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WaitingRoomRule, AsyncSinglePage[WaitingRoomRule]]: """ Patches a rule for a waiting room. @@ -521,7 +521,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WaitingRoomRule, AsyncSinglePage[WaitingRoomRule]]: """ Lists rules for a waiting room. diff --git a/src/cloudflare/resources/waiting_rooms/settings.py b/src/cloudflare/resources/waiting_rooms/settings.py index cf274cbaa25..0b4b94ed3d3 100644 --- a/src/cloudflare/resources/waiting_rooms/settings.py +++ b/src/cloudflare/resources/waiting_rooms/settings.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,13 +50,13 @@ def update( self, *, zone_id: str, - search_engine_crawler_bypass: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingUpdateResponse: """ Update zone-level Waiting Room settings @@ -98,13 +98,13 @@ def edit( self, *, zone_id: str, - search_engine_crawler_bypass: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingEditResponse: """ Patch zone-level Waiting Room settings @@ -150,7 +150,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingGetResponse: """ Get zone-level Waiting Room settings @@ -205,13 +205,13 @@ async def update( self, *, zone_id: str, - search_engine_crawler_bypass: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingUpdateResponse: """ Update zone-level Waiting Room settings @@ -253,13 +253,13 @@ async def edit( self, *, zone_id: str, - search_engine_crawler_bypass: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingEditResponse: """ Patch zone-level Waiting Room settings @@ -305,7 +305,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingGetResponse: """ Get zone-level Waiting Room settings diff --git a/src/cloudflare/resources/waiting_rooms/statuses.py b/src/cloudflare/resources/waiting_rooms/statuses.py index fa30bab833c..9be4bcdf91a 100644 --- a/src/cloudflare/resources/waiting_rooms/statuses.py +++ b/src/cloudflare/resources/waiting_rooms/statuses.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> StatusGetResponse: """Fetches the status of a configured waiting room. @@ -134,7 +134,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> StatusGetResponse: """Fetches the status of a configured waiting room. diff --git a/src/cloudflare/resources/waiting_rooms/waiting_rooms.py b/src/cloudflare/resources/waiting_rooms/waiting_rooms.py index 196c7147d22..7ec32316f2e 100644 --- a/src/cloudflare/resources/waiting_rooms/waiting_rooms.py +++ b/src/cloudflare/resources/waiting_rooms/waiting_rooms.py @@ -23,7 +23,7 @@ RulesResourceWithStreamingResponse, AsyncRulesResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .settings import ( SettingsResource, @@ -122,10 +122,10 @@ def create( name: str, new_users_per_minute: int, total_active_users: int, - additional_routes: Iterable[AdditionalRoutesParam] | NotGiven = NOT_GIVEN, - cookie_attributes: CookieAttributesParam | NotGiven = NOT_GIVEN, - cookie_suffix: str | NotGiven = NOT_GIVEN, - custom_page_html: str | NotGiven = NOT_GIVEN, + additional_routes: Iterable[AdditionalRoutesParam] | Omit = omit, + cookie_attributes: CookieAttributesParam | Omit = omit, + cookie_suffix: str | Omit = omit, + custom_page_html: str | Omit = omit, default_template_language: Literal[ "en-US", "es-ES", @@ -166,26 +166,25 @@ def create( "uk-UA", "vi-VN", ] - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: bool | NotGiven = NOT_GIVEN, - enabled_origin_commands: List[Literal["revoke"]] | NotGiven = NOT_GIVEN, - json_response_enabled: bool | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - queue_all: bool | NotGiven = NOT_GIVEN, - queueing_method: Literal["fifo", "random", "passthrough", "reject"] | NotGiven = NOT_GIVEN, - queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, - session_duration: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, + | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: bool | Omit = omit, + enabled_origin_commands: List[Literal["revoke"]] | Omit = omit, + json_response_enabled: bool | Omit = omit, + path: str | Omit = omit, + queue_all: bool | Omit = omit, + queueing_method: Literal["fifo", "random", "passthrough", "reject"] | Omit = omit, + queueing_status_code: Literal[200, 202, 429] | Omit = omit, + session_duration: int | Omit = omit, + suspended: bool | Omit = omit, + turnstile_action: Literal["log", "infinite_queue"] | Omit = omit, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WaitingRoom: """ Creates a new waiting room. @@ -525,10 +524,10 @@ def update( name: str, new_users_per_minute: int, total_active_users: int, - additional_routes: Iterable[AdditionalRoutesParam] | NotGiven = NOT_GIVEN, - cookie_attributes: CookieAttributesParam | NotGiven = NOT_GIVEN, - cookie_suffix: str | NotGiven = NOT_GIVEN, - custom_page_html: str | NotGiven = NOT_GIVEN, + additional_routes: Iterable[AdditionalRoutesParam] | Omit = omit, + cookie_attributes: CookieAttributesParam | Omit = omit, + cookie_suffix: str | Omit = omit, + custom_page_html: str | Omit = omit, default_template_language: Literal[ "en-US", "es-ES", @@ -569,26 +568,25 @@ def update( "uk-UA", "vi-VN", ] - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: bool | NotGiven = NOT_GIVEN, - enabled_origin_commands: List[Literal["revoke"]] | NotGiven = NOT_GIVEN, - json_response_enabled: bool | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - queue_all: bool | NotGiven = NOT_GIVEN, - queueing_method: Literal["fifo", "random", "passthrough", "reject"] | NotGiven = NOT_GIVEN, - queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, - session_duration: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, + | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: bool | Omit = omit, + enabled_origin_commands: List[Literal["revoke"]] | Omit = omit, + json_response_enabled: bool | Omit = omit, + path: str | Omit = omit, + queue_all: bool | Omit = omit, + queueing_method: Literal["fifo", "random", "passthrough", "reject"] | Omit = omit, + queueing_status_code: Literal[200, 202, 429] | Omit = omit, + session_duration: int | Omit = omit, + suspended: bool | Omit = omit, + turnstile_action: Literal["log", "infinite_queue"] | Omit = omit, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WaitingRoom: """ Updates a configured waiting room. @@ -924,16 +922,16 @@ def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[WaitingRoom]: """ Lists waiting rooms for account or zone. @@ -996,7 +994,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WaitingRoomDeleteResponse: """ Deletes a waiting room. @@ -1037,10 +1035,10 @@ def edit( name: str, new_users_per_minute: int, total_active_users: int, - additional_routes: Iterable[AdditionalRoutesParam] | NotGiven = NOT_GIVEN, - cookie_attributes: CookieAttributesParam | NotGiven = NOT_GIVEN, - cookie_suffix: str | NotGiven = NOT_GIVEN, - custom_page_html: str | NotGiven = NOT_GIVEN, + additional_routes: Iterable[AdditionalRoutesParam] | Omit = omit, + cookie_attributes: CookieAttributesParam | Omit = omit, + cookie_suffix: str | Omit = omit, + custom_page_html: str | Omit = omit, default_template_language: Literal[ "en-US", "es-ES", @@ -1081,26 +1079,25 @@ def edit( "uk-UA", "vi-VN", ] - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: bool | NotGiven = NOT_GIVEN, - enabled_origin_commands: List[Literal["revoke"]] | NotGiven = NOT_GIVEN, - json_response_enabled: bool | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - queue_all: bool | NotGiven = NOT_GIVEN, - queueing_method: Literal["fifo", "random", "passthrough", "reject"] | NotGiven = NOT_GIVEN, - queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, - session_duration: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, + | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: bool | Omit = omit, + enabled_origin_commands: List[Literal["revoke"]] | Omit = omit, + json_response_enabled: bool | Omit = omit, + path: str | Omit = omit, + queue_all: bool | Omit = omit, + queueing_method: Literal["fifo", "random", "passthrough", "reject"] | Omit = omit, + queueing_status_code: Literal[200, 202, 429] | Omit = omit, + session_duration: int | Omit = omit, + suspended: bool | Omit = omit, + turnstile_action: Literal["log", "infinite_queue"] | Omit = omit, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WaitingRoom: """ Patches a configured waiting room. @@ -1443,7 +1440,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WaitingRoom: """ Fetches a single configured waiting room. @@ -1524,10 +1521,10 @@ async def create( name: str, new_users_per_minute: int, total_active_users: int, - additional_routes: Iterable[AdditionalRoutesParam] | NotGiven = NOT_GIVEN, - cookie_attributes: CookieAttributesParam | NotGiven = NOT_GIVEN, - cookie_suffix: str | NotGiven = NOT_GIVEN, - custom_page_html: str | NotGiven = NOT_GIVEN, + additional_routes: Iterable[AdditionalRoutesParam] | Omit = omit, + cookie_attributes: CookieAttributesParam | Omit = omit, + cookie_suffix: str | Omit = omit, + custom_page_html: str | Omit = omit, default_template_language: Literal[ "en-US", "es-ES", @@ -1568,26 +1565,25 @@ async def create( "uk-UA", "vi-VN", ] - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: bool | NotGiven = NOT_GIVEN, - enabled_origin_commands: List[Literal["revoke"]] | NotGiven = NOT_GIVEN, - json_response_enabled: bool | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - queue_all: bool | NotGiven = NOT_GIVEN, - queueing_method: Literal["fifo", "random", "passthrough", "reject"] | NotGiven = NOT_GIVEN, - queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, - session_duration: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, + | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: bool | Omit = omit, + enabled_origin_commands: List[Literal["revoke"]] | Omit = omit, + json_response_enabled: bool | Omit = omit, + path: str | Omit = omit, + queue_all: bool | Omit = omit, + queueing_method: Literal["fifo", "random", "passthrough", "reject"] | Omit = omit, + queueing_status_code: Literal[200, 202, 429] | Omit = omit, + session_duration: int | Omit = omit, + suspended: bool | Omit = omit, + turnstile_action: Literal["log", "infinite_queue"] | Omit = omit, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WaitingRoom: """ Creates a new waiting room. @@ -1927,10 +1923,10 @@ async def update( name: str, new_users_per_minute: int, total_active_users: int, - additional_routes: Iterable[AdditionalRoutesParam] | NotGiven = NOT_GIVEN, - cookie_attributes: CookieAttributesParam | NotGiven = NOT_GIVEN, - cookie_suffix: str | NotGiven = NOT_GIVEN, - custom_page_html: str | NotGiven = NOT_GIVEN, + additional_routes: Iterable[AdditionalRoutesParam] | Omit = omit, + cookie_attributes: CookieAttributesParam | Omit = omit, + cookie_suffix: str | Omit = omit, + custom_page_html: str | Omit = omit, default_template_language: Literal[ "en-US", "es-ES", @@ -1971,26 +1967,25 @@ async def update( "uk-UA", "vi-VN", ] - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: bool | NotGiven = NOT_GIVEN, - enabled_origin_commands: List[Literal["revoke"]] | NotGiven = NOT_GIVEN, - json_response_enabled: bool | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - queue_all: bool | NotGiven = NOT_GIVEN, - queueing_method: Literal["fifo", "random", "passthrough", "reject"] | NotGiven = NOT_GIVEN, - queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, - session_duration: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, + | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: bool | Omit = omit, + enabled_origin_commands: List[Literal["revoke"]] | Omit = omit, + json_response_enabled: bool | Omit = omit, + path: str | Omit = omit, + queue_all: bool | Omit = omit, + queueing_method: Literal["fifo", "random", "passthrough", "reject"] | Omit = omit, + queueing_status_code: Literal[200, 202, 429] | Omit = omit, + session_duration: int | Omit = omit, + suspended: bool | Omit = omit, + turnstile_action: Literal["log", "infinite_queue"] | Omit = omit, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WaitingRoom: """ Updates a configured waiting room. @@ -2326,16 +2321,16 @@ async def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WaitingRoom, AsyncV4PagePaginationArray[WaitingRoom]]: """ Lists waiting rooms for account or zone. @@ -2398,7 +2393,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WaitingRoomDeleteResponse: """ Deletes a waiting room. @@ -2439,10 +2434,10 @@ async def edit( name: str, new_users_per_minute: int, total_active_users: int, - additional_routes: Iterable[AdditionalRoutesParam] | NotGiven = NOT_GIVEN, - cookie_attributes: CookieAttributesParam | NotGiven = NOT_GIVEN, - cookie_suffix: str | NotGiven = NOT_GIVEN, - custom_page_html: str | NotGiven = NOT_GIVEN, + additional_routes: Iterable[AdditionalRoutesParam] | Omit = omit, + cookie_attributes: CookieAttributesParam | Omit = omit, + cookie_suffix: str | Omit = omit, + custom_page_html: str | Omit = omit, default_template_language: Literal[ "en-US", "es-ES", @@ -2483,26 +2478,25 @@ async def edit( "uk-UA", "vi-VN", ] - | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_session_renewal: bool | NotGiven = NOT_GIVEN, - enabled_origin_commands: List[Literal["revoke"]] | NotGiven = NOT_GIVEN, - json_response_enabled: bool | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, - queue_all: bool | NotGiven = NOT_GIVEN, - queueing_method: Literal["fifo", "random", "passthrough", "reject"] | NotGiven = NOT_GIVEN, - queueing_status_code: Literal[200, 202, 429] | NotGiven = NOT_GIVEN, - session_duration: int | NotGiven = NOT_GIVEN, - suspended: bool | NotGiven = NOT_GIVEN, - turnstile_action: Literal["log", "infinite_queue"] | NotGiven = NOT_GIVEN, - turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_managed"] - | NotGiven = NOT_GIVEN, + | Omit = omit, + description: str | Omit = omit, + disable_session_renewal: bool | Omit = omit, + enabled_origin_commands: List[Literal["revoke"]] | Omit = omit, + json_response_enabled: bool | Omit = omit, + path: str | Omit = omit, + queue_all: bool | Omit = omit, + queueing_method: Literal["fifo", "random", "passthrough", "reject"] | Omit = omit, + queueing_status_code: Literal[200, 202, 429] | Omit = omit, + session_duration: int | Omit = omit, + suspended: bool | Omit = omit, + turnstile_action: Literal["log", "infinite_queue"] | Omit = omit, + turnstile_mode: Literal["off", "invisible", "visible_non_interactive", "visible_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WaitingRoom: """ Patches a configured waiting room. @@ -2845,7 +2839,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WaitingRoom: """ Fetches a single configured waiting room. diff --git a/src/cloudflare/resources/web3/hostnames/hostnames.py b/src/cloudflare/resources/web3/hostnames/hostnames.py index 97da9f95bbc..e10e570a89d 100644 --- a/src/cloudflare/resources/web3/hostnames/hostnames.py +++ b/src/cloudflare/resources/web3/hostnames/hostnames.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -65,14 +65,14 @@ def create( zone_id: str, name: str, target: Literal["ethereum", "ipfs", "ipfs_universal_path"], - description: str | NotGiven = NOT_GIVEN, - dnslink: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hostname: """ Create Web3 Hostname @@ -128,7 +128,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Hostname]: """ List Web3 Hostnames @@ -165,7 +165,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HostnameDeleteResponse]: """ Delete Web3 Hostname @@ -204,14 +204,14 @@ def edit( identifier: str, *, zone_id: str, - description: str | NotGiven = NOT_GIVEN, - dnslink: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hostname: """ Edit Web3 Hostname @@ -266,7 +266,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hostname: """ Web3 Hostname Details @@ -331,14 +331,14 @@ async def create( zone_id: str, name: str, target: Literal["ethereum", "ipfs", "ipfs_universal_path"], - description: str | NotGiven = NOT_GIVEN, - dnslink: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hostname: """ Create Web3 Hostname @@ -394,7 +394,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Hostname, AsyncSinglePage[Hostname]]: """ List Web3 Hostnames @@ -431,7 +431,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HostnameDeleteResponse]: """ Delete Web3 Hostname @@ -470,14 +470,14 @@ async def edit( identifier: str, *, zone_id: str, - description: str | NotGiven = NOT_GIVEN, - dnslink: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hostname: """ Edit Web3 Hostname @@ -532,7 +532,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Hostname: """ Web3 Hostname Details 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 f0b2cfe8252..609d79b3ba8 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 @@ -15,7 +15,7 @@ EntriesResourceWithStreamingResponse, AsyncEntriesResourceWithStreamingResponse, ) -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -69,7 +69,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ContentList: """ Update IPFS Universal Path Gateway Content List @@ -124,7 +124,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ContentList: """ IPFS Universal Path Gateway Content List Details @@ -195,7 +195,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ContentList: """ Update IPFS Universal Path Gateway Content List @@ -250,7 +250,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ContentList: """ IPFS Universal Path Gateway Content List Details 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 e636531f630..4e784613f55 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 @@ -7,7 +7,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,13 +56,13 @@ def create( zone_id: str, content: str, type: Literal["cid", "content_path"], - description: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EntryCreateResponse: """ Create IPFS Universal Path Gateway Content List Entry @@ -118,13 +118,13 @@ def update( identifier: str, content: str, type: Literal["cid", "content_path"], - description: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EntryUpdateResponse: """ Edit IPFS Universal Path Gateway Content List Entry @@ -188,7 +188,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryListResponse]: """ List IPFS Universal Path Gateway Content List Entries @@ -233,7 +233,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryDeleteResponse]: """ Delete IPFS Universal Path Gateway Content List Entry @@ -284,7 +284,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EntryGetResponse: """ IPFS Universal Path Gateway Content List Entry Details @@ -352,13 +352,13 @@ async def create( zone_id: str, content: str, type: Literal["cid", "content_path"], - description: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EntryCreateResponse: """ Create IPFS Universal Path Gateway Content List Entry @@ -414,13 +414,13 @@ async def update( identifier: str, content: str, type: Literal["cid", "content_path"], - description: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EntryUpdateResponse: """ Edit IPFS Universal Path Gateway Content List Entry @@ -484,7 +484,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryListResponse]: """ List IPFS Universal Path Gateway Content List Entries @@ -529,7 +529,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryDeleteResponse]: """ Delete IPFS Universal Path Gateway Content List Entry @@ -580,7 +580,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EntryGetResponse: """ IPFS Universal Path Gateway Content List Entry Details diff --git a/src/cloudflare/resources/workers/__init__.py b/src/cloudflare/resources/workers/__init__.py index 1370b48b526..67e210847ab 100644 --- a/src/cloudflare/resources/workers/__init__.py +++ b/src/cloudflare/resources/workers/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .beta import ( + BetaResource, + AsyncBetaResource, + BetaResourceWithRawResponse, + AsyncBetaResourceWithRawResponse, + BetaResourceWithStreamingResponse, + AsyncBetaResourceWithStreamingResponse, +) from .assets import ( AssetsResource, AsyncAssetsResource, @@ -66,6 +74,12 @@ ) __all__ = [ + "BetaResource", + "AsyncBetaResource", + "BetaResourceWithRawResponse", + "AsyncBetaResourceWithRawResponse", + "BetaResourceWithStreamingResponse", + "AsyncBetaResourceWithStreamingResponse", "RoutesResource", "AsyncRoutesResource", "RoutesResourceWithRawResponse", diff --git a/src/cloudflare/resources/workers/account_settings.py b/src/cloudflare/resources/workers/account_settings.py index f68047f45d2..ad45917e32d 100644 --- a/src/cloudflare/resources/workers/account_settings.py +++ b/src/cloudflare/resources/workers/account_settings.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,14 +49,14 @@ def update( self, *, account_id: str, - default_usage_model: str | NotGiven = NOT_GIVEN, - green_compute: bool | NotGiven = NOT_GIVEN, + default_usage_model: str | Omit = omit, + green_compute: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountSettingUpdateResponse: """ Creates Worker account settings for an account. @@ -102,7 +102,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountSettingGetResponse: """ Fetches Worker account settings for an account. @@ -157,14 +157,14 @@ async def update( self, *, account_id: str, - default_usage_model: str | NotGiven = NOT_GIVEN, - green_compute: bool | NotGiven = NOT_GIVEN, + default_usage_model: str | Omit = omit, + green_compute: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountSettingUpdateResponse: """ Creates Worker account settings for an account. @@ -210,7 +210,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AccountSettingGetResponse: """ Fetches Worker account settings for an account. diff --git a/src/cloudflare/resources/workers/assets/upload.py b/src/cloudflare/resources/workers/assets/upload.py index b09a909e39c..4ece6d4d094 100644 --- a/src/cloudflare/resources/workers/assets/upload.py +++ b/src/cloudflare/resources/workers/assets/upload.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UploadCreateResponse]: """Upload assets ahead of creating a Worker version. @@ -129,7 +129,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UploadCreateResponse]: """Upload assets ahead of creating a Worker version. diff --git a/src/cloudflare/resources/workers/beta/__init__.py b/src/cloudflare/resources/workers/beta/__init__.py new file mode 100644 index 00000000000..ed725555fd9 --- /dev/null +++ b/src/cloudflare/resources/workers/beta/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .beta import ( + BetaResource, + AsyncBetaResource, + BetaResourceWithRawResponse, + AsyncBetaResourceWithRawResponse, + BetaResourceWithStreamingResponse, + AsyncBetaResourceWithStreamingResponse, +) +from .workers import ( + WorkersResource, + AsyncWorkersResource, + WorkersResourceWithRawResponse, + AsyncWorkersResourceWithRawResponse, + WorkersResourceWithStreamingResponse, + AsyncWorkersResourceWithStreamingResponse, +) + +__all__ = [ + "WorkersResource", + "AsyncWorkersResource", + "WorkersResourceWithRawResponse", + "AsyncWorkersResourceWithRawResponse", + "WorkersResourceWithStreamingResponse", + "AsyncWorkersResourceWithStreamingResponse", + "BetaResource", + "AsyncBetaResource", + "BetaResourceWithRawResponse", + "AsyncBetaResourceWithRawResponse", + "BetaResourceWithStreamingResponse", + "AsyncBetaResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/workers/beta/beta.py b/src/cloudflare/resources/workers/beta/beta.py new file mode 100644 index 00000000000..66891810c8c --- /dev/null +++ b/src/cloudflare/resources/workers/beta/beta.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from .workers.workers import ( + WorkersResource, + AsyncWorkersResource, + WorkersResourceWithRawResponse, + AsyncWorkersResourceWithRawResponse, + WorkersResourceWithStreamingResponse, + AsyncWorkersResourceWithStreamingResponse, +) + +__all__ = ["BetaResource", "AsyncBetaResource"] + + +class BetaResource(SyncAPIResource): + @cached_property + def workers(self) -> WorkersResource: + return WorkersResource(self._client) + + @cached_property + def with_raw_response(self) -> BetaResourceWithRawResponse: + """ + 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 BetaResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> BetaResourceWithStreamingResponse: + """ + 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 BetaResourceWithStreamingResponse(self) + + +class AsyncBetaResource(AsyncAPIResource): + @cached_property + def workers(self) -> AsyncWorkersResource: + return AsyncWorkersResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncBetaResourceWithRawResponse: + """ + 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 AsyncBetaResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncBetaResourceWithStreamingResponse: + """ + 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 AsyncBetaResourceWithStreamingResponse(self) + + +class BetaResourceWithRawResponse: + def __init__(self, beta: BetaResource) -> None: + self._beta = beta + + @cached_property + def workers(self) -> WorkersResourceWithRawResponse: + return WorkersResourceWithRawResponse(self._beta.workers) + + +class AsyncBetaResourceWithRawResponse: + def __init__(self, beta: AsyncBetaResource) -> None: + self._beta = beta + + @cached_property + def workers(self) -> AsyncWorkersResourceWithRawResponse: + return AsyncWorkersResourceWithRawResponse(self._beta.workers) + + +class BetaResourceWithStreamingResponse: + def __init__(self, beta: BetaResource) -> None: + self._beta = beta + + @cached_property + def workers(self) -> WorkersResourceWithStreamingResponse: + return WorkersResourceWithStreamingResponse(self._beta.workers) + + +class AsyncBetaResourceWithStreamingResponse: + def __init__(self, beta: AsyncBetaResource) -> None: + self._beta = beta + + @cached_property + def workers(self) -> AsyncWorkersResourceWithStreamingResponse: + return AsyncWorkersResourceWithStreamingResponse(self._beta.workers) diff --git a/src/cloudflare/resources/workers/beta/workers/__init__.py b/src/cloudflare/resources/workers/beta/workers/__init__.py new file mode 100644 index 00000000000..eb251551f61 --- /dev/null +++ b/src/cloudflare/resources/workers/beta/workers/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .workers import ( + WorkersResource, + AsyncWorkersResource, + WorkersResourceWithRawResponse, + AsyncWorkersResourceWithRawResponse, + WorkersResourceWithStreamingResponse, + AsyncWorkersResourceWithStreamingResponse, +) +from .versions import ( + VersionsResource, + AsyncVersionsResource, + VersionsResourceWithRawResponse, + AsyncVersionsResourceWithRawResponse, + VersionsResourceWithStreamingResponse, + AsyncVersionsResourceWithStreamingResponse, +) + +__all__ = [ + "VersionsResource", + "AsyncVersionsResource", + "VersionsResourceWithRawResponse", + "AsyncVersionsResourceWithRawResponse", + "VersionsResourceWithStreamingResponse", + "AsyncVersionsResourceWithStreamingResponse", + "WorkersResource", + "AsyncWorkersResource", + "WorkersResourceWithRawResponse", + "AsyncWorkersResourceWithRawResponse", + "WorkersResourceWithStreamingResponse", + "AsyncWorkersResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/workers/beta/workers/versions.py b/src/cloudflare/resources/workers/beta/workers/versions.py new file mode 100644 index 00000000000..3ffbd19d85f --- /dev/null +++ b/src/cloudflare/resources/workers/beta/workers/versions.py @@ -0,0 +1,699 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Iterable, 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 .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ....._base_client import AsyncPaginator, make_request_options +from .....types.workers.beta.workers import version_get_params, version_list_params, version_create_params +from .....types.workers.beta.workers.version import Version +from .....types.workers.beta.workers.version_delete_response import VersionDeleteResponse + +__all__ = ["VersionsResource", "AsyncVersionsResource"] + + +class VersionsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> VersionsResourceWithRawResponse: + """ + 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 VersionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> VersionsResourceWithStreamingResponse: + """ + 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 VersionsResourceWithStreamingResponse(self) + + def create( + self, + worker_id: str, + *, + account_id: str, + deploy: bool | Omit = omit, + annotations: version_create_params.Annotations | Omit = omit, + assets: version_create_params.Assets | Omit = omit, + bindings: Iterable[version_create_params.Binding] | Omit = omit, + compatibility_date: str | Omit = omit, + compatibility_flags: SequenceNotStr[str] | Omit = omit, + limits: version_create_params.Limits | Omit = omit, + main_module: str | Omit = omit, + migrations: version_create_params.Migrations | Omit = omit, + modules: Iterable[version_create_params.Module] | Omit = omit, + placement: version_create_params.Placement | Omit = omit, + usage_model: Literal["standard", "bundled", "unbound"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Version: + """ + Create a new version. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + deploy: If true, a deployment will be created that sends 100% of traffic to the new + version. + + annotations: Metadata about the version. + + assets: Configuration for assets within a Worker. + + [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) + and + [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) + files should be included as modules named `_headers` and `_redirects` with + content type `text/plain`. + + bindings: List of bindings attached to a Worker. You can find more about bindings on our + docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + + compatibility_date: Date indicating targeted support in the Workers runtime. Backwards incompatible + fixes to the runtime following this date will not affect this Worker. + + compatibility_flags: Flags that enable or disable certain features in the Workers runtime. Used to + enable upcoming features or opt in or out of specific changes not included in a + `compatibility_date`. + + limits: Resource limits enforced at runtime. + + main_module: The name of the main module in the `modules` array (e.g. the name of the module + that exports a `fetch` handler). + + migrations: Migrations for Durable Objects associated with the version. Migrations are + applied when the version is deployed. + + modules: Code, sourcemaps, and other content used at runtime. + + This includes + [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) + and + [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) + files used to configure + [Static Assets](https://developers.cloudflare.com/workers/static-assets/). + `_headers` and `_redirects` files should be included as modules named `_headers` + and `_redirects` with content type `text/plain`. + + placement: Placement settings for the version. + + usage_model: Usage model for the version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return self._post( + f"/accounts/{account_id}/workers/workers/{worker_id}/versions", + body=maybe_transform( + { + "annotations": annotations, + "assets": assets, + "bindings": bindings, + "compatibility_date": compatibility_date, + "compatibility_flags": compatibility_flags, + "limits": limits, + "main_module": main_module, + "migrations": migrations, + "modules": modules, + "placement": placement, + "usage_model": usage_model, + }, + version_create_params.VersionCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"deploy": deploy}, version_create_params.VersionCreateParams), + post_parser=ResultWrapper[Version]._unwrapper, + ), + cast_to=cast(Type[Version], ResultWrapper[Version]), + ) + + def list( + self, + worker_id: str, + *, + 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. + # The extra values given here take precedence over values defined on the client or passed to this 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[Version]: + """ + List all versions for a Worker. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + page: Current page. + + per_page: Items 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 + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/workers/workers/{worker_id}/versions", + page=SyncV4PagePaginationArray[Version], + 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, + }, + version_list_params.VersionListParams, + ), + ), + model=Version, + ) + + def delete( + self, + version_id: str, + *, + account_id: str, + worker_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> VersionDeleteResponse: + """ + Delete a version. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + version_id: Identifier for the version, which can be ID or the literal "latest" to operate + on the most recently created version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + if not version_id: + raise ValueError(f"Expected a non-empty value for `version_id` but received {version_id!r}") + return self._delete( + f"/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=VersionDeleteResponse, + ) + + def get( + self, + version_id: str, + *, + account_id: str, + worker_id: str, + include: Literal["modules"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Version: + """ + Get details about a specific version. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + version_id: Identifier for the version, which can be ID or the literal "latest" to operate + on the most recently created version. + + include: Whether to include the `modules` property of the version in the response, which + contains code and sourcemap content and may add several megabytes to the + response size. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + if not version_id: + raise ValueError(f"Expected a non-empty value for `version_id` but received {version_id!r}") + return self._get( + f"/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"include": include}, version_get_params.VersionGetParams), + post_parser=ResultWrapper[Version]._unwrapper, + ), + cast_to=cast(Type[Version], ResultWrapper[Version]), + ) + + +class AsyncVersionsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncVersionsResourceWithRawResponse: + """ + 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 AsyncVersionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncVersionsResourceWithStreamingResponse: + """ + 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 AsyncVersionsResourceWithStreamingResponse(self) + + async def create( + self, + worker_id: str, + *, + account_id: str, + deploy: bool | Omit = omit, + annotations: version_create_params.Annotations | Omit = omit, + assets: version_create_params.Assets | Omit = omit, + bindings: Iterable[version_create_params.Binding] | Omit = omit, + compatibility_date: str | Omit = omit, + compatibility_flags: SequenceNotStr[str] | Omit = omit, + limits: version_create_params.Limits | Omit = omit, + main_module: str | Omit = omit, + migrations: version_create_params.Migrations | Omit = omit, + modules: Iterable[version_create_params.Module] | Omit = omit, + placement: version_create_params.Placement | Omit = omit, + usage_model: Literal["standard", "bundled", "unbound"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Version: + """ + Create a new version. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + deploy: If true, a deployment will be created that sends 100% of traffic to the new + version. + + annotations: Metadata about the version. + + assets: Configuration for assets within a Worker. + + [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) + and + [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) + files should be included as modules named `_headers` and `_redirects` with + content type `text/plain`. + + bindings: List of bindings attached to a Worker. You can find more about bindings on our + docs: + https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + + compatibility_date: Date indicating targeted support in the Workers runtime. Backwards incompatible + fixes to the runtime following this date will not affect this Worker. + + compatibility_flags: Flags that enable or disable certain features in the Workers runtime. Used to + enable upcoming features or opt in or out of specific changes not included in a + `compatibility_date`. + + limits: Resource limits enforced at runtime. + + main_module: The name of the main module in the `modules` array (e.g. the name of the module + that exports a `fetch` handler). + + migrations: Migrations for Durable Objects associated with the version. Migrations are + applied when the version is deployed. + + modules: Code, sourcemaps, and other content used at runtime. + + This includes + [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) + and + [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) + files used to configure + [Static Assets](https://developers.cloudflare.com/workers/static-assets/). + `_headers` and `_redirects` files should be included as modules named `_headers` + and `_redirects` with content type `text/plain`. + + placement: Placement settings for the version. + + usage_model: Usage model for the version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return await self._post( + f"/accounts/{account_id}/workers/workers/{worker_id}/versions", + body=await async_maybe_transform( + { + "annotations": annotations, + "assets": assets, + "bindings": bindings, + "compatibility_date": compatibility_date, + "compatibility_flags": compatibility_flags, + "limits": limits, + "main_module": main_module, + "migrations": migrations, + "modules": modules, + "placement": placement, + "usage_model": usage_model, + }, + version_create_params.VersionCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"deploy": deploy}, version_create_params.VersionCreateParams), + post_parser=ResultWrapper[Version]._unwrapper, + ), + cast_to=cast(Type[Version], ResultWrapper[Version]), + ) + + def list( + self, + worker_id: str, + *, + 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. + # The extra values given here take precedence over values defined on the client or passed to this 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[Version, AsyncV4PagePaginationArray[Version]]: + """ + List all versions for a Worker. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + page: Current page. + + per_page: Items 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 + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return self._get_api_list( + f"/accounts/{account_id}/workers/workers/{worker_id}/versions", + page=AsyncV4PagePaginationArray[Version], + 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, + }, + version_list_params.VersionListParams, + ), + ), + model=Version, + ) + + async def delete( + self, + version_id: str, + *, + account_id: str, + worker_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> VersionDeleteResponse: + """ + Delete a version. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + version_id: Identifier for the version, which can be ID or the literal "latest" to operate + on the most recently created version. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + if not version_id: + raise ValueError(f"Expected a non-empty value for `version_id` but received {version_id!r}") + return await self._delete( + f"/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=VersionDeleteResponse, + ) + + async def get( + self, + version_id: str, + *, + account_id: str, + worker_id: str, + include: Literal["modules"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Version: + """ + Get details about a specific version. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + version_id: Identifier for the version, which can be ID or the literal "latest" to operate + on the most recently created version. + + include: Whether to include the `modules` property of the version in the response, which + contains code and sourcemap content and may add several megabytes to the + response size. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + if not version_id: + raise ValueError(f"Expected a non-empty value for `version_id` but received {version_id!r}") + return await self._get( + f"/accounts/{account_id}/workers/workers/{worker_id}/versions/{version_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"include": include}, version_get_params.VersionGetParams), + post_parser=ResultWrapper[Version]._unwrapper, + ), + cast_to=cast(Type[Version], ResultWrapper[Version]), + ) + + +class VersionsResourceWithRawResponse: + def __init__(self, versions: VersionsResource) -> None: + self._versions = versions + + self.create = to_raw_response_wrapper( + versions.create, + ) + self.list = to_raw_response_wrapper( + versions.list, + ) + self.delete = to_raw_response_wrapper( + versions.delete, + ) + self.get = to_raw_response_wrapper( + versions.get, + ) + + +class AsyncVersionsResourceWithRawResponse: + def __init__(self, versions: AsyncVersionsResource) -> None: + self._versions = versions + + self.create = async_to_raw_response_wrapper( + versions.create, + ) + self.list = async_to_raw_response_wrapper( + versions.list, + ) + self.delete = async_to_raw_response_wrapper( + versions.delete, + ) + self.get = async_to_raw_response_wrapper( + versions.get, + ) + + +class VersionsResourceWithStreamingResponse: + def __init__(self, versions: VersionsResource) -> None: + self._versions = versions + + self.create = to_streamed_response_wrapper( + versions.create, + ) + self.list = to_streamed_response_wrapper( + versions.list, + ) + self.delete = to_streamed_response_wrapper( + versions.delete, + ) + self.get = to_streamed_response_wrapper( + versions.get, + ) + + +class AsyncVersionsResourceWithStreamingResponse: + def __init__(self, versions: AsyncVersionsResource) -> None: + self._versions = versions + + self.create = async_to_streamed_response_wrapper( + versions.create, + ) + self.list = async_to_streamed_response_wrapper( + versions.list, + ) + self.delete = async_to_streamed_response_wrapper( + versions.delete, + ) + self.get = async_to_streamed_response_wrapper( + versions.get, + ) diff --git a/src/cloudflare/resources/workers/beta/workers/workers.py b/src/cloudflare/resources/workers/beta/workers/workers.py new file mode 100644 index 00000000000..fcaed3d877d --- /dev/null +++ b/src/cloudflare/resources/workers/beta/workers/workers.py @@ -0,0 +1,904 @@ +# 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 .versions import ( + VersionsResource, + AsyncVersionsResource, + VersionsResourceWithRawResponse, + AsyncVersionsResourceWithRawResponse, + VersionsResourceWithStreamingResponse, + AsyncVersionsResourceWithStreamingResponse, +) +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 SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ....._base_client import AsyncPaginator, make_request_options +from .....types.workers.beta import worker_edit_params, worker_list_params, worker_create_params, worker_update_params +from .....types.workers.beta.worker import Worker +from .....types.workers.beta.worker_delete_response import WorkerDeleteResponse + +__all__ = ["WorkersResource", "AsyncWorkersResource"] + + +class WorkersResource(SyncAPIResource): + @cached_property + def versions(self) -> VersionsResource: + return VersionsResource(self._client) + + @cached_property + def with_raw_response(self) -> WorkersResourceWithRawResponse: + """ + 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 WorkersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> WorkersResourceWithStreamingResponse: + """ + 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 WorkersResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + name: str, + logpush: bool | Omit = omit, + observability: worker_create_params.Observability | Omit = omit, + subdomain: worker_create_params.Subdomain | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + tail_consumers: Iterable[worker_create_params.TailConsumer] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Worker: + """ + Create a new Worker. + + Args: + account_id: Identifier. + + name: Name of the Worker. + + logpush: Whether logpush is enabled for the Worker. + + observability: Observability settings for the Worker. + + subdomain: Subdomain settings for the Worker. + + tags: Tags associated with the Worker. + + tail_consumers: Other Workers that should consume logs from the Worker. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/workers/workers", + body=maybe_transform( + { + "name": name, + "logpush": logpush, + "observability": observability, + "subdomain": subdomain, + "tags": tags, + "tail_consumers": tail_consumers, + }, + worker_create_params.WorkerCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Worker]._unwrapper, + ), + cast_to=cast(Type[Worker], ResultWrapper[Worker]), + ) + + def update( + self, + worker_id: str, + *, + account_id: str, + name: str, + logpush: bool | Omit = omit, + observability: worker_update_params.Observability | Omit = omit, + subdomain: worker_update_params.Subdomain | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + tail_consumers: Iterable[worker_update_params.TailConsumer] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Worker: + """ + Perform a complete replacement of a Worker, where omitted properties are set to + their default values. This is the exact same as the Create Worker endpoint, but + operates on an existing Worker. To perform a partial update instead, use the + Edit Worker endpoint. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + name: Name of the Worker. + + logpush: Whether logpush is enabled for the Worker. + + observability: Observability settings for the Worker. + + subdomain: Subdomain settings for the Worker. + + tags: Tags associated with the Worker. + + tail_consumers: Other Workers that should consume logs from the Worker. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return self._put( + f"/accounts/{account_id}/workers/workers/{worker_id}", + body=maybe_transform( + { + "name": name, + "logpush": logpush, + "observability": observability, + "subdomain": subdomain, + "tags": tags, + "tail_consumers": tail_consumers, + }, + worker_update_params.WorkerUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Worker]._unwrapper, + ), + cast_to=cast(Type[Worker], ResultWrapper[Worker]), + ) + + def list( + self, + *, + 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. + # The extra values given here take precedence over values defined on the client or passed to this 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[Worker]: + """ + List all Workers for an account. + + Args: + account_id: Identifier. + + page: Current page. + + per_page: Items 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 + """ + if 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}/workers/workers", + page=SyncV4PagePaginationArray[Worker], + 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, + }, + worker_list_params.WorkerListParams, + ), + ), + model=Worker, + ) + + def delete( + self, + worker_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, + ) -> WorkerDeleteResponse: + """ + Delete a Worker and all its associated resources (versions, deployments, etc.). + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return self._delete( + f"/accounts/{account_id}/workers/workers/{worker_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=WorkerDeleteResponse, + ) + + def edit( + self, + worker_id: str, + *, + account_id: str, + logpush: bool, + name: str, + observability: worker_edit_params.Observability, + subdomain: worker_edit_params.Subdomain, + tags: SequenceNotStr[str], + tail_consumers: Iterable[worker_edit_params.TailConsumer], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Worker: + """ + Perform a partial update on a Worker, where omitted properties are left + unchanged from their current values. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + logpush: Whether logpush is enabled for the Worker. + + name: Name of the Worker. + + observability: Observability settings for the Worker. + + subdomain: Subdomain settings for the Worker. + + tags: Tags associated with the Worker. + + tail_consumers: Other Workers that should consume logs from the Worker. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return self._patch( + f"/accounts/{account_id}/workers/workers/{worker_id}", + body=maybe_transform( + { + "logpush": logpush, + "name": name, + "observability": observability, + "subdomain": subdomain, + "tags": tags, + "tail_consumers": tail_consumers, + }, + worker_edit_params.WorkerEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Worker]._unwrapper, + ), + cast_to=cast(Type[Worker], ResultWrapper[Worker]), + ) + + def get( + self, + worker_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, + ) -> Worker: + """ + Get details about a specific Worker. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return self._get( + f"/accounts/{account_id}/workers/workers/{worker_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Worker]._unwrapper, + ), + cast_to=cast(Type[Worker], ResultWrapper[Worker]), + ) + + +class AsyncWorkersResource(AsyncAPIResource): + @cached_property + def versions(self) -> AsyncVersionsResource: + return AsyncVersionsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncWorkersResourceWithRawResponse: + """ + 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 AsyncWorkersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncWorkersResourceWithStreamingResponse: + """ + 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 AsyncWorkersResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + name: str, + logpush: bool | Omit = omit, + observability: worker_create_params.Observability | Omit = omit, + subdomain: worker_create_params.Subdomain | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + tail_consumers: Iterable[worker_create_params.TailConsumer] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Worker: + """ + Create a new Worker. + + Args: + account_id: Identifier. + + name: Name of the Worker. + + logpush: Whether logpush is enabled for the Worker. + + observability: Observability settings for the Worker. + + subdomain: Subdomain settings for the Worker. + + tags: Tags associated with the Worker. + + tail_consumers: Other Workers that should consume logs from the Worker. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/workers/workers", + body=await async_maybe_transform( + { + "name": name, + "logpush": logpush, + "observability": observability, + "subdomain": subdomain, + "tags": tags, + "tail_consumers": tail_consumers, + }, + worker_create_params.WorkerCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Worker]._unwrapper, + ), + cast_to=cast(Type[Worker], ResultWrapper[Worker]), + ) + + async def update( + self, + worker_id: str, + *, + account_id: str, + name: str, + logpush: bool | Omit = omit, + observability: worker_update_params.Observability | Omit = omit, + subdomain: worker_update_params.Subdomain | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + tail_consumers: Iterable[worker_update_params.TailConsumer] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Worker: + """ + Perform a complete replacement of a Worker, where omitted properties are set to + their default values. This is the exact same as the Create Worker endpoint, but + operates on an existing Worker. To perform a partial update instead, use the + Edit Worker endpoint. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + name: Name of the Worker. + + logpush: Whether logpush is enabled for the Worker. + + observability: Observability settings for the Worker. + + subdomain: Subdomain settings for the Worker. + + tags: Tags associated with the Worker. + + tail_consumers: Other Workers that should consume logs from the Worker. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return await self._put( + f"/accounts/{account_id}/workers/workers/{worker_id}", + body=await async_maybe_transform( + { + "name": name, + "logpush": logpush, + "observability": observability, + "subdomain": subdomain, + "tags": tags, + "tail_consumers": tail_consumers, + }, + worker_update_params.WorkerUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Worker]._unwrapper, + ), + cast_to=cast(Type[Worker], ResultWrapper[Worker]), + ) + + def list( + self, + *, + 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. + # The extra values given here take precedence over values defined on the client or passed to this 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[Worker, AsyncV4PagePaginationArray[Worker]]: + """ + List all Workers for an account. + + Args: + account_id: Identifier. + + page: Current page. + + per_page: Items 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 + """ + if 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}/workers/workers", + page=AsyncV4PagePaginationArray[Worker], + 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, + }, + worker_list_params.WorkerListParams, + ), + ), + model=Worker, + ) + + async def delete( + self, + worker_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, + ) -> WorkerDeleteResponse: + """ + Delete a Worker and all its associated resources (versions, deployments, etc.). + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return await self._delete( + f"/accounts/{account_id}/workers/workers/{worker_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=WorkerDeleteResponse, + ) + + async def edit( + self, + worker_id: str, + *, + account_id: str, + logpush: bool, + name: str, + observability: worker_edit_params.Observability, + subdomain: worker_edit_params.Subdomain, + tags: SequenceNotStr[str], + tail_consumers: Iterable[worker_edit_params.TailConsumer], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Worker: + """ + Perform a partial update on a Worker, where omitted properties are left + unchanged from their current values. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + logpush: Whether logpush is enabled for the Worker. + + name: Name of the Worker. + + observability: Observability settings for the Worker. + + subdomain: Subdomain settings for the Worker. + + tags: Tags associated with the Worker. + + tail_consumers: Other Workers that should consume logs from the Worker. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return await self._patch( + f"/accounts/{account_id}/workers/workers/{worker_id}", + body=await async_maybe_transform( + { + "logpush": logpush, + "name": name, + "observability": observability, + "subdomain": subdomain, + "tags": tags, + "tail_consumers": tail_consumers, + }, + worker_edit_params.WorkerEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Worker]._unwrapper, + ), + cast_to=cast(Type[Worker], ResultWrapper[Worker]), + ) + + async def get( + self, + worker_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, + ) -> Worker: + """ + Get details about a specific Worker. + + Args: + account_id: Identifier. + + worker_id: Identifier for the Worker, which can be ID or name. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 worker_id: + raise ValueError(f"Expected a non-empty value for `worker_id` but received {worker_id!r}") + return await self._get( + f"/accounts/{account_id}/workers/workers/{worker_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Worker]._unwrapper, + ), + cast_to=cast(Type[Worker], ResultWrapper[Worker]), + ) + + +class WorkersResourceWithRawResponse: + def __init__(self, workers: WorkersResource) -> None: + self._workers = workers + + self.create = to_raw_response_wrapper( + workers.create, + ) + self.update = to_raw_response_wrapper( + workers.update, + ) + self.list = to_raw_response_wrapper( + workers.list, + ) + self.delete = to_raw_response_wrapper( + workers.delete, + ) + self.edit = to_raw_response_wrapper( + workers.edit, + ) + self.get = to_raw_response_wrapper( + workers.get, + ) + + @cached_property + def versions(self) -> VersionsResourceWithRawResponse: + return VersionsResourceWithRawResponse(self._workers.versions) + + +class AsyncWorkersResourceWithRawResponse: + def __init__(self, workers: AsyncWorkersResource) -> None: + self._workers = workers + + self.create = async_to_raw_response_wrapper( + workers.create, + ) + self.update = async_to_raw_response_wrapper( + workers.update, + ) + self.list = async_to_raw_response_wrapper( + workers.list, + ) + self.delete = async_to_raw_response_wrapper( + workers.delete, + ) + self.edit = async_to_raw_response_wrapper( + workers.edit, + ) + self.get = async_to_raw_response_wrapper( + workers.get, + ) + + @cached_property + def versions(self) -> AsyncVersionsResourceWithRawResponse: + return AsyncVersionsResourceWithRawResponse(self._workers.versions) + + +class WorkersResourceWithStreamingResponse: + def __init__(self, workers: WorkersResource) -> None: + self._workers = workers + + self.create = to_streamed_response_wrapper( + workers.create, + ) + self.update = to_streamed_response_wrapper( + workers.update, + ) + self.list = to_streamed_response_wrapper( + workers.list, + ) + self.delete = to_streamed_response_wrapper( + workers.delete, + ) + self.edit = to_streamed_response_wrapper( + workers.edit, + ) + self.get = to_streamed_response_wrapper( + workers.get, + ) + + @cached_property + def versions(self) -> VersionsResourceWithStreamingResponse: + return VersionsResourceWithStreamingResponse(self._workers.versions) + + +class AsyncWorkersResourceWithStreamingResponse: + def __init__(self, workers: AsyncWorkersResource) -> None: + self._workers = workers + + self.create = async_to_streamed_response_wrapper( + workers.create, + ) + self.update = async_to_streamed_response_wrapper( + workers.update, + ) + self.list = async_to_streamed_response_wrapper( + workers.list, + ) + self.delete = async_to_streamed_response_wrapper( + workers.delete, + ) + self.edit = async_to_streamed_response_wrapper( + workers.edit, + ) + self.get = async_to_streamed_response_wrapper( + workers.get, + ) + + @cached_property + def versions(self) -> AsyncVersionsResourceWithStreamingResponse: + return AsyncVersionsResourceWithStreamingResponse(self._workers.versions) diff --git a/src/cloudflare/resources/workers/domains.py b/src/cloudflare/resources/workers/domains.py index 2d034b7131e..d15826eff76 100644 --- a/src/cloudflare/resources/workers/domains.py +++ b/src/cloudflare/resources/workers/domains.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -58,7 +58,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Domain]: """ Attaches a Worker to a zone and hostname. @@ -109,17 +109,17 @@ def list( self, *, account_id: str, - environment: str | NotGiven = NOT_GIVEN, - hostname: str | NotGiven = NOT_GIVEN, - service: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - zone_name: str | NotGiven = NOT_GIVEN, + environment: str | Omit = omit, + hostname: str | Omit = omit, + service: str | Omit = omit, + zone_id: str | Omit = omit, + zone_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Domain]: """ Lists all Worker Domains for an account. @@ -179,7 +179,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Detaches a Worker from a zone and hostname. @@ -220,7 +220,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Domain]: """ Gets a Worker domain. @@ -288,7 +288,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Domain]: """ Attaches a Worker to a zone and hostname. @@ -339,17 +339,17 @@ def list( self, *, account_id: str, - environment: str | NotGiven = NOT_GIVEN, - hostname: str | NotGiven = NOT_GIVEN, - service: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - zone_name: str | NotGiven = NOT_GIVEN, + environment: str | Omit = omit, + hostname: str | Omit = omit, + service: str | Omit = omit, + zone_id: str | Omit = omit, + zone_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Domain, AsyncSinglePage[Domain]]: """ Lists all Worker Domains for an account. @@ -409,7 +409,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Detaches a Worker from a zone and hostname. @@ -450,7 +450,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Domain]: """ Gets a Worker domain. diff --git a/src/cloudflare/resources/workers/observability/telemetry.py b/src/cloudflare/resources/workers/observability/telemetry.py index 9cb970de341..971aca5ee6b 100644 --- a/src/cloudflare/resources/workers/observability/telemetry.py +++ b/src/cloudflare/resources/workers/observability/telemetry.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Iterable, cast +from typing import Type, Iterable, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,18 +52,18 @@ def keys( self, *, account_id: str, - datasets: List[str] | NotGiven = NOT_GIVEN, - filters: Iterable[telemetry_keys_params.Filter] | NotGiven = NOT_GIVEN, - key_needle: telemetry_keys_params.KeyNeedle | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - needle: telemetry_keys_params.Needle | NotGiven = NOT_GIVEN, - timeframe: telemetry_keys_params.Timeframe | NotGiven = NOT_GIVEN, + datasets: SequenceNotStr[str] | Omit = omit, + filters: Iterable[telemetry_keys_params.Filter] | Omit = omit, + key_needle: telemetry_keys_params.KeyNeedle | Omit = omit, + limit: float | Omit = omit, + needle: telemetry_keys_params.Needle | Omit = omit, + timeframe: telemetry_keys_params.Timeframe | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[TelemetryKeysResponse]: """ List all the keys in your telemetry events. @@ -110,24 +110,24 @@ def query( account_id: str, query_id: str, timeframe: telemetry_query_params.Timeframe, - chart: bool | NotGiven = NOT_GIVEN, - compare: bool | NotGiven = NOT_GIVEN, - dry: bool | NotGiven = NOT_GIVEN, - granularity: float | NotGiven = NOT_GIVEN, - ignore_series: bool | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - offset: str | NotGiven = NOT_GIVEN, - offset_by: float | NotGiven = NOT_GIVEN, - offset_direction: str | NotGiven = NOT_GIVEN, - parameters: telemetry_query_params.Parameters | NotGiven = NOT_GIVEN, - pattern_type: Literal["message", "error"] | NotGiven = NOT_GIVEN, - view: Literal["traces", "events", "calculations", "invocations", "requests", "patterns"] | NotGiven = NOT_GIVEN, + chart: bool | Omit = omit, + compare: bool | Omit = omit, + dry: bool | Omit = omit, + granularity: float | Omit = omit, + ignore_series: bool | Omit = omit, + limit: float | Omit = omit, + offset: str | Omit = omit, + offset_by: float | Omit = omit, + offset_direction: str | Omit = omit, + parameters: telemetry_query_params.Parameters | Omit = omit, + pattern_type: Literal["message", "error"] | Omit = omit, + view: Literal["traces", "events", "calculations", "invocations", "requests", "patterns"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TelemetryQueryResponse: """ Runs a temporary or saved query @@ -178,19 +178,19 @@ def values( self, *, account_id: str, - datasets: List[str], + datasets: SequenceNotStr[str], key: str, timeframe: telemetry_values_params.Timeframe, type: Literal["string", "boolean", "number"], - filters: Iterable[telemetry_values_params.Filter] | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - needle: telemetry_values_params.Needle | NotGiven = NOT_GIVEN, + filters: Iterable[telemetry_values_params.Filter] | Omit = omit, + limit: float | Omit = omit, + needle: telemetry_values_params.Needle | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[TelemetryValuesResponse]: """ List unique values found in your events @@ -255,18 +255,18 @@ def keys( self, *, account_id: str, - datasets: List[str] | NotGiven = NOT_GIVEN, - filters: Iterable[telemetry_keys_params.Filter] | NotGiven = NOT_GIVEN, - key_needle: telemetry_keys_params.KeyNeedle | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - needle: telemetry_keys_params.Needle | NotGiven = NOT_GIVEN, - timeframe: telemetry_keys_params.Timeframe | NotGiven = NOT_GIVEN, + datasets: SequenceNotStr[str] | Omit = omit, + filters: Iterable[telemetry_keys_params.Filter] | Omit = omit, + key_needle: telemetry_keys_params.KeyNeedle | Omit = omit, + limit: float | Omit = omit, + needle: telemetry_keys_params.Needle | Omit = omit, + timeframe: telemetry_keys_params.Timeframe | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TelemetryKeysResponse, AsyncSinglePage[TelemetryKeysResponse]]: """ List all the keys in your telemetry events. @@ -313,24 +313,24 @@ async def query( account_id: str, query_id: str, timeframe: telemetry_query_params.Timeframe, - chart: bool | NotGiven = NOT_GIVEN, - compare: bool | NotGiven = NOT_GIVEN, - dry: bool | NotGiven = NOT_GIVEN, - granularity: float | NotGiven = NOT_GIVEN, - ignore_series: bool | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - offset: str | NotGiven = NOT_GIVEN, - offset_by: float | NotGiven = NOT_GIVEN, - offset_direction: str | NotGiven = NOT_GIVEN, - parameters: telemetry_query_params.Parameters | NotGiven = NOT_GIVEN, - pattern_type: Literal["message", "error"] | NotGiven = NOT_GIVEN, - view: Literal["traces", "events", "calculations", "invocations", "requests", "patterns"] | NotGiven = NOT_GIVEN, + chart: bool | Omit = omit, + compare: bool | Omit = omit, + dry: bool | Omit = omit, + granularity: float | Omit = omit, + ignore_series: bool | Omit = omit, + limit: float | Omit = omit, + offset: str | Omit = omit, + offset_by: float | Omit = omit, + offset_direction: str | Omit = omit, + parameters: telemetry_query_params.Parameters | Omit = omit, + pattern_type: Literal["message", "error"] | Omit = omit, + view: Literal["traces", "events", "calculations", "invocations", "requests", "patterns"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TelemetryQueryResponse: """ Runs a temporary or saved query @@ -381,19 +381,19 @@ def values( self, *, account_id: str, - datasets: List[str], + datasets: SequenceNotStr[str], key: str, timeframe: telemetry_values_params.Timeframe, type: Literal["string", "boolean", "number"], - filters: Iterable[telemetry_values_params.Filter] | NotGiven = NOT_GIVEN, - limit: float | NotGiven = NOT_GIVEN, - needle: telemetry_values_params.Needle | NotGiven = NOT_GIVEN, + filters: Iterable[telemetry_values_params.Filter] | Omit = omit, + limit: float | Omit = omit, + needle: telemetry_values_params.Needle | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TelemetryValuesResponse, AsyncSinglePage[TelemetryValuesResponse]]: """ List unique values found in your events diff --git a/src/cloudflare/resources/workers/routes.py b/src/cloudflare/resources/workers/routes.py index 52926fe5408..68304d512b8 100644 --- a/src/cloudflare/resources/workers/routes.py +++ b/src/cloudflare/resources/workers/routes.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,13 +54,13 @@ def create( *, zone_id: str, pattern: str, - script: str | NotGiven = NOT_GIVEN, + script: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteCreateResponse: """ Creates a route that maps a URL pattern to a Worker. @@ -108,13 +108,13 @@ def update( *, zone_id: str, pattern: str, - script: str | NotGiven = NOT_GIVEN, + script: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteUpdateResponse: """ Updates the URL pattern or Worker associated with a route. @@ -169,7 +169,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[RouteListResponse]: """ Returns routes for a zone. @@ -206,7 +206,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteDeleteResponse: """ Deletes a route. @@ -250,7 +250,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteGetResponse: """ Returns information about a route, including URL pattern and Worker. @@ -310,13 +310,13 @@ async def create( *, zone_id: str, pattern: str, - script: str | NotGiven = NOT_GIVEN, + script: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteCreateResponse: """ Creates a route that maps a URL pattern to a Worker. @@ -364,13 +364,13 @@ async def update( *, zone_id: str, pattern: str, - script: str | NotGiven = NOT_GIVEN, + script: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteUpdateResponse: """ Updates the URL pattern or Worker associated with a route. @@ -425,7 +425,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RouteListResponse, AsyncSinglePage[RouteListResponse]]: """ Returns routes for a zone. @@ -462,7 +462,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteDeleteResponse: """ Deletes a route. @@ -506,7 +506,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteGetResponse: """ Returns information about a route, including URL pattern and Worker. diff --git a/src/cloudflare/resources/workers/scripts/assets/upload.py b/src/cloudflare/resources/workers/scripts/assets/upload.py index 6812c7d3c2d..a4680e0f1d8 100644 --- a/src/cloudflare/resources/workers/scripts/assets/upload.py +++ b/src/cloudflare/resources/workers/scripts/assets/upload.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,7 +55,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UploadCreateResponse]: """Start uploading a collection of assets for use in a Worker version. @@ -128,7 +128,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UploadCreateResponse]: """Start uploading a collection of assets for use in a Worker version. diff --git a/src/cloudflare/resources/workers/scripts/content.py b/src/cloudflare/resources/workers/scripts/content.py index 56c3d0f6686..166a0085820 100644 --- a/src/cloudflare/resources/workers/scripts/content.py +++ b/src/cloudflare/resources/workers/scripts/content.py @@ -2,12 +2,28 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Mapping, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform, strip_not_given, async_maybe_transform +from ...._types import ( + Body, + Omit, + Query, + Headers, + NotGiven, + FileTypes, + SequenceNotStr, + omit, + not_given, +) +from ...._utils import ( + extract_files, + maybe_transform, + strip_not_given, + deepcopy_minimal, + async_maybe_transform, +) from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -28,7 +44,6 @@ from ...._base_client import make_request_options from ....types.workers.script import Script from ....types.workers.scripts import content_update_params -from ....types.workers.worker_metadata_param import WorkerMetadataParam __all__ = ["ContentResource", "AsyncContentResource"] @@ -58,15 +73,16 @@ def update( script_name: str, *, account_id: str, - metadata: WorkerMetadataParam, - cf_worker_body_part: str | NotGiven = NOT_GIVEN, - cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, + metadata: content_update_params.Metadata, + files: SequenceNotStr[FileTypes] | Omit = omit, + cf_worker_body_part: str | Omit = omit, + cf_worker_main_module_part: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Script: """ Put script content without touching config or metadata. @@ -76,7 +92,15 @@ def update( script_name: Name of the script, used in URLs and route configuration. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + + files: An array of modules (often JavaScript files) comprising a Worker script. At + least one module must be present and referenced in the metadata as `main_module` + or `body_part` by filename.
Possible Content-Type(s) are: + `application/javascript+module`, `text/javascript+module`, + `application/javascript`, `text/javascript`, `text/x-python`, + `text/x-python-requirement`, `application/wasm`, `text/plain`, + `application/octet-stream`, `application/source-map`. extra_headers: Send extra headers @@ -99,18 +123,27 @@ def update( ), **(extra_headers or {}), } + body = deepcopy_minimal( + { + "metadata": metadata, + "files": files, + } + ) + extracted_files = extract_files(cast(Mapping[str, object], body), paths=[["files", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._put( f"/accounts/{account_id}/workers/scripts/{script_name}/content", - body=maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), + body=maybe_transform(body, content_update_params.ContentUpdateParams), + files=extracted_files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[Script]._unwrapper, ), cast_to=cast(Type[Script], ResultWrapper[Script]), @@ -126,7 +159,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """ Fetch script content only. @@ -183,15 +216,16 @@ async def update( script_name: str, *, account_id: str, - metadata: WorkerMetadataParam, - cf_worker_body_part: str | NotGiven = NOT_GIVEN, - cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, + metadata: content_update_params.Metadata, + files: SequenceNotStr[FileTypes] | Omit = omit, + cf_worker_body_part: str | Omit = omit, + cf_worker_main_module_part: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Script: """ Put script content without touching config or metadata. @@ -201,7 +235,15 @@ async def update( script_name: Name of the script, used in URLs and route configuration. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + + files: An array of modules (often JavaScript files) comprising a Worker script. At + least one module must be present and referenced in the metadata as `main_module` + or `body_part` by filename.
Possible Content-Type(s) are: + `application/javascript+module`, `text/javascript+module`, + `application/javascript`, `text/javascript`, `text/x-python`, + `text/x-python-requirement`, `application/wasm`, `text/plain`, + `application/octet-stream`, `application/source-map`. extra_headers: Send extra headers @@ -224,18 +266,27 @@ async def update( ), **(extra_headers or {}), } + body = deepcopy_minimal( + { + "metadata": metadata, + "files": files, + } + ) + extracted_files = extract_files(cast(Mapping[str, object], body), paths=[["files", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._put( f"/accounts/{account_id}/workers/scripts/{script_name}/content", - body=await async_maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), + body=await async_maybe_transform(body, content_update_params.ContentUpdateParams), + files=extracted_files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[Script]._unwrapper, ), cast_to=cast(Type[Script], ResultWrapper[Script]), @@ -251,7 +302,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """ Fetch script content only. diff --git a/src/cloudflare/resources/workers/scripts/deployments.py b/src/cloudflare/resources/workers/scripts/deployments.py index 906cc4caf10..16ea873159f 100644 --- a/src/cloudflare/resources/workers/scripts/deployments.py +++ b/src/cloudflare/resources/workers/scripts/deployments.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Type, Iterable, Optional, cast +from typing import Type, Iterable, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -20,9 +20,9 @@ from ...._wrappers import ResultWrapper from ...._base_client import make_request_options from ....types.workers.scripts import deployment_create_params -from ....types.workers.scripts.deployment_param import DeploymentParam -from ....types.workers.scripts.deployment_get_response import DeploymentGetResponse -from ....types.workers.scripts.deployment_create_response import DeploymentCreateResponse +from ....types.workers.scripts.deployment import Deployment +from ....types.workers.scripts.deployment_list_response import DeploymentListResponse +from ....types.workers.scripts.deployment_delete_response import DeploymentDeleteResponse __all__ = ["DeploymentsResource", "AsyncDeploymentsResource"] @@ -54,15 +54,15 @@ def create( account_id: str, strategy: Literal["percentage"], versions: Iterable[deployment_create_params.Version], - force: bool | NotGiven = NOT_GIVEN, - annotations: DeploymentParam | NotGiven = NOT_GIVEN, + force: bool | Omit = omit, + annotations: deployment_create_params.Annotations | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this 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[DeploymentCreateResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Deployment: """ Deployments configure how [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions) @@ -72,7 +72,7 @@ def create( Args: account_id: Identifier. - script_name: Name of the script. + script_name: Name of the script, used in URLs and route configuration. force: If set to true, the deployment will be created even if normally blocked by something such rolling back to an older version when a secret has changed. @@ -105,12 +105,12 @@ def create( extra_body=extra_body, timeout=timeout, query=maybe_transform({"force": force}, deployment_create_params.DeploymentCreateParams), - post_parser=ResultWrapper[Optional[DeploymentCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Deployment]._unwrapper, ), - cast_to=cast(Type[Optional[DeploymentCreateResponse]], ResultWrapper[DeploymentCreateResponse]), + cast_to=cast(Type[Deployment], ResultWrapper[Deployment]), ) - def get( + def list( self, script_name: str, *, @@ -120,8 +120,8 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeploymentGetResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> DeploymentListResponse: """List of Worker Deployments. The first deployment in the list is the latest @@ -130,7 +130,7 @@ def get( Args: account_id: Identifier. - script_name: Name of the script. + script_name: Name of the script, used in URLs and route configuration. extra_headers: Send extra headers @@ -151,9 +151,101 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[DeploymentGetResponse]]._unwrapper, + post_parser=ResultWrapper[DeploymentListResponse]._unwrapper, ), - cast_to=cast(Type[Optional[DeploymentGetResponse]], ResultWrapper[DeploymentGetResponse]), + cast_to=cast(Type[DeploymentListResponse], ResultWrapper[DeploymentListResponse]), + ) + + def delete( + self, + deployment_id: str, + *, + account_id: str, + script_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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> DeploymentDeleteResponse: + """Delete a Worker Deployment. + + The latest deployment, which is actively serving + traffic, cannot be deleted. All other deployments can be deleted. + + Args: + account_id: Identifier. + + script_name: Name of the script, used in URLs and route configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not script_name: + raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return self._delete( + f"/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DeploymentDeleteResponse, + ) + + def get( + self, + deployment_id: str, + *, + account_id: str, + script_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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Deployment: + """ + Get information about a Worker Deployment. + + Args: + account_id: Identifier. + + script_name: Name of the script, used in URLs and route configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not script_name: + raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return self._get( + f"/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Deployment]._unwrapper, + ), + cast_to=cast(Type[Deployment], ResultWrapper[Deployment]), ) @@ -184,15 +276,15 @@ async def create( account_id: str, strategy: Literal["percentage"], versions: Iterable[deployment_create_params.Version], - force: bool | NotGiven = NOT_GIVEN, - annotations: DeploymentParam | NotGiven = NOT_GIVEN, + force: bool | Omit = omit, + annotations: deployment_create_params.Annotations | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this 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[DeploymentCreateResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Deployment: """ Deployments configure how [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions) @@ -202,7 +294,7 @@ async def create( Args: account_id: Identifier. - script_name: Name of the script. + script_name: Name of the script, used in URLs and route configuration. force: If set to true, the deployment will be created even if normally blocked by something such rolling back to an older version when a secret has changed. @@ -235,12 +327,12 @@ async def create( extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({"force": force}, deployment_create_params.DeploymentCreateParams), - post_parser=ResultWrapper[Optional[DeploymentCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Deployment]._unwrapper, ), - cast_to=cast(Type[Optional[DeploymentCreateResponse]], ResultWrapper[DeploymentCreateResponse]), + cast_to=cast(Type[Deployment], ResultWrapper[Deployment]), ) - async def get( + async def list( self, script_name: str, *, @@ -250,8 +342,8 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[DeploymentGetResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> DeploymentListResponse: """List of Worker Deployments. The first deployment in the list is the latest @@ -260,7 +352,7 @@ async def get( Args: account_id: Identifier. - script_name: Name of the script. + script_name: Name of the script, used in URLs and route configuration. extra_headers: Send extra headers @@ -281,9 +373,101 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[DeploymentGetResponse]]._unwrapper, + post_parser=ResultWrapper[DeploymentListResponse]._unwrapper, + ), + cast_to=cast(Type[DeploymentListResponse], ResultWrapper[DeploymentListResponse]), + ) + + async def delete( + self, + deployment_id: str, + *, + account_id: str, + script_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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> DeploymentDeleteResponse: + """Delete a Worker Deployment. + + The latest deployment, which is actively serving + traffic, cannot be deleted. All other deployments can be deleted. + + Args: + account_id: Identifier. + + script_name: Name of the script, used in URLs and route configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not script_name: + raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return await self._delete( + f"/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DeploymentDeleteResponse, + ) + + async def get( + self, + deployment_id: str, + *, + account_id: str, + script_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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Deployment: + """ + Get information about a Worker Deployment. + + Args: + account_id: Identifier. + + script_name: Name of the script, used in URLs and route configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not script_name: + raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return await self._get( + f"/accounts/{account_id}/workers/scripts/{script_name}/deployments/{deployment_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Deployment]._unwrapper, ), - cast_to=cast(Type[Optional[DeploymentGetResponse]], ResultWrapper[DeploymentGetResponse]), + cast_to=cast(Type[Deployment], ResultWrapper[Deployment]), ) @@ -294,6 +478,12 @@ def __init__(self, deployments: DeploymentsResource) -> None: self.create = to_raw_response_wrapper( deployments.create, ) + self.list = to_raw_response_wrapper( + deployments.list, + ) + self.delete = to_raw_response_wrapper( + deployments.delete, + ) self.get = to_raw_response_wrapper( deployments.get, ) @@ -306,6 +496,12 @@ def __init__(self, deployments: AsyncDeploymentsResource) -> None: self.create = async_to_raw_response_wrapper( deployments.create, ) + self.list = async_to_raw_response_wrapper( + deployments.list, + ) + self.delete = async_to_raw_response_wrapper( + deployments.delete, + ) self.get = async_to_raw_response_wrapper( deployments.get, ) @@ -318,6 +514,12 @@ def __init__(self, deployments: DeploymentsResource) -> None: self.create = to_streamed_response_wrapper( deployments.create, ) + self.list = to_streamed_response_wrapper( + deployments.list, + ) + self.delete = to_streamed_response_wrapper( + deployments.delete, + ) self.get = to_streamed_response_wrapper( deployments.get, ) @@ -330,6 +532,12 @@ def __init__(self, deployments: AsyncDeploymentsResource) -> None: self.create = async_to_streamed_response_wrapper( deployments.create, ) + self.list = async_to_streamed_response_wrapper( + deployments.list, + ) + self.delete = async_to_streamed_response_wrapper( + deployments.delete, + ) self.get = async_to_streamed_response_wrapper( deployments.get, ) diff --git a/src/cloudflare/resources/workers/scripts/schedules.py b/src/cloudflare/resources/workers/scripts/schedules.py index 7c6b0214435..07db257b926 100644 --- a/src/cloudflare/resources/workers/scripts/schedules.py +++ b/src/cloudflare/resources/workers/scripts/schedules.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScheduleUpdateResponse: """ Updates Cron Triggers for a Worker. @@ -101,7 +101,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScheduleGetResponse: """ Fetches Cron Triggers for a Worker. @@ -167,7 +167,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScheduleUpdateResponse: """ Updates Cron Triggers for a Worker. @@ -212,7 +212,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScheduleGetResponse: """ Fetches Cron Triggers for a Worker. diff --git a/src/cloudflare/resources/workers/scripts/script_and_version_settings.py b/src/cloudflare/resources/workers/scripts/script_and_version_settings.py index c536a2f2fd5..1d863218932 100644 --- a/src/cloudflare/resources/workers/scripts/script_and_version_settings.py +++ b/src/cloudflare/resources/workers/scripts/script_and_version_settings.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,13 +50,13 @@ def edit( script_name: str, *, account_id: str, - settings: script_and_version_setting_edit_params.Settings | NotGiven = NOT_GIVEN, + settings: script_and_version_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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptAndVersionSettingEditResponse: """ Patch metadata or config, such as bindings or usage model. @@ -92,6 +92,7 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[ScriptAndVersionSettingEditResponse]._unwrapper, ), cast_to=cast(Type[ScriptAndVersionSettingEditResponse], ResultWrapper[ScriptAndVersionSettingEditResponse]), @@ -107,7 +108,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptAndVersionSettingGetResponse: """ Get metadata and config, such as bindings or usage model. @@ -167,13 +168,13 @@ async def edit( script_name: str, *, account_id: str, - settings: script_and_version_setting_edit_params.Settings | NotGiven = NOT_GIVEN, + settings: script_and_version_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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptAndVersionSettingEditResponse: """ Patch metadata or config, such as bindings or usage model. @@ -209,6 +210,7 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[ScriptAndVersionSettingEditResponse]._unwrapper, ), cast_to=cast(Type[ScriptAndVersionSettingEditResponse], ResultWrapper[ScriptAndVersionSettingEditResponse]), @@ -224,7 +226,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptAndVersionSettingGetResponse: """ Get metadata and config, such as bindings or usage model. diff --git a/src/cloudflare/resources/workers/scripts/scripts.py b/src/cloudflare/resources/workers/scripts/scripts.py index e4937fa83ae..8201e735a8f 100644 --- a/src/cloudflare/resources/workers/scripts/scripts.py +++ b/src/cloudflare/resources/workers/scripts/scripts.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import Dict, Type, Optional, cast +from typing import Type, Optional, cast +from typing_extensions import Literal import httpx @@ -46,8 +47,18 @@ VersionsResourceWithStreamingResponse, AsyncVersionsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from ...._utils import maybe_transform, async_maybe_transform +from ...._types import ( + Body, + Omit, + Query, + Headers, + NotGiven, + FileTypes, + SequenceNotStr, + omit, + not_given, +) +from ...._utils import is_given, maybe_transform, deepcopy_minimal, async_maybe_transform from .schedules import ( SchedulesResource, AsyncSchedulesResource, @@ -91,7 +102,7 @@ AsyncAssetsResourceWithStreamingResponse, ) from ...._base_client import AsyncPaginator, make_request_options -from ....types.workers import script_delete_params, script_update_params +from ....types.workers import script_list_params, script_delete_params, script_search_params, script_update_params from ....types.workers.script import Script from .script_and_version_settings import ( ScriptAndVersionSettingsResource, @@ -101,6 +112,7 @@ ScriptAndVersionSettingsResourceWithStreamingResponse, AsyncScriptAndVersionSettingsResourceWithStreamingResponse, ) +from ....types.workers.script_search_response import ScriptSearchResponse from ....types.workers.script_update_response import ScriptUpdateResponse __all__ = ["ScriptsResource", "AsyncScriptsResource"] @@ -172,13 +184,13 @@ def update( *, account_id: str, metadata: script_update_params.Metadata, - files: Dict[str, FileTypes] = {}, + files: SequenceNotStr[FileTypes] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptUpdateResponse: """Upload a worker module. @@ -191,7 +203,15 @@ def update( script_name: Name of the script, used in URLs and route configuration. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + + files: An array of modules (often JavaScript files) comprising a Worker script. At + least one module must be present and referenced in the metadata as `main_module` + or `body_part` by filename.
Possible Content-Type(s) are: + `application/javascript+module`, `text/javascript+module`, + `application/javascript`, `text/javascript`, `text/x-python`, + `text/x-python-requirement`, `application/wasm`, `text/plain`, + `application/octet-stream`, `application/source-map`. extra_headers: Send extra headers @@ -205,20 +225,27 @@ def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - # It should be noted that the actual Content-Type header that will be - # sent to the server will contain a `boundary` parameter, e.g. - # multipart/form-data; boundary=---abc-- - extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} + body = deepcopy_minimal( + { + "metadata": metadata, + } + ) + extracted_files = [("files", file) for file in files] if is_given(files) else [] + if extracted_files: + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._put( f"/accounts/{account_id}/workers/scripts/{script_name}", - body=maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), - files=files, + body=maybe_transform(body, script_update_params.ScriptUpdateParams), + files=extracted_files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - multipart_syntax='json', + multipart_syntax="json", post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), @@ -228,12 +255,13 @@ def list( self, *, account_id: str, + tags: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Script]: """ Fetch a list of uploaded workers. @@ -241,6 +269,9 @@ def list( Args: account_id: Identifier. + tags: Filter scripts by tags. Format: comma-separated list of tag:allowed pairs where + allowed is 'yes' or 'no'. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -255,7 +286,11 @@ def list( f"/accounts/{account_id}/workers/scripts", page=SyncSinglePage[Script], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"tags": tags}, script_list_params.ScriptListParams), ), model=Script, ) @@ -265,13 +300,13 @@ def delete( script_name: str, *, account_id: str, - force: bool | NotGiven = NOT_GIVEN, + force: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Delete your worker. @@ -321,7 +356,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Fetch raw script content for your worker. @@ -354,6 +389,70 @@ def get( cast_to=str, ) + def search( + self, + *, + account_id: str, + id: str | Omit = omit, + name: str | Omit = omit, + order_by: Literal["created_on", "modified_on", "name"] | 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScriptSearchResponse: + """ + Search for Workers in an account. + + Args: + account_id: Identifier. + + id: Worker ID (also called tag) to search for. Only exact matches are returned. + + name: Worker name to search for. Both exact and partial matches are returned. + + order_by: Property to sort results by. Results are sorted in ascending order. + + page: Current page. + + per_page: Items 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 + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return self._get( + f"/accounts/{account_id}/workers/scripts-search", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "name": name, + "order_by": order_by, + "page": page, + "per_page": per_page, + }, + script_search_params.ScriptSearchParams, + ), + post_parser=ResultWrapper[ScriptSearchResponse]._unwrapper, + ), + cast_to=cast(Type[ScriptSearchResponse], ResultWrapper[ScriptSearchResponse]), + ) + class AsyncScriptsResource(AsyncAPIResource): @cached_property @@ -421,13 +520,13 @@ async def update( *, account_id: str, metadata: script_update_params.Metadata, - files: Dict[str, FileTypes] = {}, + files: SequenceNotStr[FileTypes] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptUpdateResponse: """Upload a worker module. @@ -440,7 +539,15 @@ async def update( script_name: Name of the script, used in URLs and route configuration. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + + files: An array of modules (often JavaScript files) comprising a Worker script. At + least one module must be present and referenced in the metadata as `main_module` + or `body_part` by filename.
Possible Content-Type(s) are: + `application/javascript+module`, `text/javascript+module`, + `application/javascript`, `text/javascript`, `text/x-python`, + `text/x-python-requirement`, `application/wasm`, `text/plain`, + `application/octet-stream`, `application/source-map`. extra_headers: Send extra headers @@ -454,21 +561,28 @@ async def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - # It should be noted that the actual Content-Type header that will be - # sent to the server will contain a `boundary` parameter, e.g. - # multipart/form-data; boundary=---abc-- - extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} + body = deepcopy_minimal( + { + "metadata": metadata, + } + ) + extracted_files = [("files", file) for file in files] if is_given(files) else [] + if extracted_files: + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._put( f"/accounts/{account_id}/workers/scripts/{script_name}", - body=await async_maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), - files=files, + body=await async_maybe_transform(body, script_update_params.ScriptUpdateParams), + files=extracted_files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, - multipart_syntax='json', ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), ) @@ -477,12 +591,13 @@ def list( self, *, account_id: str, + tags: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Script, AsyncSinglePage[Script]]: """ Fetch a list of uploaded workers. @@ -490,6 +605,9 @@ def list( Args: account_id: Identifier. + tags: Filter scripts by tags. Format: comma-separated list of tag:allowed pairs where + allowed is 'yes' or 'no'. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -504,7 +622,11 @@ def list( f"/accounts/{account_id}/workers/scripts", page=AsyncSinglePage[Script], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"tags": tags}, script_list_params.ScriptListParams), ), model=Script, ) @@ -514,13 +636,13 @@ async def delete( script_name: str, *, account_id: str, - force: bool | NotGiven = NOT_GIVEN, + force: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Delete your worker. @@ -570,7 +692,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Fetch raw script content for your worker. @@ -603,6 +725,70 @@ async def get( cast_to=str, ) + async def search( + self, + *, + account_id: str, + id: str | Omit = omit, + name: str | Omit = omit, + order_by: Literal["created_on", "modified_on", "name"] | 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. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScriptSearchResponse: + """ + Search for Workers in an account. + + Args: + account_id: Identifier. + + id: Worker ID (also called tag) to search for. Only exact matches are returned. + + name: Worker name to search for. Both exact and partial matches are returned. + + order_by: Property to sort results by. Results are sorted in ascending order. + + page: Current page. + + per_page: Items 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 + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + return await self._get( + f"/accounts/{account_id}/workers/scripts-search", + 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, + "name": name, + "order_by": order_by, + "page": page, + "per_page": per_page, + }, + script_search_params.ScriptSearchParams, + ), + post_parser=ResultWrapper[ScriptSearchResponse]._unwrapper, + ), + cast_to=cast(Type[ScriptSearchResponse], ResultWrapper[ScriptSearchResponse]), + ) + class ScriptsResourceWithRawResponse: def __init__(self, scripts: ScriptsResource) -> None: @@ -620,6 +806,9 @@ def __init__(self, scripts: ScriptsResource) -> None: self.get = to_raw_response_wrapper( scripts.get, ) + self.search = to_raw_response_wrapper( + scripts.search, + ) @cached_property def assets(self) -> AssetsResourceWithRawResponse: @@ -678,6 +867,9 @@ def __init__(self, scripts: AsyncScriptsResource) -> None: self.get = async_to_raw_response_wrapper( scripts.get, ) + self.search = async_to_raw_response_wrapper( + scripts.search, + ) @cached_property def assets(self) -> AsyncAssetsResourceWithRawResponse: @@ -736,6 +928,9 @@ def __init__(self, scripts: ScriptsResource) -> None: self.get = to_streamed_response_wrapper( scripts.get, ) + self.search = to_streamed_response_wrapper( + scripts.search, + ) @cached_property def assets(self) -> AssetsResourceWithStreamingResponse: @@ -794,6 +989,9 @@ def __init__(self, scripts: AsyncScriptsResource) -> None: self.get = async_to_streamed_response_wrapper( scripts.get, ) + self.search = async_to_streamed_response_wrapper( + scripts.search, + ) @cached_property def assets(self) -> AsyncAssetsResourceWithStreamingResponse: diff --git a/src/cloudflare/resources/workers/scripts/secrets.py b/src/cloudflare/resources/workers/scripts/secrets.py index 7a36e723666..de30c08f9da 100644 --- a/src/cloudflare/resources/workers/scripts/secrets.py +++ b/src/cloudflare/resources/workers/scripts/secrets.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -20,7 +20,7 @@ from ...._wrappers import ResultWrapper from ....pagination import SyncSinglePage, AsyncSinglePage from ...._base_client import AsyncPaginator, make_request_options -from ....types.workers.scripts import secret_update_params +from ....types.workers.scripts import secret_get_params, secret_delete_params, secret_update_params from ....types.workers.scripts.secret_get_response import SecretGetResponse from ....types.workers.scripts.secret_list_response import SecretListResponse from ....types.workers.scripts.secret_update_response import SecretUpdateResponse @@ -62,7 +62,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretUpdateResponse]: """ Add a secret to a script. @@ -101,14 +101,14 @@ def update( usages: List[ Literal["encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey"] ], - key_base64: str | NotGiven = NOT_GIVEN, - key_jwk: object | NotGiven = NOT_GIVEN, + key_base64: str | Omit = omit, + key_jwk: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretUpdateResponse]: """ Add a secret to a script. @@ -156,20 +156,20 @@ def update( *, account_id: str, name: str, - text: str | NotGiven = NOT_GIVEN, + text: str | Omit = omit, type: Literal["secret_text"] | Literal["secret_key"], - algorithm: object | NotGiven = NOT_GIVEN, - format: Literal["raw", "pkcs8", "spki", "jwk"] | NotGiven = NOT_GIVEN, + algorithm: object | Omit = omit, + format: Literal["raw", "pkcs8", "spki", "jwk"] | Omit = omit, usages: List[Literal["encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey"]] - | NotGiven = NOT_GIVEN, - key_base64: str | NotGiven = NOT_GIVEN, - key_jwk: object | NotGiven = NOT_GIVEN, + | Omit = omit, + key_base64: str | Omit = omit, + key_jwk: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -215,7 +215,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SecretListResponse]: """ List secrets bound to a script. @@ -252,12 +252,13 @@ def delete( *, account_id: str, script_name: str, + url_encoded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Remove a secret from a script. @@ -269,6 +270,8 @@ def delete( secret_name: A JavaScript variable name for the secret binding. + url_encoded: Flag that indicates whether the secret name is URL encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -290,6 +293,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform({"url_encoded": url_encoded}, secret_delete_params.SecretDeleteParams), post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), @@ -301,12 +305,13 @@ def get( *, account_id: str, script_name: str, + url_encoded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretGetResponse]: """ Get a given secret binding (value omitted) on a script. @@ -318,6 +323,8 @@ def get( secret_name: A JavaScript variable name for the secret binding. + url_encoded: Flag that indicates whether the secret name is URL encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -341,6 +348,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform({"url_encoded": url_encoded}, secret_get_params.SecretGetParams), post_parser=ResultWrapper[Optional[SecretGetResponse]]._unwrapper, ), cast_to=cast( @@ -384,7 +392,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretUpdateResponse]: """ Add a secret to a script. @@ -423,14 +431,14 @@ async def update( usages: List[ Literal["encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey"] ], - key_base64: str | NotGiven = NOT_GIVEN, - key_jwk: object | NotGiven = NOT_GIVEN, + key_base64: str | Omit = omit, + key_jwk: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretUpdateResponse]: """ Add a secret to a script. @@ -478,20 +486,20 @@ async def update( *, account_id: str, name: str, - text: str | NotGiven = NOT_GIVEN, + text: str | Omit = omit, type: Literal["secret_text"] | Literal["secret_key"], - algorithm: object | NotGiven = NOT_GIVEN, - format: Literal["raw", "pkcs8", "spki", "jwk"] | NotGiven = NOT_GIVEN, + algorithm: object | Omit = omit, + format: Literal["raw", "pkcs8", "spki", "jwk"] | Omit = omit, usages: List[Literal["encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey"]] - | NotGiven = NOT_GIVEN, - key_base64: str | NotGiven = NOT_GIVEN, - key_jwk: object | NotGiven = NOT_GIVEN, + | Omit = omit, + key_base64: str | Omit = omit, + key_jwk: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -537,7 +545,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SecretListResponse, AsyncSinglePage[SecretListResponse]]: """ List secrets bound to a script. @@ -574,12 +582,13 @@ async def delete( *, account_id: str, script_name: str, + url_encoded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Remove a secret from a script. @@ -591,6 +600,8 @@ async def delete( secret_name: A JavaScript variable name for the secret binding. + url_encoded: Flag that indicates whether the secret name is URL encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -612,6 +623,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=await async_maybe_transform( + {"url_encoded": url_encoded}, secret_delete_params.SecretDeleteParams + ), post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), @@ -623,12 +637,13 @@ async def get( *, account_id: str, script_name: str, + url_encoded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SecretGetResponse]: """ Get a given secret binding (value omitted) on a script. @@ -640,6 +655,8 @@ async def get( secret_name: A JavaScript variable name for the secret binding. + url_encoded: Flag that indicates whether the secret name is URL encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -663,6 +680,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=await async_maybe_transform({"url_encoded": url_encoded}, secret_get_params.SecretGetParams), post_parser=ResultWrapper[Optional[SecretGetResponse]]._unwrapper, ), cast_to=cast( diff --git a/src/cloudflare/resources/workers/scripts/settings.py b/src/cloudflare/resources/workers/scripts/settings.py index 0e27e10eeb0..140abfa9c19 100644 --- a/src/cloudflare/resources/workers/scripts/settings.py +++ b/src/cloudflare/resources/workers/scripts/settings.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,15 +50,16 @@ def edit( script_name: str, *, account_id: str, - logpush: bool | NotGiven = NOT_GIVEN, - observability: Optional[setting_edit_params.Observability] | NotGiven = NOT_GIVEN, - tail_consumers: Optional[Iterable[ConsumerScriptParam]] | NotGiven = NOT_GIVEN, + logpush: bool | Omit = omit, + observability: Optional[setting_edit_params.Observability] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + tail_consumers: Optional[Iterable[ConsumerScriptParam]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptSetting: """ Patch script-level settings when using @@ -74,6 +75,8 @@ def edit( observability: Observability settings for the Worker. + tags: Tags associated with the Worker. + tail_consumers: List of Workers that will consume logs from the attached Worker. extra_headers: Send extra headers @@ -94,6 +97,7 @@ def edit( { "logpush": logpush, "observability": observability, + "tags": tags, "tail_consumers": tail_consumers, }, setting_edit_params.SettingEditParams, @@ -118,7 +122,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptSetting: """ Get script-level settings when using @@ -180,15 +184,16 @@ async def edit( script_name: str, *, account_id: str, - logpush: bool | NotGiven = NOT_GIVEN, - observability: Optional[setting_edit_params.Observability] | NotGiven = NOT_GIVEN, - tail_consumers: Optional[Iterable[ConsumerScriptParam]] | NotGiven = NOT_GIVEN, + logpush: bool | Omit = omit, + observability: Optional[setting_edit_params.Observability] | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + tail_consumers: Optional[Iterable[ConsumerScriptParam]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptSetting: """ Patch script-level settings when using @@ -204,6 +209,8 @@ async def edit( observability: Observability settings for the Worker. + tags: Tags associated with the Worker. + tail_consumers: List of Workers that will consume logs from the attached Worker. extra_headers: Send extra headers @@ -224,6 +231,7 @@ async def edit( { "logpush": logpush, "observability": observability, + "tags": tags, "tail_consumers": tail_consumers, }, setting_edit_params.SettingEditParams, @@ -248,7 +256,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptSetting: """ Get script-level settings when using diff --git a/src/cloudflare/resources/workers/scripts/subdomain.py b/src/cloudflare/resources/workers/scripts/subdomain.py index e8d7ac0f5b8..ee6e690dabd 100644 --- a/src/cloudflare/resources/workers/scripts/subdomain.py +++ b/src/cloudflare/resources/workers/scripts/subdomain.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,13 +52,13 @@ def create( *, account_id: str, enabled: bool, - previews_enabled: bool | NotGiven = NOT_GIVEN, + previews_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubdomainCreateResponse: """ Enable or disable the Worker on the workers.dev subdomain. @@ -114,7 +114,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubdomainDeleteResponse: """ Disable all workers.dev subdomains for a Worker. @@ -158,7 +158,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubdomainGetResponse: """ Get if the Worker is available on the workers.dev subdomain. @@ -219,13 +219,13 @@ async def create( *, account_id: str, enabled: bool, - previews_enabled: bool | NotGiven = NOT_GIVEN, + previews_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubdomainCreateResponse: """ Enable or disable the Worker on the workers.dev subdomain. @@ -281,7 +281,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubdomainDeleteResponse: """ Disable all workers.dev subdomains for a Worker. @@ -325,7 +325,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubdomainGetResponse: """ Get if the Worker is available on the workers.dev subdomain. diff --git a/src/cloudflare/resources/workers/scripts/tail.py b/src/cloudflare/resources/workers/scripts/tail.py index 6644cfbaafe..50f03689386 100644 --- a/src/cloudflare/resources/workers/scripts/tail.py +++ b/src/cloudflare/resources/workers/scripts/tail.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -57,7 +57,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TailCreateResponse: """ Starts a tail that receives logs and exception from a Worker. @@ -103,7 +103,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TailDeleteResponse: """ Deletes a tail from a Worker. @@ -147,7 +147,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TailGetResponse: """ Get list of tails currently deployed on a Worker. @@ -213,7 +213,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TailCreateResponse: """ Starts a tail that receives logs and exception from a Worker. @@ -259,7 +259,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TailDeleteResponse: """ Deletes a tail from a Worker. @@ -303,7 +303,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TailGetResponse: """ Get list of tails currently deployed on a Worker. diff --git a/src/cloudflare/resources/workers/scripts/versions.py b/src/cloudflare/resources/workers/scripts/versions.py index e4755f21f7c..503c9871299 100644 --- a/src/cloudflare/resources/workers/scripts/versions.py +++ b/src/cloudflare/resources/workers/scripts/versions.py @@ -6,8 +6,18 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform, async_maybe_transform +from ...._types import ( + Body, + Omit, + Query, + Headers, + NotGiven, + FileTypes, + SequenceNotStr, + omit, + not_given, +) +from ...._utils import is_given, maybe_transform, deepcopy_minimal, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -53,12 +63,13 @@ def create( *, account_id: str, metadata: version_create_params.Metadata, + files: SequenceNotStr[FileTypes] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionCreateResponse: """Upload a Worker Version without deploying to Cloudflare's network. @@ -71,7 +82,15 @@ def create( script_name: Name of the script. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + + files: An array of modules (often JavaScript files) comprising a Worker script. At + least one module must be present and referenced in the metadata as `main_module` + or `body_part` by filename.
Possible Content-Type(s) are: + `application/javascript+module`, `text/javascript+module`, + `application/javascript`, `text/javascript`, `text/x-python`, + `text/x-python-requirement`, `application/wasm`, `text/plain`, + `application/octet-stream`, `application/source-map`. extra_headers: Send extra headers @@ -85,18 +104,27 @@ def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + body = deepcopy_minimal( + { + "metadata": metadata, + } + ) + extracted_files = [("files", file) for file in files] if is_given(files) else [] + # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._post( f"/accounts/{account_id}/workers/scripts/{script_name}/versions", - body=maybe_transform({"metadata": metadata}, version_create_params.VersionCreateParams), + body=maybe_transform(body, version_create_params.VersionCreateParams), + files=extracted_files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[VersionCreateResponse]._unwrapper, ), cast_to=cast(Type[VersionCreateResponse], ResultWrapper[VersionCreateResponse]), @@ -107,15 +135,15 @@ def list( script_name: str, *, account_id: str, - deployable: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + deployable: bool | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[VersionListResponse]: """List of Worker Versions. @@ -175,7 +203,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ Get Version Detail @@ -238,12 +266,13 @@ async def create( *, account_id: str, metadata: version_create_params.Metadata, + files: SequenceNotStr[FileTypes] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionCreateResponse: """Upload a Worker Version without deploying to Cloudflare's network. @@ -256,7 +285,15 @@ async def create( script_name: Name of the script. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + + files: An array of modules (often JavaScript files) comprising a Worker script. At + least one module must be present and referenced in the metadata as `main_module` + or `body_part` by filename.
Possible Content-Type(s) are: + `application/javascript+module`, `text/javascript+module`, + `application/javascript`, `text/javascript`, `text/x-python`, + `text/x-python-requirement`, `application/wasm`, `text/plain`, + `application/octet-stream`, `application/source-map`. extra_headers: Send extra headers @@ -270,18 +307,26 @@ async def create( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") + body = deepcopy_minimal( + { + "metadata": metadata, + } + ) + extracted_files = [("files", file) for file in files] if is_given(files) else [] # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._post( f"/accounts/{account_id}/workers/scripts/{script_name}/versions", - body=await async_maybe_transform({"metadata": metadata}, version_create_params.VersionCreateParams), + body=await async_maybe_transform(body, version_create_params.VersionCreateParams), + files=extracted_files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[VersionCreateResponse]._unwrapper, ), cast_to=cast(Type[VersionCreateResponse], ResultWrapper[VersionCreateResponse]), @@ -292,15 +337,15 @@ def list( script_name: str, *, account_id: str, - deployable: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + deployable: bool | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[VersionListResponse, AsyncV4PagePagination[VersionListResponse]]: """List of Worker Versions. @@ -360,7 +405,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ Get Version Detail diff --git a/src/cloudflare/resources/workers/subdomains.py b/src/cloudflare/resources/workers/subdomains.py index 2cbe7c4b867..644d6e15a41 100644 --- a/src/cloudflare/resources/workers/subdomains.py +++ b/src/cloudflare/resources/workers/subdomains.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,7 +55,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubdomainUpdateResponse: """ Creates a Workers subdomain for an account. @@ -95,7 +95,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubdomainGetResponse: """ Returns a Workers subdomain for an account. @@ -156,7 +156,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubdomainUpdateResponse: """ Creates a Workers subdomain for an account. @@ -196,7 +196,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SubdomainGetResponse: """ Returns a Workers subdomain for an account. diff --git a/src/cloudflare/resources/workers/workers.py b/src/cloudflare/resources/workers/workers.py index adfc05c6b0e..971c066d436 100644 --- a/src/cloudflare/resources/workers/workers.py +++ b/src/cloudflare/resources/workers/workers.py @@ -19,6 +19,14 @@ AsyncDomainsResourceWithStreamingResponse, ) from ..._compat import cached_property +from .beta.beta import ( + BetaResource, + AsyncBetaResource, + BetaResourceWithRawResponse, + AsyncBetaResourceWithRawResponse, + BetaResourceWithStreamingResponse, + AsyncBetaResourceWithStreamingResponse, +) from .subdomains import ( SubdomainsResource, AsyncSubdomainsResource, @@ -65,6 +73,10 @@ class WorkersResource(SyncAPIResource): + @cached_property + def beta(self) -> BetaResource: + return BetaResource(self._client) + @cached_property def routes(self) -> RoutesResource: return RoutesResource(self._client) @@ -114,6 +126,10 @@ def with_streaming_response(self) -> WorkersResourceWithStreamingResponse: class AsyncWorkersResource(AsyncAPIResource): + @cached_property + def beta(self) -> AsyncBetaResource: + return AsyncBetaResource(self._client) + @cached_property def routes(self) -> AsyncRoutesResource: return AsyncRoutesResource(self._client) @@ -166,6 +182,10 @@ class WorkersResourceWithRawResponse: def __init__(self, workers: WorkersResource) -> None: self._workers = workers + @cached_property + def beta(self) -> BetaResourceWithRawResponse: + return BetaResourceWithRawResponse(self._workers.beta) + @cached_property def routes(self) -> RoutesResourceWithRawResponse: return RoutesResourceWithRawResponse(self._workers.routes) @@ -199,6 +219,10 @@ class AsyncWorkersResourceWithRawResponse: def __init__(self, workers: AsyncWorkersResource) -> None: self._workers = workers + @cached_property + def beta(self) -> AsyncBetaResourceWithRawResponse: + return AsyncBetaResourceWithRawResponse(self._workers.beta) + @cached_property def routes(self) -> AsyncRoutesResourceWithRawResponse: return AsyncRoutesResourceWithRawResponse(self._workers.routes) @@ -232,6 +256,10 @@ class WorkersResourceWithStreamingResponse: def __init__(self, workers: WorkersResource) -> None: self._workers = workers + @cached_property + def beta(self) -> BetaResourceWithStreamingResponse: + return BetaResourceWithStreamingResponse(self._workers.beta) + @cached_property def routes(self) -> RoutesResourceWithStreamingResponse: return RoutesResourceWithStreamingResponse(self._workers.routes) @@ -265,6 +293,10 @@ class AsyncWorkersResourceWithStreamingResponse: def __init__(self, workers: AsyncWorkersResource) -> None: self._workers = workers + @cached_property + def beta(self) -> AsyncBetaResourceWithStreamingResponse: + return AsyncBetaResourceWithStreamingResponse(self._workers.beta) + @cached_property def routes(self) -> AsyncRoutesResourceWithStreamingResponse: return AsyncRoutesResourceWithStreamingResponse(self._workers.routes) 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 86b279772f1..eb1514caadc 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -63,13 +63,13 @@ def create( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceCreateResponse]: """ Create a new Workers for Platforms namespace. @@ -111,7 +111,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[NamespaceListResponse]: """ Fetch a list of Workers for Platforms namespaces. @@ -148,7 +148,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a Workers for Platforms namespace. @@ -192,7 +192,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceGetResponse]: """ Get a Workers for Platforms namespace. @@ -255,13 +255,13 @@ async def create( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceCreateResponse]: """ Create a new Workers for Platforms namespace. @@ -303,7 +303,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[NamespaceListResponse, AsyncSinglePage[NamespaceListResponse]]: """ Fetch a list of Workers for Platforms namespaces. @@ -340,7 +340,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a Workers for Platforms namespace. @@ -384,7 +384,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NamespaceGetResponse]: """ Get a Workers for Platforms 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 5b555f92b6d..9d608c0e070 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 @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,7 +58,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AssetUploadCreateResponse]: """Start uploading a collection of assets for use in a Worker version. @@ -136,7 +136,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AssetUploadCreateResponse]: """Start uploading a collection of assets for use in a Worker version. 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 b5e4a04ce0a..1771a7f7946 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 @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Query, Headers, NotGiven, not_given from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -53,7 +53,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[BindingGetResponse]: """ Fetch script bindings from a script uploaded to a Workers for Platforms @@ -121,7 +121,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[BindingGetResponse, AsyncSinglePage[BindingGetResponse]]: """ Fetch script bindings from a script uploaded to a Workers for Platforms 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 fec2b2495b0..d1934684156 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 @@ -2,12 +2,28 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Mapping, cast import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ......_utils import maybe_transform, strip_not_given, async_maybe_transform +from ......_types import ( + Body, + Omit, + Query, + Headers, + NotGiven, + FileTypes, + SequenceNotStr, + omit, + not_given, +) +from ......_utils import ( + extract_files, + maybe_transform, + strip_not_given, + deepcopy_minimal, + async_maybe_transform, +) from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -60,14 +76,15 @@ def update( account_id: str, dispatch_namespace: str, metadata: WorkerMetadataParam, - cf_worker_body_part: str | NotGiven = NOT_GIVEN, - cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, + files: SequenceNotStr[FileTypes] | Omit = omit, + cf_worker_body_part: str | Omit = omit, + cf_worker_main_module_part: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Script: """ Put script content for a script uploaded to a Workers for Platforms namespace. @@ -79,7 +96,15 @@ def update( script_name: Name of the script, used in URLs and route configuration. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + + files: An array of modules (often JavaScript files) comprising a Worker script. At + least one module must be present and referenced in the metadata as `main_module` + or `body_part` by filename.
Possible Content-Type(s) are: + `application/javascript+module`, `text/javascript+module`, + `application/javascript`, `text/javascript`, `text/x-python`, + `text/x-python-requirement`, `application/wasm`, `text/plain`, + `application/octet-stream`, `application/source-map`. extra_headers: Send extra headers @@ -104,18 +129,27 @@ def update( ), **(extra_headers or {}), } + body = deepcopy_minimal( + { + "metadata": metadata, + "files": files, + } + ) + extracted_files = extract_files(cast(Mapping[str, object], body), paths=[["files", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/content", - body=maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), + body=maybe_transform(body, content_update_params.ContentUpdateParams), + files=extracted_files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[Script]._unwrapper, ), cast_to=cast(Type[Script], ResultWrapper[Script]), @@ -132,7 +166,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """ Fetch script content from a script uploaded to a Workers for Platforms @@ -196,14 +230,15 @@ async def update( account_id: str, dispatch_namespace: str, metadata: WorkerMetadataParam, - cf_worker_body_part: str | NotGiven = NOT_GIVEN, - cf_worker_main_module_part: str | NotGiven = NOT_GIVEN, + files: SequenceNotStr[FileTypes] | Omit = omit, + cf_worker_body_part: str | Omit = omit, + cf_worker_main_module_part: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Script: """ Put script content for a script uploaded to a Workers for Platforms namespace. @@ -215,7 +250,15 @@ async def update( script_name: Name of the script, used in URLs and route configuration. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + + files: An array of modules (often JavaScript files) comprising a Worker script. At + least one module must be present and referenced in the metadata as `main_module` + or `body_part` by filename.
Possible Content-Type(s) are: + `application/javascript+module`, `text/javascript+module`, + `application/javascript`, `text/javascript`, `text/x-python`, + `text/x-python-requirement`, `application/wasm`, `text/plain`, + `application/octet-stream`, `application/source-map`. extra_headers: Send extra headers @@ -240,18 +283,27 @@ async def update( ), **(extra_headers or {}), } + body = deepcopy_minimal( + { + "metadata": metadata, + "files": files, + } + ) + extracted_files = extract_files(cast(Mapping[str, object], body), paths=[["files", ""]]) # It should be noted that the actual Content-Type header that will be # sent to the server will contain a `boundary` parameter, e.g. # multipart/form-data; boundary=---abc-- extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/content", - body=await async_maybe_transform({"metadata": metadata}, content_update_params.ContentUpdateParams), + body=await async_maybe_transform(body, content_update_params.ContentUpdateParams), + files=extracted_files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[Script]._unwrapper, ), cast_to=cast(Type[Script], ResultWrapper[Script]), @@ -268,7 +320,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """ Fetch script content from a script uploaded to a Workers for Platforms 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 6212535ade3..04c42ec677a 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Type, Optional, cast +from typing import Type, Optional, cast import httpx @@ -46,8 +46,18 @@ SettingsResourceWithStreamingResponse, AsyncSettingsResourceWithStreamingResponse, ) -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from ......_utils import maybe_transform, async_maybe_transform +from ......_types import ( + Body, + Omit, + Query, + Headers, + NotGiven, + FileTypes, + SequenceNotStr, + omit, + not_given, +) +from ......_utils import is_given, maybe_transform, deepcopy_minimal, async_maybe_transform from ......_compat import cached_property from .asset_upload import ( AssetUploadResource, @@ -124,13 +134,13 @@ def update( account_id: str, dispatch_namespace: str, metadata: script_update_params.Metadata, - files: Dict[str, FileTypes] = {}, + files: SequenceNotStr[FileTypes] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptUpdateResponse: """Upload a worker module to a Workers for Platforms namespace. @@ -145,7 +155,15 @@ def update( script_name: Name of the script, used in URLs and route configuration. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + + files: An array of modules (often JavaScript files) comprising a Worker script. At + least one module must be present and referenced in the metadata as `main_module` + or `body_part` by filename.
Possible Content-Type(s) are: + `application/javascript+module`, `text/javascript+module`, + `application/javascript`, `text/javascript`, `text/x-python`, + `text/x-python-requirement`, `application/wasm`, `text/plain`, + `application/octet-stream`, `application/source-map`. extra_headers: Send extra headers @@ -161,20 +179,27 @@ def update( raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - # It should be noted that the actual Content-Type header that will be - # sent to the server will contain a `boundary` parameter, e.g. - # multipart/form-data; boundary=---abc-- - extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} + body = deepcopy_minimal( + { + "metadata": metadata, + } + ) + extracted_files = [("files", file) for file in files] if is_given(files) else [] + if extracted_files: + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}", - body=maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), - files=files, + body=maybe_transform(body, script_update_params.ScriptUpdateParams), + files=extracted_files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - multipart_syntax='json', + multipart_syntax="json", post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), @@ -186,13 +211,13 @@ def delete( *, account_id: str, dispatch_namespace: str, - force: bool | NotGiven = NOT_GIVEN, + force: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Delete a worker from a Workers for Platforms namespace. @@ -248,7 +273,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Script: """ Fetch information about a script uploaded to a Workers for Platforms namespace. @@ -338,13 +363,13 @@ async def update( account_id: str, dispatch_namespace: str, metadata: script_update_params.Metadata, - files: Dict[str, FileTypes] = {}, + files: SequenceNotStr[FileTypes] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScriptUpdateResponse: """Upload a worker module to a Workers for Platforms namespace. @@ -359,7 +384,15 @@ async def update( script_name: Name of the script, used in URLs and route configuration. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + + files: An array of modules (often JavaScript files) comprising a Worker script. At + least one module must be present and referenced in the metadata as `main_module` + or `body_part` by filename.
Possible Content-Type(s) are: + `application/javascript+module`, `text/javascript+module`, + `application/javascript`, `text/javascript`, `text/x-python`, + `text/x-python-requirement`, `application/wasm`, `text/plain`, + `application/octet-stream`, `application/source-map`. extra_headers: Send extra headers @@ -375,20 +408,27 @@ async def update( raise ValueError(f"Expected a non-empty value for `dispatch_namespace` but received {dispatch_namespace!r}") if not script_name: raise ValueError(f"Expected a non-empty value for `script_name` but received {script_name!r}") - # It should be noted that the actual Content-Type header that will be - # sent to the server will contain a `boundary` parameter, e.g. - # multipart/form-data; boundary=---abc-- - extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} + body = deepcopy_minimal( + { + "metadata": metadata, + } + ) + extracted_files = [("files", file) for file in files] if is_given(files) else [] + if extracted_files: + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._put( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}", - body=await async_maybe_transform({"metadata": metadata}, script_update_params.ScriptUpdateParams), - files=files, + body=await async_maybe_transform(body, script_update_params.ScriptUpdateParams), + files=extracted_files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - multipart_syntax='json', + multipart_syntax="json", post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), @@ -400,13 +440,13 @@ async def delete( *, account_id: str, dispatch_namespace: str, - force: bool | NotGiven = NOT_GIVEN, + force: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """Delete a worker from a Workers for Platforms namespace. @@ -462,7 +502,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Script: """ Fetch information about a script uploaded to a Workers for Platforms 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 30ef31dccea..bd34213ac7d 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 @@ -7,7 +7,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -20,7 +20,11 @@ from ......_wrappers import ResultWrapper from ......pagination import SyncSinglePage, AsyncSinglePage from ......_base_client import AsyncPaginator, make_request_options -from ......types.workers_for_platforms.dispatch.namespaces.scripts import secret_update_params +from ......types.workers_for_platforms.dispatch.namespaces.scripts import ( + secret_get_params, + secret_delete_params, + secret_update_params, +) from ......types.workers_for_platforms.dispatch.namespaces.scripts.secret_get_response import SecretGetResponse from ......types.workers_for_platforms.dispatch.namespaces.scripts.secret_list_response import SecretListResponse from ......types.workers_for_platforms.dispatch.namespaces.scripts.secret_update_response import SecretUpdateResponse @@ -63,7 +67,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretUpdateResponse: """ Add a secret to a script uploaded to a Workers for Platforms namespace. @@ -105,14 +109,14 @@ def update( usages: List[ Literal["encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey"] ], - key_base64: str | NotGiven = NOT_GIVEN, - key_jwk: object | NotGiven = NOT_GIVEN, + key_base64: str | Omit = omit, + key_jwk: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretUpdateResponse: """ Add a secret to a script uploaded to a Workers for Platforms namespace. @@ -164,20 +168,20 @@ def update( account_id: str, dispatch_namespace: str, name: str, - text: str | NotGiven = NOT_GIVEN, + text: str | Omit = omit, type: Literal["secret_text"] | Literal["secret_key"], - algorithm: object | NotGiven = NOT_GIVEN, - format: Literal["raw", "pkcs8", "spki", "jwk"] | NotGiven = NOT_GIVEN, + algorithm: object | Omit = omit, + format: Literal["raw", "pkcs8", "spki", "jwk"] | Omit = omit, usages: List[Literal["encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey"]] - | NotGiven = NOT_GIVEN, - key_base64: str | NotGiven = NOT_GIVEN, - key_jwk: object | NotGiven = NOT_GIVEN, + | Omit = omit, + key_base64: str | Omit = omit, + key_jwk: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretUpdateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -226,7 +230,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SecretListResponse]: """ List secrets bound to a script uploaded to a Workers for Platforms namespace. @@ -268,12 +272,13 @@ def delete( account_id: str, dispatch_namespace: str, script_name: str, + url_encoded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Remove a secret from a script uploaded to a Workers for Platforms namespace. @@ -287,6 +292,8 @@ def delete( secret_name: A JavaScript variable name for the secret binding. + url_encoded: Flag that indicates whether the secret name is URL encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -310,6 +317,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform({"url_encoded": url_encoded}, secret_delete_params.SecretDeleteParams), post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), @@ -322,12 +330,13 @@ def get( account_id: str, dispatch_namespace: str, script_name: str, + url_encoded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretGetResponse: """ Get a given secret binding (value omitted) on a script uploaded to a Workers for @@ -342,6 +351,8 @@ def get( secret_name: A JavaScript variable name for the secret binding. + url_encoded: Flag that indicates whether the secret name is URL encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -367,6 +378,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform({"url_encoded": url_encoded}, secret_get_params.SecretGetParams), post_parser=ResultWrapper[SecretGetResponse]._unwrapper, ), cast_to=cast( @@ -411,7 +423,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretUpdateResponse: """ Add a secret to a script uploaded to a Workers for Platforms namespace. @@ -453,14 +465,14 @@ async def update( usages: List[ Literal["encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey"] ], - key_base64: str | NotGiven = NOT_GIVEN, - key_jwk: object | NotGiven = NOT_GIVEN, + key_base64: str | Omit = omit, + key_jwk: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretUpdateResponse: """ Add a secret to a script uploaded to a Workers for Platforms namespace. @@ -512,20 +524,20 @@ async def update( account_id: str, dispatch_namespace: str, name: str, - text: str | NotGiven = NOT_GIVEN, + text: str | Omit = omit, type: Literal["secret_text"] | Literal["secret_key"], - algorithm: object | NotGiven = NOT_GIVEN, - format: Literal["raw", "pkcs8", "spki", "jwk"] | NotGiven = NOT_GIVEN, + algorithm: object | Omit = omit, + format: Literal["raw", "pkcs8", "spki", "jwk"] | Omit = omit, usages: List[Literal["encrypt", "decrypt", "sign", "verify", "deriveKey", "deriveBits", "wrapKey", "unwrapKey"]] - | NotGiven = NOT_GIVEN, - key_base64: str | NotGiven = NOT_GIVEN, - key_jwk: object | NotGiven = NOT_GIVEN, + | Omit = omit, + key_base64: str | Omit = omit, + key_jwk: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretUpdateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -574,7 +586,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SecretListResponse, AsyncSinglePage[SecretListResponse]]: """ List secrets bound to a script uploaded to a Workers for Platforms namespace. @@ -616,12 +628,13 @@ async def delete( account_id: str, dispatch_namespace: str, script_name: str, + url_encoded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Remove a secret from a script uploaded to a Workers for Platforms namespace. @@ -635,6 +648,8 @@ async def delete( secret_name: A JavaScript variable name for the secret binding. + url_encoded: Flag that indicates whether the secret name is URL encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -658,6 +673,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=await async_maybe_transform( + {"url_encoded": url_encoded}, secret_delete_params.SecretDeleteParams + ), post_parser=ResultWrapper[Optional[object]]._unwrapper, ), cast_to=cast(Type[object], ResultWrapper[object]), @@ -670,12 +688,13 @@ async def get( account_id: str, dispatch_namespace: str, script_name: str, + url_encoded: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretGetResponse: """ Get a given secret binding (value omitted) on a script uploaded to a Workers for @@ -690,6 +709,8 @@ async def get( secret_name: A JavaScript variable name for the secret binding. + url_encoded: Flag that indicates whether the secret name is URL encoded. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -715,6 +736,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=await async_maybe_transform({"url_encoded": url_encoded}, secret_get_params.SecretGetParams), post_parser=ResultWrapper[SecretGetResponse]._unwrapper, ), cast_to=cast( 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 40c07424412..ef6da967284 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 @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,13 +51,13 @@ def edit( *, account_id: str, dispatch_namespace: str, - settings: setting_edit_params.Settings | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: """ Patch script metadata, such as bindings. @@ -95,6 +95,7 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[Optional[SettingEditResponse]]._unwrapper, ), cast_to=cast(Type[Optional[SettingEditResponse]], ResultWrapper[SettingEditResponse]), @@ -111,7 +112,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingGetResponse]: """ Get script settings from a script uploaded to a Workers for Platforms namespace. @@ -176,13 +177,13 @@ async def edit( *, account_id: str, dispatch_namespace: str, - settings: setting_edit_params.Settings | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: """ Patch script metadata, such as bindings. @@ -220,6 +221,7 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + multipart_syntax="json", post_parser=ResultWrapper[Optional[SettingEditResponse]]._unwrapper, ), cast_to=cast(Type[Optional[SettingEditResponse]], ResultWrapper[SettingEditResponse]), @@ -236,7 +238,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingGetResponse]: """ Get script settings from a script uploaded to a Workers for Platforms 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 5b837a845bb..5675af48e62 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 @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource @@ -51,13 +51,13 @@ def update( *, account_id: str, dispatch_namespace: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[TagUpdateResponse]: """ Put script tags for a script uploaded to a Workers for Platforms namespace. @@ -69,7 +69,7 @@ def update( script_name: Name of the script, used in URLs and route configuration. - body: Tags to help you manage your Workers. + body: Tags associated with the Worker. extra_headers: Send extra headers @@ -88,7 +88,7 @@ def update( return self._get_api_list( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/tags", page=SyncSinglePage[TagUpdateResponse], - body=maybe_transform(body, List[str]), + body=maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -107,7 +107,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[TagListResponse]: """ Fetch tags from a script uploaded to a Workers for Platforms namespace. @@ -154,7 +154,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete script tag for a script uploaded to a Workers for Platforms namespace. @@ -166,8 +166,6 @@ def delete( script_name: Name of the script, used in URLs and route configuration. - tag: Tag to help you manage your Worker. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -223,13 +221,13 @@ def update( *, account_id: str, dispatch_namespace: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TagUpdateResponse, AsyncSinglePage[TagUpdateResponse]]: """ Put script tags for a script uploaded to a Workers for Platforms namespace. @@ -241,7 +239,7 @@ def update( script_name: Name of the script, used in URLs and route configuration. - body: Tags to help you manage your Workers. + body: Tags associated with the Worker. extra_headers: Send extra headers @@ -260,7 +258,7 @@ def update( return self._get_api_list( f"/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/tags", page=AsyncSinglePage[TagUpdateResponse], - body=maybe_transform(body, List[str]), + body=maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -279,7 +277,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TagListResponse, AsyncSinglePage[TagListResponse]]: """ Fetch tags from a script uploaded to a Workers for Platforms namespace. @@ -326,7 +324,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete script tag for a script uploaded to a Workers for Platforms namespace. @@ -338,8 +336,6 @@ async def delete( script_name: Name of the script, used in URLs and route configuration. - tag: Tag to help you manage your Worker. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/workflows/instances/events.py b/src/cloudflare/resources/workflows/instances/events.py index 297ff0d4efc..6c8885c538a 100644 --- a/src/cloudflare/resources/workflows/instances/events.py +++ b/src/cloudflare/resources/workflows/instances/events.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,13 +50,13 @@ def create( account_id: str, workflow_name: str, instance_id: str, - body: object | NotGiven = NOT_GIVEN, + body: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Send event to instance @@ -119,13 +119,13 @@ async def create( account_id: str, workflow_name: str, instance_id: str, - body: object | NotGiven = NOT_GIVEN, + body: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Send event to instance diff --git a/src/cloudflare/resources/workflows/instances/instances.py b/src/cloudflare/resources/workflows/instances/instances.py index 1ba9e5e73f3..ac05b590da3 100644 --- a/src/cloudflare/resources/workflows/instances/instances.py +++ b/src/cloudflare/resources/workflows/instances/instances.py @@ -24,7 +24,7 @@ StatusResourceWithStreamingResponse, AsyncStatusResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -79,14 +79,15 @@ def create( workflow_name: str, *, account_id: str, - instance_id: str | NotGiven = NOT_GIVEN, - params: object | NotGiven = NOT_GIVEN, + instance_id: str | Omit = omit, + instance_retention: object | Omit = omit, + params: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceCreateResponse: """ Create a new workflow instance @@ -109,6 +110,7 @@ def create( body=maybe_transform( { "instance_id": instance_id, + "instance_retention": instance_retention, "params": params, }, instance_create_params.InstanceCreateParams, @@ -128,29 +130,38 @@ def list( workflow_name: str, *, account_id: str, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + cursor: str | Omit = omit, + date_end: Union[str, datetime] | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, status: Literal[ "queued", "running", "paused", "errored", "terminated", "complete", "waitingForPause", "waiting" ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[InstanceListResponse]: """ List of workflow instances Args: + cursor: `page` and `cursor` are mutually exclusive, use one or the other. + date_end: Accepts ISO 8601 with no timezone offsets and in UTC. date_start: Accepts ISO 8601 with no timezone offsets and in UTC. + direction: should only be used when `cursor` is used, defines a new direction for the + cursor + + page: `page` and `cursor` are mutually exclusive, use one or the other. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -173,8 +184,10 @@ def list( timeout=timeout, query=maybe_transform( { + "cursor": cursor, "date_end": date_end, "date_start": date_start, + "direction": direction, "page": page, "per_page": per_page, "status": status, @@ -190,13 +203,13 @@ def bulk( workflow_name: str, *, account_id: str, - body: Iterable[instance_bulk_params.Body] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[InstanceBulkResponse]: """ Batch create new Workflow instances @@ -236,7 +249,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceGetResponse: """ Get logs and status from instance @@ -302,14 +315,15 @@ async def create( workflow_name: str, *, account_id: str, - instance_id: str | NotGiven = NOT_GIVEN, - params: object | NotGiven = NOT_GIVEN, + instance_id: str | Omit = omit, + instance_retention: object | Omit = omit, + params: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceCreateResponse: """ Create a new workflow instance @@ -332,6 +346,7 @@ async def create( body=await async_maybe_transform( { "instance_id": instance_id, + "instance_retention": instance_retention, "params": params, }, instance_create_params.InstanceCreateParams, @@ -351,29 +366,38 @@ def list( workflow_name: str, *, account_id: str, - date_end: Union[str, datetime] | NotGiven = NOT_GIVEN, - date_start: Union[str, datetime] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + cursor: str | Omit = omit, + date_end: Union[str, datetime] | Omit = omit, + date_start: Union[str, datetime] | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, status: Literal[ "queued", "running", "paused", "errored", "terminated", "complete", "waitingForPause", "waiting" ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[InstanceListResponse, AsyncV4PagePaginationArray[InstanceListResponse]]: """ List of workflow instances Args: + cursor: `page` and `cursor` are mutually exclusive, use one or the other. + date_end: Accepts ISO 8601 with no timezone offsets and in UTC. date_start: Accepts ISO 8601 with no timezone offsets and in UTC. + direction: should only be used when `cursor` is used, defines a new direction for the + cursor + + page: `page` and `cursor` are mutually exclusive, use one or the other. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -396,8 +420,10 @@ def list( timeout=timeout, query=maybe_transform( { + "cursor": cursor, "date_end": date_end, "date_start": date_start, + "direction": direction, "page": page, "per_page": per_page, "status": status, @@ -413,13 +439,13 @@ def bulk( workflow_name: str, *, account_id: str, - body: Iterable[instance_bulk_params.Body] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[InstanceBulkResponse, AsyncSinglePage[InstanceBulkResponse]]: """ Batch create new Workflow instances @@ -459,7 +485,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceGetResponse: """ Get logs and status from instance diff --git a/src/cloudflare/resources/workflows/instances/status.py b/src/cloudflare/resources/workflows/instances/status.py index 2d35e593106..1444fb8944f 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 NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -57,7 +57,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> StatusEditResponse: """ Change status of instance @@ -125,7 +125,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> StatusEditResponse: """ Change status of instance diff --git a/src/cloudflare/resources/workflows/versions.py b/src/cloudflare/resources/workflows/versions.py index d83930116af..6a965a68a7e 100644 --- a/src/cloudflare/resources/workflows/versions.py +++ b/src/cloudflare/resources/workflows/versions.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,14 +51,14 @@ def list( workflow_name: str, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[VersionListResponse]: """ List deployed Workflow versions @@ -106,7 +106,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ Get Workflow version details @@ -164,14 +164,14 @@ def list( workflow_name: str, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, + 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[VersionListResponse, AsyncV4PagePaginationArray[VersionListResponse]]: """ List deployed Workflow versions @@ -219,7 +219,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ Get Workflow version details diff --git a/src/cloudflare/resources/workflows/workflows.py b/src/cloudflare/resources/workflows/workflows.py index 7a15ccc5b01..8d7d5fba510 100644 --- a/src/cloudflare/resources/workflows/workflows.py +++ b/src/cloudflare/resources/workflows/workflows.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .versions import ( VersionsResource, @@ -84,7 +84,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkflowUpdateResponse: """ Create/modify Workflow @@ -125,15 +125,15 @@ def list( self, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + page: float | Omit = omit, + per_page: float | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[WorkflowListResponse]: """ List all Workflows @@ -181,7 +181,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkflowDeleteResponse: """Deletes a Workflow. @@ -223,7 +223,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkflowGetResponse: """ Get Workflow details @@ -294,7 +294,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkflowUpdateResponse: """ Create/modify Workflow @@ -335,15 +335,15 @@ def list( self, *, account_id: str, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + page: float | Omit = omit, + per_page: float | Omit = omit, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WorkflowListResponse, AsyncV4PagePaginationArray[WorkflowListResponse]]: """ List all Workflows @@ -391,7 +391,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkflowDeleteResponse: """Deletes a Workflow. @@ -433,7 +433,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkflowGetResponse: """ Get Workflow details diff --git a/src/cloudflare/resources/zaraz/config.py b/src/cloudflare/resources/zaraz/config.py index 42addd4d56c..5d1b304df81 100644 --- a/src/cloudflare/resources/zaraz/config.py +++ b/src/cloudflare/resources/zaraz/config.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,15 +55,15 @@ def update( triggers: Dict[str, config_update_params.Triggers], variables: Dict[str, config_update_params.Variables], zaraz_version: int, - analytics: config_update_params.Analytics | NotGiven = NOT_GIVEN, - consent: config_update_params.Consent | NotGiven = NOT_GIVEN, - history_change: bool | NotGiven = NOT_GIVEN, + analytics: config_update_params.Analytics | Omit = omit, + consent: config_update_params.Consent | Omit = omit, + history_change: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Updates Zaraz configuration for a zone. @@ -141,7 +141,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """Gets latest Zaraz configuration for a zone. @@ -206,15 +206,15 @@ async def update( triggers: Dict[str, config_update_params.Triggers], variables: Dict[str, config_update_params.Variables], zaraz_version: int, - analytics: config_update_params.Analytics | NotGiven = NOT_GIVEN, - consent: config_update_params.Consent | NotGiven = NOT_GIVEN, - history_change: bool | NotGiven = NOT_GIVEN, + analytics: config_update_params.Analytics | Omit = omit, + consent: config_update_params.Consent | Omit = omit, + history_change: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Updates Zaraz configuration for a zone. @@ -292,7 +292,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """Gets latest Zaraz configuration for a zone. diff --git a/src/cloudflare/resources/zaraz/default.py b/src/cloudflare/resources/zaraz/default.py index 8b7c78f14c7..3e800d50847 100644 --- a/src/cloudflare/resources/zaraz/default.py +++ b/src/cloudflare/resources/zaraz/default.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Gets default Zaraz configuration for a zone. @@ -111,7 +111,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Gets default Zaraz configuration for a zone. diff --git a/src/cloudflare/resources/zaraz/export.py b/src/cloudflare/resources/zaraz/export.py index 845c76fa341..22ecf15a791 100644 --- a/src/cloudflare/resources/zaraz/export.py +++ b/src/cloudflare/resources/zaraz/export.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -48,7 +48,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Exports full current published Zaraz configuration for a zone, secret variables @@ -105,7 +105,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Exports full current published Zaraz configuration for a zone, secret variables diff --git a/src/cloudflare/resources/zaraz/history/configs.py b/src/cloudflare/resources/zaraz/history/configs.py index 60f3ce479fb..665467abb7f 100644 --- a/src/cloudflare/resources/zaraz/history/configs.py +++ b/src/cloudflare/resources/zaraz/history/configs.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,7 +54,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigGetResponse: """ Gets a history of published Zaraz configurations by ID(s) for a zone. @@ -118,7 +118,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigGetResponse: """ Gets a history of published Zaraz configurations by ID(s) for a zone. diff --git a/src/cloudflare/resources/zaraz/history/history.py b/src/cloudflare/resources/zaraz/history/history.py index e89f681b1c0..3e92f22636b 100644 --- a/src/cloudflare/resources/zaraz/history/history.py +++ b/src/cloudflare/resources/zaraz/history/history.py @@ -15,7 +15,7 @@ ConfigsResourceWithStreamingResponse, AsyncConfigsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -69,7 +69,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Restores a historical published Zaraz configuration by ID for a zone. @@ -106,16 +106,16 @@ def list( self, *, zone_id: str, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - sort_field: Literal["id", "user_id", "description", "created_at", "updated_at"] | NotGiven = NOT_GIVEN, - sort_order: Literal["DESC", "ASC"] | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, + sort_field: Literal["id", "user_id", "description", "created_at", "updated_at"] | Omit = omit, + sort_order: Literal["DESC", "ASC"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[HistoryListResponse]: """ Lists a history of published Zaraz configuration records for a zone. @@ -197,7 +197,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ Restores a historical published Zaraz configuration by ID for a zone. @@ -234,16 +234,16 @@ def list( self, *, zone_id: str, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - sort_field: Literal["id", "user_id", "description", "created_at", "updated_at"] | NotGiven = NOT_GIVEN, - sort_order: Literal["DESC", "ASC"] | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, + sort_field: Literal["id", "user_id", "description", "created_at", "updated_at"] | Omit = omit, + sort_order: Literal["DESC", "ASC"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[HistoryListResponse, AsyncSinglePage[HistoryListResponse]]: """ Lists a history of published Zaraz configuration records for a zone. diff --git a/src/cloudflare/resources/zaraz/publish.py b/src/cloudflare/resources/zaraz/publish.py index 7386f15a91d..5c3e4db9d5f 100644 --- a/src/cloudflare/resources/zaraz/publish.py +++ b/src/cloudflare/resources/zaraz/publish.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,13 +48,13 @@ def create( self, *, zone_id: str, - body: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Publish current Zaraz preview configuration for a zone. @@ -112,13 +112,13 @@ async def create( self, *, zone_id: str, - body: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Publish current Zaraz preview configuration for a zone. diff --git a/src/cloudflare/resources/zaraz/workflow.py b/src/cloudflare/resources/zaraz/workflow.py index d9cfb22f000..0497a24bea6 100644 --- a/src/cloudflare/resources/zaraz/workflow.py +++ b/src/cloudflare/resources/zaraz/workflow.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Workflow: """ Gets Zaraz workflow for a zone. @@ -113,7 +113,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Workflow: """ Gets Zaraz workflow for a zone. diff --git a/src/cloudflare/resources/zaraz/zaraz.py b/src/cloudflare/resources/zaraz/zaraz.py index ee4084fccfb..c49c4e4c179 100644 --- a/src/cloudflare/resources/zaraz/zaraz.py +++ b/src/cloudflare/resources/zaraz/zaraz.py @@ -38,7 +38,7 @@ PublishResourceWithStreamingResponse, AsyncPublishResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform, async_maybe_transform from .workflow import ( WorkflowResource, @@ -126,7 +126,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Workflow: """ Updates Zaraz workflow for a zone. @@ -216,7 +216,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Workflow: """ Updates Zaraz workflow for a zone. diff --git a/src/cloudflare/resources/zero_trust/__init__.py b/src/cloudflare/resources/zero_trust/__init__.py index 7703df18c9b..172a32a7dca 100644 --- a/src/cloudflare/resources/zero_trust/__init__.py +++ b/src/cloudflare/resources/zero_trust/__init__.py @@ -72,6 +72,14 @@ ZeroTrustResourceWithStreamingResponse, AsyncZeroTrustResourceWithStreamingResponse, ) +from .connectivity import ( + ConnectivityResource, + AsyncConnectivityResource, + ConnectivityResourceWithRawResponse, + AsyncConnectivityResourceWithRawResponse, + ConnectivityResourceWithStreamingResponse, + AsyncConnectivityResourceWithStreamingResponse, +) from .risk_scoring import ( RiskScoringResource, AsyncRiskScoringResource, @@ -154,6 +162,12 @@ "AsyncConnectivitySettingsResourceWithRawResponse", "ConnectivitySettingsResourceWithStreamingResponse", "AsyncConnectivitySettingsResourceWithStreamingResponse", + "ConnectivityResource", + "AsyncConnectivityResource", + "ConnectivityResourceWithRawResponse", + "AsyncConnectivityResourceWithRawResponse", + "ConnectivityResourceWithStreamingResponse", + "AsyncConnectivityResourceWithStreamingResponse", "DLPResource", "AsyncDLPResource", "DLPResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/access/applications/applications.py b/src/cloudflare/resources/zero_trust/access/applications/applications.py index a9f48d3a14c..2a7fe485920 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/applications.py +++ b/src/cloudflare/resources/zero_trust/access/applications/applications.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Type, Iterable, Optional, cast +from typing import Any, Type, Iterable, Optional, cast from typing_extensions import Literal, overload import httpx @@ -31,7 +31,7 @@ SettingsResourceWithStreamingResponse, AsyncSettingsResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -42,7 +42,7 @@ async_to_streamed_response_wrapper, ) from ....._wrappers import ResultWrapper -from .....pagination import SyncSinglePage, AsyncSinglePage +from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ....._base_client import AsyncPaginator, make_request_options from .user_policy_checks import ( UserPolicyChecksResource, @@ -127,40 +127,40 @@ def create( *, domain: str, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_create_params.SelfHostedApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_create_params.SelfHostedApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.SelfHostedApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.SelfHostedApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.SelfHostedApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.SelfHostedApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -268,25 +268,25 @@ def create( def create( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policies: List[application_create_params.SaaSApplicationPolicy] | NotGiven = NOT_GIVEN, - saas_app: application_create_params.SaaSApplicationSaaSApp | NotGiven = NOT_GIVEN, - scim_config: application_create_params.SaaSApplicationSCIMConfig | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, + 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, + custom_pages: SequenceNotStr[str] | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + policies: SequenceNotStr[application_create_params.SaaSApplicationPolicy] | Omit = omit, + saas_app: application_create_params.SaaSApplicationSaaSApp | Omit = omit, + scim_config: application_create_params.SaaSApplicationSCIMConfig | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + type: ApplicationType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -349,41 +349,43 @@ def create( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_create_params.BrowserSSHApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_create_params.BrowserSSHApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.BrowserSSHApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.BrowserSSHApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.BrowserSSHApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.BrowserSSHApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -504,41 +506,43 @@ def create( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_create_params.BrowserVNCApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_create_params.BrowserVNCApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.BrowserVNCApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.BrowserVNCApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.BrowserVNCApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.BrowserVNCApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -658,26 +662,30 @@ def create( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_create_params.AppLauncherApplicationFooterLink] | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_create_params.AppLauncherApplicationLandingPageDesign | NotGiven = NOT_GIVEN, - policies: List[application_create_params.AppLauncherApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_create_params.AppLauncherApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + bg_color: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + footer_links: Iterable[application_create_params.AppLauncherApplicationFooterLink] | Omit = omit, + header_bg_color: str | Omit = omit, + landing_page_design: application_create_params.AppLauncherApplicationLandingPageDesign | Omit = omit, + policies: SequenceNotStr[application_create_params.AppLauncherApplicationPolicy] | Omit = omit, + session_duration: str | Omit = omit, + skip_app_launcher_login_page: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -699,6 +707,14 @@ def create( bg_color: The background color of the App Launcher page. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + footer_links: The links in the App Launcher footer. header_bg_color: The background color of the App Launcher header. @@ -709,9 +725,6 @@ def create( precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. @@ -733,27 +746,21 @@ def create( self, *, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_create_params.DeviceEnrollmentPermissionsApplicationFooterLink] - | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_create_params.DeviceEnrollmentPermissionsApplicationLandingPageDesign - | NotGiven = NOT_GIVEN, - policies: List[application_create_params.DeviceEnrollmentPermissionsApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_create_params.DeviceEnrollmentPermissionsApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + policies: SequenceNotStr[application_create_params.DeviceEnrollmentPermissionsApplicationPolicy] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -768,32 +775,25 @@ def create( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. - app_launcher_logo_url: The image URL of the logo shown in the App Launcher header. - auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. - bg_color: The background color of the App Launcher page. - - footer_links: The links in the App Launcher footer. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. - header_bg_color: The background color of the App Launcher header. + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. - landing_page_design: The design of the App Launcher landing page shown to users when they log in. + custom_pages: The custom pages that will be displayed when applicable for this application policies: The policies that Access applies to the application, in ascending order of precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. - skip_app_launcher_login_page: Determines when to skip the App Launcher landing page. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -809,27 +809,21 @@ def create( self, *, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_create_params.BrowserIsolationPermissionsApplicationFooterLink] - | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_create_params.BrowserIsolationPermissionsApplicationLandingPageDesign - | NotGiven = NOT_GIVEN, - policies: List[application_create_params.BrowserIsolationPermissionsApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_create_params.BrowserIsolationPermissionsApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + policies: SequenceNotStr[application_create_params.BrowserIsolationPermissionsApplicationPolicy] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -844,32 +838,25 @@ def create( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. - app_launcher_logo_url: The image URL of the logo shown in the App Launcher header. - auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. - bg_color: The background color of the App Launcher page. - - footer_links: The links in the App Launcher footer. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. - header_bg_color: The background color of the App Launcher header. + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. - landing_page_design: The design of the App Launcher landing page shown to users when they log in. + custom_pages: The custom pages that will be displayed when applicable for this application policies: The policies that Access applies to the application, in ascending order of precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. - skip_app_launcher_login_page: Determines when to skip the App Launcher landing page. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -884,21 +871,20 @@ def create( def create( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - domain: str | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.BookmarkApplicationSCIMConfig | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, + 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, + name: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + type: ApplicationType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -916,9 +902,6 @@ def create( name: The name of the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. @@ -940,16 +923,16 @@ def create( *, target_criteria: Iterable[application_create_params.InfrastructureApplicationTargetCriterion], type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policies: Iterable[application_create_params.InfrastructureApplicationPolicy] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -982,40 +965,40 @@ def create( domain: str, target_criteria: Iterable[application_create_params.BrowserRdpApplicationTargetCriterion], type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_create_params.BrowserRdpApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_create_params.BrowserRdpApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.BrowserRdpApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.BrowserRdpApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.BrowserRdpApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -1122,53 +1105,86 @@ def create( def create( self, *, - domain: str | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_create_params.SelfHostedApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_create_params.SelfHostedApplicationPolicy] + domain: str | Omit = omit, + type: ApplicationType + | Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + "mcp", + "mcp_portal", + ] + | Omit = omit, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.SelfHostedApplicationDestination] + | Iterable[application_create_params.BrowserSSHApplicationDestination] + | Iterable[application_create_params.BrowserVNCApplicationDestination] + | Iterable[application_create_params.BrowserRdpApplicationDestination] + | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.SelfHostedApplicationPolicy] + | SequenceNotStr[application_create_params.SaaSApplicationPolicy] + | SequenceNotStr[application_create_params.BrowserSSHApplicationPolicy] + | SequenceNotStr[application_create_params.BrowserVNCApplicationPolicy] + | SequenceNotStr[application_create_params.AppLauncherApplicationPolicy] + | SequenceNotStr[application_create_params.DeviceEnrollmentPermissionsApplicationPolicy] + | SequenceNotStr[application_create_params.BrowserIsolationPermissionsApplicationPolicy] | Iterable[application_create_params.InfrastructureApplicationPolicy] - | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.SelfHostedApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - saas_app: application_create_params.SaaSApplicationSaaSApp | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_create_params.AppLauncherApplicationFooterLink] | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_create_params.AppLauncherApplicationLandingPageDesign | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + | SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] + | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.SelfHostedApplicationSCIMConfig + | application_create_params.SaaSApplicationSCIMConfig + | application_create_params.BrowserSSHApplicationSCIMConfig + | application_create_params.BrowserVNCApplicationSCIMConfig + | application_create_params.BrowserRdpApplicationSCIMConfig + | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + saas_app: application_create_params.SaaSApplicationSaaSApp | Omit = omit, + app_launcher_logo_url: str | Omit = omit, + bg_color: str | Omit = omit, + footer_links: Iterable[application_create_params.AppLauncherApplicationFooterLink] | Omit = omit, + header_bg_color: str | Omit = omit, + landing_page_design: application_create_params.AppLauncherApplicationLandingPageDesign | Omit = omit, + skip_app_launcher_login_page: bool | Omit = omit, target_criteria: Iterable[application_create_params.InfrastructureApplicationTargetCriterion] - | NotGiven = NOT_GIVEN, + | Iterable[application_create_params.BrowserRdpApplicationTargetCriterion] + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -1247,40 +1263,40 @@ def update( *, domain: str, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_update_params.SelfHostedApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_update_params.SelfHostedApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.SelfHostedApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.SelfHostedApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.SelfHostedApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.SelfHostedApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -1391,25 +1407,25 @@ def update( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policies: List[application_update_params.SaaSApplicationPolicy] | NotGiven = NOT_GIVEN, - saas_app: application_update_params.SaaSApplicationSaaSApp | NotGiven = NOT_GIVEN, - scim_config: application_update_params.SaaSApplicationSCIMConfig | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, + 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, + custom_pages: SequenceNotStr[str] | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + policies: SequenceNotStr[application_update_params.SaaSApplicationPolicy] | Omit = omit, + saas_app: application_update_params.SaaSApplicationSaaSApp | Omit = omit, + scim_config: application_update_params.SaaSApplicationSCIMConfig | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + type: ApplicationType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -1475,41 +1491,43 @@ def update( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_update_params.BrowserSSHApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_update_params.BrowserSSHApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.BrowserSSHApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.BrowserSSHApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.BrowserSSHApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.BrowserSSHApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -1633,41 +1651,43 @@ def update( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_update_params.BrowserVNCApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_update_params.BrowserVNCApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.BrowserVNCApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.BrowserVNCApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.BrowserVNCApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.BrowserVNCApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -1790,26 +1810,30 @@ def update( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_update_params.AppLauncherApplicationFooterLink] | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_update_params.AppLauncherApplicationLandingPageDesign | NotGiven = NOT_GIVEN, - policies: List[application_update_params.AppLauncherApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_update_params.AppLauncherApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + bg_color: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + footer_links: Iterable[application_update_params.AppLauncherApplicationFooterLink] | Omit = omit, + header_bg_color: str | Omit = omit, + landing_page_design: application_update_params.AppLauncherApplicationLandingPageDesign | Omit = omit, + policies: SequenceNotStr[application_update_params.AppLauncherApplicationPolicy] | Omit = omit, + session_duration: str | Omit = omit, + skip_app_launcher_login_page: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -1833,6 +1857,14 @@ def update( bg_color: The background color of the App Launcher page. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + footer_links: The links in the App Launcher footer. header_bg_color: The background color of the App Launcher header. @@ -1843,9 +1875,6 @@ def update( precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. @@ -1868,27 +1897,21 @@ def update( app_id: AppID, *, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_update_params.DeviceEnrollmentPermissionsApplicationFooterLink] - | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_update_params.DeviceEnrollmentPermissionsApplicationLandingPageDesign - | NotGiven = NOT_GIVEN, - policies: List[application_update_params.DeviceEnrollmentPermissionsApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_update_params.DeviceEnrollmentPermissionsApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + policies: SequenceNotStr[application_update_params.DeviceEnrollmentPermissionsApplicationPolicy] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -1905,32 +1928,25 @@ def update( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. - app_launcher_logo_url: The image URL of the logo shown in the App Launcher header. - auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. - bg_color: The background color of the App Launcher page. - - footer_links: The links in the App Launcher footer. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. - header_bg_color: The background color of the App Launcher header. + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. - landing_page_design: The design of the App Launcher landing page shown to users when they log in. + custom_pages: The custom pages that will be displayed when applicable for this application policies: The policies that Access applies to the application, in ascending order of precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. - skip_app_launcher_login_page: Determines when to skip the App Launcher landing page. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1947,27 +1963,21 @@ def update( app_id: AppID, *, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_update_params.BrowserIsolationPermissionsApplicationFooterLink] - | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_update_params.BrowserIsolationPermissionsApplicationLandingPageDesign - | NotGiven = NOT_GIVEN, - policies: List[application_update_params.BrowserIsolationPermissionsApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_update_params.BrowserIsolationPermissionsApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + policies: SequenceNotStr[application_update_params.BrowserIsolationPermissionsApplicationPolicy] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -1984,32 +1994,25 @@ def update( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. - app_launcher_logo_url: The image URL of the logo shown in the App Launcher header. - auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. - bg_color: The background color of the App Launcher page. - - footer_links: The links in the App Launcher footer. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. - header_bg_color: The background color of the App Launcher header. + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. - landing_page_design: The design of the App Launcher landing page shown to users when they log in. + custom_pages: The custom pages that will be displayed when applicable for this application policies: The policies that Access applies to the application, in ascending order of precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. - skip_app_launcher_login_page: Determines when to skip the App Launcher landing page. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2025,21 +2028,20 @@ def update( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - domain: str | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.BookmarkApplicationSCIMConfig | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, + 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, + name: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + type: ApplicationType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -2059,9 +2061,6 @@ def update( name: The name of the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. @@ -2084,16 +2083,16 @@ def update( *, target_criteria: Iterable[application_update_params.InfrastructureApplicationTargetCriterion], type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policies: Iterable[application_update_params.InfrastructureApplicationPolicy] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -2129,40 +2128,40 @@ def update( domain: str, target_criteria: Iterable[application_update_params.BrowserRdpApplicationTargetCriterion], type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_update_params.BrowserRdpApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_update_params.BrowserRdpApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.BrowserRdpApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.BrowserRdpApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.BrowserRdpApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -2272,53 +2271,86 @@ def update( self, app_id: AppID, *, - domain: str | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_update_params.SelfHostedApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_update_params.SelfHostedApplicationPolicy] + domain: str | Omit = omit, + type: ApplicationType + | Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + "mcp", + "mcp_portal", + ] + | Omit = omit, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.SelfHostedApplicationDestination] + | Iterable[application_update_params.BrowserSSHApplicationDestination] + | Iterable[application_update_params.BrowserVNCApplicationDestination] + | Iterable[application_update_params.BrowserRdpApplicationDestination] + | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.SelfHostedApplicationPolicy] + | SequenceNotStr[application_update_params.SaaSApplicationPolicy] + | SequenceNotStr[application_update_params.BrowserSSHApplicationPolicy] + | SequenceNotStr[application_update_params.BrowserVNCApplicationPolicy] + | SequenceNotStr[application_update_params.AppLauncherApplicationPolicy] + | SequenceNotStr[application_update_params.DeviceEnrollmentPermissionsApplicationPolicy] + | SequenceNotStr[application_update_params.BrowserIsolationPermissionsApplicationPolicy] | Iterable[application_update_params.InfrastructureApplicationPolicy] - | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.SelfHostedApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - saas_app: application_update_params.SaaSApplicationSaaSApp | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_update_params.AppLauncherApplicationFooterLink] | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_update_params.AppLauncherApplicationLandingPageDesign | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + | SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] + | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.SelfHostedApplicationSCIMConfig + | application_update_params.SaaSApplicationSCIMConfig + | application_update_params.BrowserSSHApplicationSCIMConfig + | application_update_params.BrowserVNCApplicationSCIMConfig + | application_update_params.BrowserRdpApplicationSCIMConfig + | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + saas_app: application_update_params.SaaSApplicationSaaSApp | Omit = omit, + app_launcher_logo_url: str | Omit = omit, + bg_color: str | Omit = omit, + footer_links: Iterable[application_update_params.AppLauncherApplicationFooterLink] | Omit = omit, + header_bg_color: str | Omit = omit, + landing_page_design: application_update_params.AppLauncherApplicationLandingPageDesign | Omit = omit, + skip_app_launcher_login_page: bool | Omit = omit, target_criteria: Iterable[application_update_params.InfrastructureApplicationTargetCriterion] - | NotGiven = NOT_GIVEN, + | Iterable[application_update_params.BrowserRdpApplicationTargetCriterion] + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") @@ -2395,19 +2427,23 @@ def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - aud: str | NotGiven = NOT_GIVEN, - domain: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + aud: str | Omit = omit, + domain: str | Omit = omit, + exact: bool | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: str | Omit = omit, + target_attributes: 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, - ) -> SyncSinglePage[ApplicationListResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[ApplicationListResponse]: """ Lists all Access applications in an account or zone. @@ -2420,10 +2456,18 @@ def list( domain: The domain of the app. + exact: True for only exact string matches against passed name/domain query parameters. + name: The name of the app. + page: Page number of results. + + per_page: Number of results per page. + search: Search for apps by other listed query parameters. + target_attributes: Target Criteria attributes in key=value format. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2446,7 +2490,7 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/apps", - page=SyncSinglePage[ApplicationListResponse], + page=SyncV4PagePaginationArray[ApplicationListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2456,8 +2500,12 @@ def list( { "aud": aud, "domain": domain, + "exact": exact, "name": name, + "page": page, + "per_page": per_page, "search": search, + "target_attributes": target_attributes, }, application_list_params.ApplicationListParams, ), @@ -2469,14 +2517,14 @@ def delete( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationDeleteResponse]: """ Deletes an application from Access. @@ -2526,14 +2574,14 @@ def get( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationGetResponse]: """ Fetches information about an Access application. @@ -2588,14 +2636,14 @@ def revoke_tokens( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Revokes all tokens issued for an application. @@ -2688,40 +2736,40 @@ async def create( *, domain: str, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_create_params.SelfHostedApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_create_params.SelfHostedApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.SelfHostedApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.SelfHostedApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.SelfHostedApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.SelfHostedApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -2829,25 +2877,25 @@ async def create( async def create( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policies: List[application_create_params.SaaSApplicationPolicy] | NotGiven = NOT_GIVEN, - saas_app: application_create_params.SaaSApplicationSaaSApp | NotGiven = NOT_GIVEN, - scim_config: application_create_params.SaaSApplicationSCIMConfig | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, + 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, + custom_pages: SequenceNotStr[str] | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + policies: SequenceNotStr[application_create_params.SaaSApplicationPolicy] | Omit = omit, + saas_app: application_create_params.SaaSApplicationSaaSApp | Omit = omit, + scim_config: application_create_params.SaaSApplicationSCIMConfig | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + type: ApplicationType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -2910,41 +2958,43 @@ async def create( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_create_params.BrowserSSHApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_create_params.BrowserSSHApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.BrowserSSHApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.BrowserSSHApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.BrowserSSHApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.BrowserSSHApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -3065,41 +3115,43 @@ async def create( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_create_params.BrowserVNCApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_create_params.BrowserVNCApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.BrowserVNCApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.BrowserVNCApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.BrowserVNCApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.BrowserVNCApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -3219,26 +3271,30 @@ async def create( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_create_params.AppLauncherApplicationFooterLink] | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_create_params.AppLauncherApplicationLandingPageDesign | NotGiven = NOT_GIVEN, - policies: List[application_create_params.AppLauncherApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_create_params.AppLauncherApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + bg_color: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + footer_links: Iterable[application_create_params.AppLauncherApplicationFooterLink] | Omit = omit, + header_bg_color: str | Omit = omit, + landing_page_design: application_create_params.AppLauncherApplicationLandingPageDesign | Omit = omit, + policies: SequenceNotStr[application_create_params.AppLauncherApplicationPolicy] | Omit = omit, + session_duration: str | Omit = omit, + skip_app_launcher_login_page: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -3260,6 +3316,14 @@ async def create( bg_color: The background color of the App Launcher page. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + footer_links: The links in the App Launcher footer. header_bg_color: The background color of the App Launcher header. @@ -3270,9 +3334,6 @@ async def create( precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. @@ -3294,27 +3355,21 @@ async def create( self, *, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_create_params.DeviceEnrollmentPermissionsApplicationFooterLink] - | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_create_params.DeviceEnrollmentPermissionsApplicationLandingPageDesign - | NotGiven = NOT_GIVEN, - policies: List[application_create_params.DeviceEnrollmentPermissionsApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_create_params.DeviceEnrollmentPermissionsApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + policies: SequenceNotStr[application_create_params.DeviceEnrollmentPermissionsApplicationPolicy] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -3329,32 +3384,25 @@ async def create( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. - app_launcher_logo_url: The image URL of the logo shown in the App Launcher header. - auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. - bg_color: The background color of the App Launcher page. - - footer_links: The links in the App Launcher footer. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. - header_bg_color: The background color of the App Launcher header. + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. - landing_page_design: The design of the App Launcher landing page shown to users when they log in. + custom_pages: The custom pages that will be displayed when applicable for this application policies: The policies that Access applies to the application, in ascending order of precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. - skip_app_launcher_login_page: Determines when to skip the App Launcher landing page. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3370,27 +3418,21 @@ async def create( self, *, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_create_params.BrowserIsolationPermissionsApplicationFooterLink] - | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_create_params.BrowserIsolationPermissionsApplicationLandingPageDesign - | NotGiven = NOT_GIVEN, - policies: List[application_create_params.BrowserIsolationPermissionsApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_create_params.BrowserIsolationPermissionsApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + policies: SequenceNotStr[application_create_params.BrowserIsolationPermissionsApplicationPolicy] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -3405,32 +3447,25 @@ async def create( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. - app_launcher_logo_url: The image URL of the logo shown in the App Launcher header. - auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. - bg_color: The background color of the App Launcher page. - - footer_links: The links in the App Launcher footer. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. - header_bg_color: The background color of the App Launcher header. + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. - landing_page_design: The design of the App Launcher landing page shown to users when they log in. + custom_pages: The custom pages that will be displayed when applicable for this application policies: The policies that Access applies to the application, in ascending order of precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. - skip_app_launcher_login_page: Determines when to skip the App Launcher landing page. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3445,21 +3480,20 @@ async def create( async def create( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - domain: str | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.BookmarkApplicationSCIMConfig | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, + 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, + name: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + type: ApplicationType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -3477,9 +3511,6 @@ async def create( name: The name of the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. @@ -3501,16 +3532,16 @@ async def create( *, target_criteria: Iterable[application_create_params.InfrastructureApplicationTargetCriterion], type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policies: Iterable[application_create_params.InfrastructureApplicationPolicy] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -3543,40 +3574,40 @@ async def create( domain: str, target_criteria: Iterable[application_create_params.BrowserRdpApplicationTargetCriterion], type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_create_params.BrowserRdpApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_create_params.BrowserRdpApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.BrowserRdpApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.BrowserRdpApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.BrowserRdpApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: """ Adds a new application to Access. @@ -3683,53 +3714,86 @@ async def create( async def create( self, *, - domain: str | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_create_params.SelfHostedApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_create_params.SelfHostedApplicationPolicy] + domain: str | Omit = omit, + type: ApplicationType + | Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + "mcp", + "mcp_portal", + ] + | Omit = omit, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.SelfHostedApplicationDestination] + | Iterable[application_create_params.BrowserSSHApplicationDestination] + | Iterable[application_create_params.BrowserVNCApplicationDestination] + | Iterable[application_create_params.BrowserRdpApplicationDestination] + | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.SelfHostedApplicationPolicy] + | SequenceNotStr[application_create_params.SaaSApplicationPolicy] + | SequenceNotStr[application_create_params.BrowserSSHApplicationPolicy] + | SequenceNotStr[application_create_params.BrowserVNCApplicationPolicy] + | SequenceNotStr[application_create_params.AppLauncherApplicationPolicy] + | SequenceNotStr[application_create_params.DeviceEnrollmentPermissionsApplicationPolicy] + | SequenceNotStr[application_create_params.BrowserIsolationPermissionsApplicationPolicy] | Iterable[application_create_params.InfrastructureApplicationPolicy] - | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_create_params.SelfHostedApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - saas_app: application_create_params.SaaSApplicationSaaSApp | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_create_params.AppLauncherApplicationFooterLink] | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_create_params.AppLauncherApplicationLandingPageDesign | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + | SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] + | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.SelfHostedApplicationSCIMConfig + | application_create_params.SaaSApplicationSCIMConfig + | application_create_params.BrowserSSHApplicationSCIMConfig + | application_create_params.BrowserVNCApplicationSCIMConfig + | application_create_params.BrowserRdpApplicationSCIMConfig + | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + saas_app: application_create_params.SaaSApplicationSaaSApp | Omit = omit, + app_launcher_logo_url: str | Omit = omit, + bg_color: str | Omit = omit, + footer_links: Iterable[application_create_params.AppLauncherApplicationFooterLink] | Omit = omit, + header_bg_color: str | Omit = omit, + landing_page_design: application_create_params.AppLauncherApplicationLandingPageDesign | Omit = omit, + skip_app_launcher_login_page: bool | Omit = omit, target_criteria: Iterable[application_create_params.InfrastructureApplicationTargetCriterion] - | NotGiven = NOT_GIVEN, + | Iterable[application_create_params.BrowserRdpApplicationTargetCriterion] + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -3808,40 +3872,40 @@ async def update( *, domain: str, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_update_params.SelfHostedApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_update_params.SelfHostedApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.SelfHostedApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.SelfHostedApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.SelfHostedApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.SelfHostedApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -3952,25 +4016,25 @@ async def update( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policies: List[application_update_params.SaaSApplicationPolicy] | NotGiven = NOT_GIVEN, - saas_app: application_update_params.SaaSApplicationSaaSApp | NotGiven = NOT_GIVEN, - scim_config: application_update_params.SaaSApplicationSCIMConfig | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, + 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, + custom_pages: SequenceNotStr[str] | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + policies: SequenceNotStr[application_update_params.SaaSApplicationPolicy] | Omit = omit, + saas_app: application_update_params.SaaSApplicationSaaSApp | Omit = omit, + scim_config: application_update_params.SaaSApplicationSCIMConfig | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + type: ApplicationType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -4036,41 +4100,43 @@ async def update( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_update_params.BrowserSSHApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_update_params.BrowserSSHApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.BrowserSSHApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.BrowserSSHApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.BrowserSSHApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.BrowserSSHApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -4194,41 +4260,43 @@ async def update( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_update_params.BrowserVNCApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_update_params.BrowserVNCApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.BrowserVNCApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.BrowserVNCApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.BrowserVNCApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.BrowserVNCApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -4351,26 +4419,30 @@ async def update( "dash_sso", "infrastructure", "rdp", + "mcp", + "mcp_portal", ], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_update_params.AppLauncherApplicationFooterLink] | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_update_params.AppLauncherApplicationLandingPageDesign | NotGiven = NOT_GIVEN, - policies: List[application_update_params.AppLauncherApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_update_params.AppLauncherApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + bg_color: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + footer_links: Iterable[application_update_params.AppLauncherApplicationFooterLink] | Omit = omit, + header_bg_color: str | Omit = omit, + landing_page_design: application_update_params.AppLauncherApplicationLandingPageDesign | Omit = omit, + policies: SequenceNotStr[application_update_params.AppLauncherApplicationPolicy] | Omit = omit, + session_duration: str | Omit = omit, + skip_app_launcher_login_page: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -4394,6 +4466,14 @@ async def update( bg_color: The background color of the App Launcher page. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + footer_links: The links in the App Launcher footer. header_bg_color: The background color of the App Launcher header. @@ -4404,9 +4484,6 @@ async def update( precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. @@ -4429,27 +4506,21 @@ async def update( app_id: AppID, *, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_update_params.DeviceEnrollmentPermissionsApplicationFooterLink] - | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_update_params.DeviceEnrollmentPermissionsApplicationLandingPageDesign - | NotGiven = NOT_GIVEN, - policies: List[application_update_params.DeviceEnrollmentPermissionsApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_update_params.DeviceEnrollmentPermissionsApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + policies: SequenceNotStr[application_update_params.DeviceEnrollmentPermissionsApplicationPolicy] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -4466,32 +4537,25 @@ async def update( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. - app_launcher_logo_url: The image URL of the logo shown in the App Launcher header. - auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. - bg_color: The background color of the App Launcher page. - - footer_links: The links in the App Launcher footer. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. - header_bg_color: The background color of the App Launcher header. + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. - landing_page_design: The design of the App Launcher landing page shown to users when they log in. + custom_pages: The custom pages that will be displayed when applicable for this application policies: The policies that Access applies to the application, in ascending order of precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. - skip_app_launcher_login_page: Determines when to skip the App Launcher landing page. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4508,27 +4572,21 @@ async def update( app_id: AppID, *, type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_update_params.BrowserIsolationPermissionsApplicationFooterLink] - | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_update_params.BrowserIsolationPermissionsApplicationLandingPageDesign - | NotGiven = NOT_GIVEN, - policies: List[application_update_params.BrowserIsolationPermissionsApplicationPolicy] | NotGiven = NOT_GIVEN, - scim_config: application_update_params.BrowserIsolationPermissionsApplicationSCIMConfig | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + 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, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + policies: SequenceNotStr[application_update_params.BrowserIsolationPermissionsApplicationPolicy] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -4545,32 +4603,25 @@ async def update( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. - app_launcher_logo_url: The image URL of the logo shown in the App Launcher header. - auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. - bg_color: The background color of the App Launcher page. - - footer_links: The links in the App Launcher footer. + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. - header_bg_color: The background color of the App Launcher header. + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. - landing_page_design: The design of the App Launcher landing page shown to users when they log in. + custom_pages: The custom pages that will be displayed when applicable for this application policies: The policies that Access applies to the application, in ascending order of precedence. Items can reference existing policies or create new policies exclusive to the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - session_duration: The amount of time that tokens issued for this application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. - skip_app_launcher_login_page: Determines when to skip the App Launcher landing page. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -4586,21 +4637,20 @@ async def update( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - domain: str | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.BookmarkApplicationSCIMConfig | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, + 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, + name: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + type: ApplicationType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -4620,9 +4670,6 @@ async def update( name: The name of the application. - scim_config: Configuration for provisioning to this application via SCIM. This is currently - in closed beta. - tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. @@ -4645,16 +4692,16 @@ async def update( *, target_criteria: Iterable[application_update_params.InfrastructureApplicationTargetCriterion], type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - policies: Iterable[application_update_params.InfrastructureApplicationPolicy] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -4690,40 +4737,40 @@ async def update( domain: str, target_criteria: Iterable[application_update_params.BrowserRdpApplicationTargetCriterion], type: ApplicationType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_update_params.BrowserRdpApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_update_params.BrowserRdpApplicationPolicy] | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.BrowserRdpApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.BrowserRdpApplicationDestination] | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.BrowserRdpApplicationSCIMConfig | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: """ Updates an Access application. @@ -4833,53 +4880,86 @@ async def update( self, app_id: AppID, *, - domain: str | NotGiven = NOT_GIVEN, - type: ApplicationType | NotGiven = NOT_GIVEN, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - allowed_idps: List[AllowedIdPs] | NotGiven = NOT_GIVEN, - app_launcher_visible: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: CORSHeadersParam | NotGiven = NOT_GIVEN, - custom_deny_message: str | NotGiven = NOT_GIVEN, - custom_deny_url: str | NotGiven = NOT_GIVEN, - custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, - custom_pages: List[str] | NotGiven = NOT_GIVEN, - destinations: Iterable[application_update_params.SelfHostedApplicationDestination] | NotGiven = NOT_GIVEN, - enable_binding_cookie: bool | NotGiven = NOT_GIVEN, - http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, - logo_url: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - options_preflight_bypass: bool | NotGiven = NOT_GIVEN, - path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - policies: List[application_update_params.SelfHostedApplicationPolicy] + domain: str | Omit = omit, + type: ApplicationType + | Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + "mcp", + "mcp_portal", + ] + | Omit = omit, + 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, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.SelfHostedApplicationDestination] + | Iterable[application_update_params.BrowserSSHApplicationDestination] + | Iterable[application_update_params.BrowserVNCApplicationDestination] + | Iterable[application_update_params.BrowserRdpApplicationDestination] + | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + path_cookie_attribute: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.SelfHostedApplicationPolicy] + | SequenceNotStr[application_update_params.SaaSApplicationPolicy] + | SequenceNotStr[application_update_params.BrowserSSHApplicationPolicy] + | SequenceNotStr[application_update_params.BrowserVNCApplicationPolicy] + | SequenceNotStr[application_update_params.AppLauncherApplicationPolicy] + | SequenceNotStr[application_update_params.DeviceEnrollmentPermissionsApplicationPolicy] + | SequenceNotStr[application_update_params.BrowserIsolationPermissionsApplicationPolicy] | Iterable[application_update_params.InfrastructureApplicationPolicy] - | NotGiven = NOT_GIVEN, - read_service_tokens_from_header: str | NotGiven = NOT_GIVEN, - same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, - scim_config: application_update_params.SelfHostedApplicationSCIMConfig | NotGiven = NOT_GIVEN, - self_hosted_domains: List[SelfHostedDomains] | NotGiven = NOT_GIVEN, - service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, - saas_app: application_update_params.SaaSApplicationSaaSApp | NotGiven = NOT_GIVEN, - app_launcher_logo_url: str | NotGiven = NOT_GIVEN, - bg_color: str | NotGiven = NOT_GIVEN, - footer_links: Iterable[application_update_params.AppLauncherApplicationFooterLink] | NotGiven = NOT_GIVEN, - header_bg_color: str | NotGiven = NOT_GIVEN, - landing_page_design: application_update_params.AppLauncherApplicationLandingPageDesign | NotGiven = NOT_GIVEN, - skip_app_launcher_login_page: bool | NotGiven = NOT_GIVEN, + | SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] + | Omit = omit, + read_service_tokens_from_header: str | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.SelfHostedApplicationSCIMConfig + | application_update_params.SaaSApplicationSCIMConfig + | application_update_params.BrowserSSHApplicationSCIMConfig + | application_update_params.BrowserVNCApplicationSCIMConfig + | application_update_params.BrowserRdpApplicationSCIMConfig + | Omit = omit, + self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, + service_auth_401_redirect: bool | Omit = omit, + session_duration: str | Omit = omit, + skip_interstitial: bool | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + saas_app: application_update_params.SaaSApplicationSaaSApp | Omit = omit, + app_launcher_logo_url: str | Omit = omit, + bg_color: str | Omit = omit, + footer_links: Iterable[application_update_params.AppLauncherApplicationFooterLink] | Omit = omit, + header_bg_color: str | Omit = omit, + landing_page_design: application_update_params.AppLauncherApplicationLandingPageDesign | Omit = omit, + skip_app_launcher_login_page: bool | Omit = omit, target_criteria: Iterable[application_update_params.InfrastructureApplicationTargetCriterion] - | NotGiven = NOT_GIVEN, + | Iterable[application_update_params.BrowserRdpApplicationTargetCriterion] + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationUpdateResponse]: if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") @@ -4956,19 +5036,23 @@ async def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - aud: str | NotGiven = NOT_GIVEN, - domain: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + aud: str | Omit = omit, + domain: str | Omit = omit, + exact: bool | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: str | Omit = omit, + target_attributes: 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[ApplicationListResponse, AsyncSinglePage[ApplicationListResponse]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ApplicationListResponse, AsyncV4PagePaginationArray[ApplicationListResponse]]: """ Lists all Access applications in an account or zone. @@ -4981,10 +5065,18 @@ def list( domain: The domain of the app. + exact: True for only exact string matches against passed name/domain query parameters. + name: The name of the app. + page: Page number of results. + + per_page: Number of results per page. + search: Search for apps by other listed query parameters. + target_attributes: Target Criteria attributes in key=value format. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -5007,7 +5099,7 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/apps", - page=AsyncSinglePage[ApplicationListResponse], + page=AsyncV4PagePaginationArray[ApplicationListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -5017,8 +5109,12 @@ def list( { "aud": aud, "domain": domain, + "exact": exact, "name": name, + "page": page, + "per_page": per_page, "search": search, + "target_attributes": target_attributes, }, application_list_params.ApplicationListParams, ), @@ -5030,14 +5126,14 @@ async def delete( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationDeleteResponse]: """ Deletes an application from Access. @@ -5087,14 +5183,14 @@ async def get( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationGetResponse]: """ Fetches information about an Access application. @@ -5149,14 +5245,14 @@ async def revoke_tokens( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Revokes all tokens issued for an application. diff --git a/src/cloudflare/resources/zero_trust/access/applications/cas.py b/src/cloudflare/resources/zero_trust/access/applications/cas.py index cc6ef53bddd..503adeb3150 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/cas.py +++ b/src/cloudflare/resources/zero_trust/access/applications/cas.py @@ -6,7 +6,8 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 ( @@ -16,8 +17,9 @@ async_to_streamed_response_wrapper, ) from ....._wrappers import ResultWrapper -from .....pagination import SyncSinglePage, AsyncSinglePage +from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ....._base_client import AsyncPaginator, make_request_options +from .....types.zero_trust.access.applications import ca_list_params from .....types.zero_trust.access.applications.ca import CA from .....types.zero_trust.access.applications.ca_delete_response import CADeleteResponse @@ -48,14 +50,14 @@ def create( self, app_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CA]: """ Generates a new short-lived certificate CA and public key. @@ -104,15 +106,17 @@ def create( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this 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[CA]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[CA]: """ Lists short-lived certificate CAs and their public keys. @@ -121,6 +125,10 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -143,9 +151,19 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/apps/ca", - page=SyncSinglePage[CA], + page=SyncV4PagePaginationArray[CA], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + ca_list_params.CAListParams, + ), ), model=CA, ) @@ -154,14 +172,14 @@ def delete( self, app_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CADeleteResponse]: """ Deletes a short-lived certificate CA. @@ -211,14 +229,14 @@ def get( self, app_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CA]: """ Fetches a short-lived certificate CA and its public key. @@ -289,14 +307,14 @@ async def create( self, app_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CA]: """ Generates a new short-lived certificate CA and public key. @@ -345,15 +363,17 @@ async def create( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this 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[CA, AsyncSinglePage[CA]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[CA, AsyncV4PagePaginationArray[CA]]: """ Lists short-lived certificate CAs and their public keys. @@ -362,6 +382,10 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -384,9 +408,19 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/apps/ca", - page=AsyncSinglePage[CA], + page=AsyncV4PagePaginationArray[CA], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + ca_list_params.CAListParams, + ), ), model=CA, ) @@ -395,14 +429,14 @@ async def delete( self, app_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CADeleteResponse]: """ Deletes a short-lived certificate CA. @@ -452,14 +486,14 @@ async def get( self, app_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CA]: """ Fetches a short-lived certificate CA and its public key. diff --git a/src/cloudflare/resources/zero_trust/access/applications/policies.py b/src/cloudflare/resources/zero_trust/access/applications/policies.py index 3976a5a824a..3d403b9ca6c 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/policies.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policies.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -17,9 +17,9 @@ async_to_streamed_response_wrapper, ) from ....._wrappers import ResultWrapper -from .....pagination import SyncSinglePage, AsyncSinglePage +from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ....._base_client import AsyncPaginator, make_request_options -from .....types.zero_trust.access.applications import policy_create_params, policy_update_params +from .....types.zero_trust.access.applications import policy_list_params, policy_create_params, policy_update_params from .....types.zero_trust.access.approval_group_param import ApprovalGroupParam from .....types.zero_trust.access.applications.policy_get_response import PolicyGetResponse from .....types.zero_trust.access.applications.policy_list_response import PolicyListResponse @@ -54,21 +54,21 @@ def create( self, app_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, - approval_required: bool | NotGiven = NOT_GIVEN, - isolation_required: bool | NotGiven = NOT_GIVEN, - precedence: int | NotGiven = NOT_GIVEN, - purpose_justification_prompt: str | NotGiven = NOT_GIVEN, - purpose_justification_required: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, + approval_required: bool | Omit = omit, + isolation_required: bool | Omit = omit, + precedence: int | Omit = omit, + purpose_justification_prompt: str | Omit = omit, + purpose_justification_required: bool | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyCreateResponse]: """ Creates a policy applying exclusive to a single application that defines the @@ -154,21 +154,21 @@ def update( policy_id: str, *, app_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, - approval_required: bool | NotGiven = NOT_GIVEN, - isolation_required: bool | NotGiven = NOT_GIVEN, - precedence: int | NotGiven = NOT_GIVEN, - purpose_justification_prompt: str | NotGiven = NOT_GIVEN, - purpose_justification_required: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, + approval_required: bool | Omit = omit, + isolation_required: bool | Omit = omit, + precedence: int | Omit = omit, + purpose_justification_prompt: str | Omit = omit, + purpose_justification_required: bool | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyUpdateResponse]: """Updates an Access policy specific to an application. @@ -256,15 +256,17 @@ def list( self, app_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[PolicyListResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[PolicyListResponse]: """Lists Access policies configured for an application. Returns both exclusively @@ -277,6 +279,10 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -301,9 +307,19 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/policies", - page=SyncSinglePage[PolicyListResponse], + page=SyncV4PagePaginationArray[PolicyListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + policy_list_params.PolicyListParams, + ), ), model=PolicyListResponse, ) @@ -313,14 +329,14 @@ def delete( policy_id: str, *, app_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyDeleteResponse]: """Deletes an Access policy specific to an application. @@ -377,14 +393,14 @@ def get( policy_id: str, *, app_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyGetResponse]: """Fetches a single Access policy configured for an application. @@ -461,21 +477,21 @@ async def create( self, app_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, - approval_required: bool | NotGiven = NOT_GIVEN, - isolation_required: bool | NotGiven = NOT_GIVEN, - precedence: int | NotGiven = NOT_GIVEN, - purpose_justification_prompt: str | NotGiven = NOT_GIVEN, - purpose_justification_required: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, + approval_required: bool | Omit = omit, + isolation_required: bool | Omit = omit, + precedence: int | Omit = omit, + purpose_justification_prompt: str | Omit = omit, + purpose_justification_required: bool | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyCreateResponse]: """ Creates a policy applying exclusive to a single application that defines the @@ -561,21 +577,21 @@ async def update( policy_id: str, *, app_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, - approval_required: bool | NotGiven = NOT_GIVEN, - isolation_required: bool | NotGiven = NOT_GIVEN, - precedence: int | NotGiven = NOT_GIVEN, - purpose_justification_prompt: str | NotGiven = NOT_GIVEN, - purpose_justification_required: bool | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, + approval_required: bool | Omit = omit, + isolation_required: bool | Omit = omit, + precedence: int | Omit = omit, + purpose_justification_prompt: str | Omit = omit, + purpose_justification_required: bool | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyUpdateResponse]: """Updates an Access policy specific to an application. @@ -663,15 +679,17 @@ def list( self, app_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PolicyListResponse, AsyncSinglePage[PolicyListResponse]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[PolicyListResponse, AsyncV4PagePaginationArray[PolicyListResponse]]: """Lists Access policies configured for an application. Returns both exclusively @@ -684,6 +702,10 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -708,9 +730,19 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/policies", - page=AsyncSinglePage[PolicyListResponse], + page=AsyncV4PagePaginationArray[PolicyListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + policy_list_params.PolicyListParams, + ), ), model=PolicyListResponse, ) @@ -720,14 +752,14 @@ async def delete( policy_id: str, *, app_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyDeleteResponse]: """Deletes an Access policy specific to an application. @@ -784,14 +816,14 @@ async def get( policy_id: str, *, app_id: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyGetResponse]: """Fetches a single Access policy configured for an application. 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 ee1aa9d4469..570d37005f9 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 @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx @@ -14,7 +14,7 @@ UsersResourceWithStreamingResponse, AsyncUsersResourceWithStreamingResponse, ) -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -61,13 +61,13 @@ def create( self, *, account_id: str, - policies: List[policy_test_create_params.Policy] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyTestCreateResponse]: """ Starts an Access policy test. @@ -108,7 +108,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyTestGetResponse]: """ Fetches the current status of a given Access policy test. @@ -171,13 +171,13 @@ async def create( self, *, account_id: str, - policies: List[policy_test_create_params.Policy] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyTestCreateResponse]: """ Starts an Access policy test. @@ -218,7 +218,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyTestGetResponse]: """ Fetches the current status of a given Access policy test. 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 aa38e1502ee..cc6cc310771 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 @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,15 +49,15 @@ def list( policy_test_id: str, *, account_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - status: Literal["success", "fail", "error"] | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + status: Literal["success", "fail", "error"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[UserListResponse]: """ Fetches a single page of user results from an Access policy test. @@ -67,6 +67,8 @@ def list( policy_test_id: The UUID of the policy test. + page: Page number of results. + status: Filter users by their policy evaluation status. extra_headers: Send extra headers @@ -127,15 +129,15 @@ def list( policy_test_id: str, *, account_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - status: Literal["success", "fail", "error"] | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + status: Literal["success", "fail", "error"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[UserListResponse, AsyncV4PagePaginationArray[UserListResponse]]: """ Fetches a single page of user results from an Access policy test. @@ -145,6 +147,8 @@ def list( policy_test_id: The UUID of the policy test. + page: Page number of results. + status: Filter users by their policy evaluation status. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/access/applications/settings.py b/src/cloudflare/resources/zero_trust/access/applications/settings.py index 2bf2fb4c796..d9e2f34f63d 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/settings.py +++ b/src/cloudflare/resources/zero_trust/access/applications/settings.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,16 +51,16 @@ def update( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingUpdateResponse]: """ Updates Access application settings. @@ -121,16 +121,16 @@ def edit( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: """ Updates Access application settings. @@ -212,16 +212,16 @@ async def update( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingUpdateResponse]: """ Updates Access application settings. @@ -282,16 +282,16 @@ async def edit( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_iframe: bool | NotGiven = NOT_GIVEN, - skip_interstitial: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: """ Updates Access application settings. 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 b065c7676f6..ae499ccaa5a 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 NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -48,14 +48,14 @@ def list( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserPolicyCheckListResponse]: """ Tests if a specific user has permission to access an application. @@ -126,14 +126,14 @@ async def list( self, app_id: AppID, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UserPolicyCheckListResponse]: """ Tests if a specific user has permission to access an application. diff --git a/src/cloudflare/resources/zero_trust/access/bookmarks.py b/src/cloudflare/resources/zero_trust/access/bookmarks.py index 6d24de0a1c8..003b54c7fdb 100644 --- a/src/cloudflare/resources/zero_trust/access/bookmarks.py +++ b/src/cloudflare/resources/zero_trust/access/bookmarks.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -59,7 +59,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Bookmark]: """ Create a new Bookmark application. @@ -104,7 +104,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Bookmark]: """ Updates a configured Bookmark application. @@ -147,7 +147,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Bookmark]: """ Lists Bookmark applications. @@ -183,7 +183,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BookmarkDeleteResponse]: """ Deletes a Bookmark application. @@ -226,7 +226,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Bookmark]: """ Fetches a single Bookmark application. @@ -291,7 +291,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Bookmark]: """ Create a new Bookmark application. @@ -336,7 +336,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Bookmark]: """ Updates a configured Bookmark application. @@ -379,7 +379,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Bookmark, AsyncSinglePage[Bookmark]]: """ Lists Bookmark applications. @@ -415,7 +415,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BookmarkDeleteResponse]: """ Deletes a Bookmark application. @@ -458,7 +458,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Bookmark]: """ Fetches a single Bookmark application. @@ -497,27 +497,27 @@ def __init__(self, bookmarks: BookmarksResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - bookmarks.create # pyright: ignore[reportDeprecated], + bookmarks.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - bookmarks.update # pyright: ignore[reportDeprecated], + bookmarks.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - bookmarks.list # pyright: ignore[reportDeprecated], + bookmarks.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - bookmarks.delete # pyright: ignore[reportDeprecated], + bookmarks.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - bookmarks.get # pyright: ignore[reportDeprecated], + bookmarks.get, # pyright: ignore[reportDeprecated], ) ) @@ -528,27 +528,27 @@ def __init__(self, bookmarks: AsyncBookmarksResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - bookmarks.create # pyright: ignore[reportDeprecated], + bookmarks.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - bookmarks.update # pyright: ignore[reportDeprecated], + bookmarks.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - bookmarks.list # pyright: ignore[reportDeprecated], + bookmarks.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - bookmarks.delete # pyright: ignore[reportDeprecated], + bookmarks.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - bookmarks.get # pyright: ignore[reportDeprecated], + bookmarks.get, # pyright: ignore[reportDeprecated], ) ) @@ -559,27 +559,27 @@ def __init__(self, bookmarks: BookmarksResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - bookmarks.create # pyright: ignore[reportDeprecated], + bookmarks.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - bookmarks.update # pyright: ignore[reportDeprecated], + bookmarks.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - bookmarks.list # pyright: ignore[reportDeprecated], + bookmarks.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - bookmarks.delete # pyright: ignore[reportDeprecated], + bookmarks.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - bookmarks.get # pyright: ignore[reportDeprecated], + bookmarks.get, # pyright: ignore[reportDeprecated], ) ) @@ -590,26 +590,26 @@ def __init__(self, bookmarks: AsyncBookmarksResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - bookmarks.create # pyright: ignore[reportDeprecated], + bookmarks.create, # pyright: ignore[reportDeprecated], ) ) self.update = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - bookmarks.update # pyright: ignore[reportDeprecated], + bookmarks.update, # pyright: ignore[reportDeprecated], ) ) self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - bookmarks.list # pyright: ignore[reportDeprecated], + bookmarks.list, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - bookmarks.delete # pyright: ignore[reportDeprecated], + bookmarks.delete, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - bookmarks.get # pyright: ignore[reportDeprecated], + bookmarks.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/zero_trust/access/certificates/certificates.py b/src/cloudflare/resources/zero_trust/access/certificates/certificates.py index d017a9ac3f9..7a366046139 100644 --- a/src/cloudflare/resources/zero_trust/access/certificates/certificates.py +++ b/src/cloudflare/resources/zero_trust/access/certificates/certificates.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx @@ -14,7 +14,7 @@ SettingsResourceWithStreamingResponse, AsyncSettingsResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -25,9 +25,9 @@ async_to_streamed_response_wrapper, ) from ....._wrappers import ResultWrapper -from .....pagination import SyncSinglePage, AsyncSinglePage +from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ....._base_client import AsyncPaginator, make_request_options -from .....types.zero_trust.access import certificate_create_params, certificate_update_params +from .....types.zero_trust.access import certificate_list_params, certificate_create_params, certificate_update_params from .....types.zero_trust.access.certificate import Certificate from .....types.zero_trust.access.associated_hostnames import AssociatedHostnames from .....types.zero_trust.access.certificate_delete_response import CertificateDeleteResponse @@ -64,15 +64,15 @@ def create( *, certificate: str, name: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - associated_hostnames: List[AssociatedHostnames] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Certificate]: """ Adds a new mTLS root certificate to Access. @@ -132,16 +132,16 @@ def update( self, certificate_id: str, *, - associated_hostnames: List[AssociatedHostnames], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + associated_hostnames: SequenceNotStr[AssociatedHostnames], + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Certificate]: """ Updates a configured mTLS certificate. @@ -201,15 +201,17 @@ def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this 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[Certificate]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[Certificate]: """ Lists all mTLS root certificates. @@ -218,6 +220,10 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -240,9 +246,19 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/certificates", - page=SyncSinglePage[Certificate], + page=SyncV4PagePaginationArray[Certificate], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + certificate_list_params.CertificateListParams, + ), ), model=Certificate, ) @@ -251,14 +267,14 @@ def delete( self, certificate_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateDeleteResponse]: """ Deletes an mTLS certificate. @@ -308,14 +324,14 @@ def get( self, certificate_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Certificate]: """ Fetches a single mTLS certificate. @@ -391,15 +407,15 @@ async def create( *, certificate: str, name: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - associated_hostnames: List[AssociatedHostnames] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Certificate]: """ Adds a new mTLS root certificate to Access. @@ -459,16 +475,16 @@ async def update( self, certificate_id: str, *, - associated_hostnames: List[AssociatedHostnames], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + associated_hostnames: SequenceNotStr[AssociatedHostnames], + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Certificate]: """ Updates a configured mTLS certificate. @@ -528,15 +544,17 @@ async def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this 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[Certificate, AsyncSinglePage[Certificate]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Certificate, AsyncV4PagePaginationArray[Certificate]]: """ Lists all mTLS root certificates. @@ -545,6 +563,10 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -567,9 +589,19 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/certificates", - page=AsyncSinglePage[Certificate], + page=AsyncV4PagePaginationArray[Certificate], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + certificate_list_params.CertificateListParams, + ), ), model=Certificate, ) @@ -578,14 +610,14 @@ async def delete( self, certificate_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateDeleteResponse]: """ Deletes an mTLS certificate. @@ -635,14 +667,14 @@ async def get( self, certificate_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Certificate]: """ Fetches a single mTLS certificate. diff --git a/src/cloudflare/resources/zero_trust/access/certificates/settings.py b/src/cloudflare/resources/zero_trust/access/certificates/settings.py index fb0852d1e59..6279f4cf55f 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 NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,14 +49,14 @@ def update( self, *, settings: Iterable[CertificateSettingsParam], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CertificateSettings]: """ Updates an mTLS certificate's hostname settings. @@ -100,14 +100,14 @@ def update( def get( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CertificateSettings]: """ List all mTLS hostname settings for this account or zone. @@ -171,14 +171,14 @@ def update( self, *, settings: Iterable[CertificateSettingsParam], - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CertificateSettings, AsyncSinglePage[CertificateSettings]]: """ Updates an mTLS certificate's hostname settings. @@ -222,14 +222,14 @@ def update( def get( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CertificateSettings, AsyncSinglePage[CertificateSettings]]: """ List all mTLS hostname settings for this account or zone. diff --git a/src/cloudflare/resources/zero_trust/access/custom_pages.py b/src/cloudflare/resources/zero_trust/access/custom_pages.py index bb0dae981f8..a0221d88a29 100644 --- a/src/cloudflare/resources/zero_trust/access/custom_pages.py +++ b/src/cloudflare/resources/zero_trust/access/custom_pages.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -18,9 +18,9 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options -from ....types.zero_trust.access import custom_page_create_params, custom_page_update_params +from ....types.zero_trust.access import custom_page_list_params, custom_page_create_params, custom_page_update_params from ....types.zero_trust.access.custom_page import CustomPage from ....types.zero_trust.access.custom_page_without_html import CustomPageWithoutHTML from ....types.zero_trust.access.custom_page_delete_response import CustomPageDeleteResponse @@ -55,13 +55,12 @@ def create( custom_html: str, name: str, type: Literal["identity_denied", "forbidden"], - app_count: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPageWithoutHTML]: """ Create a custom page @@ -75,8 +74,6 @@ def create( type: Custom page type. - app_count: Number of apps the custom page is assigned to. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -94,7 +91,6 @@ def create( "custom_html": custom_html, "name": name, "type": type, - "app_count": app_count, }, custom_page_create_params.CustomPageCreateParams, ), @@ -116,13 +112,12 @@ def update( custom_html: str, name: str, type: Literal["identity_denied", "forbidden"], - app_count: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPageWithoutHTML]: """ Update a custom page @@ -138,8 +133,6 @@ def update( type: Custom page type. - app_count: Number of apps the custom page is assigned to. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -159,7 +152,6 @@ def update( "custom_html": custom_html, "name": name, "type": type, - "app_count": app_count, }, custom_page_update_params.CustomPageUpdateParams, ), @@ -177,19 +169,25 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[CustomPageWithoutHTML]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[CustomPageWithoutHTML]: """ List custom pages Args: account_id: Identifier. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -202,9 +200,19 @@ def list( 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}/access/custom_pages", - page=SyncSinglePage[CustomPageWithoutHTML], + page=SyncV4PagePaginationArray[CustomPageWithoutHTML], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + custom_page_list_params.CustomPageListParams, + ), ), model=CustomPageWithoutHTML, ) @@ -219,7 +227,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPageDeleteResponse]: """ Delete a custom page @@ -263,7 +271,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPage]: """ Fetches a custom page and also returns its HTML. @@ -325,13 +333,12 @@ async def create( custom_html: str, name: str, type: Literal["identity_denied", "forbidden"], - app_count: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPageWithoutHTML]: """ Create a custom page @@ -345,8 +352,6 @@ async def create( type: Custom page type. - app_count: Number of apps the custom page is assigned to. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -364,7 +369,6 @@ async def create( "custom_html": custom_html, "name": name, "type": type, - "app_count": app_count, }, custom_page_create_params.CustomPageCreateParams, ), @@ -386,13 +390,12 @@ async def update( custom_html: str, name: str, type: Literal["identity_denied", "forbidden"], - app_count: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPageWithoutHTML]: """ Update a custom page @@ -408,8 +411,6 @@ async def update( type: Custom page type. - app_count: Number of apps the custom page is assigned to. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -429,7 +430,6 @@ async def update( "custom_html": custom_html, "name": name, "type": type, - "app_count": app_count, }, custom_page_update_params.CustomPageUpdateParams, ), @@ -447,19 +447,25 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[CustomPageWithoutHTML, AsyncSinglePage[CustomPageWithoutHTML]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[CustomPageWithoutHTML, AsyncV4PagePaginationArray[CustomPageWithoutHTML]]: """ List custom pages Args: account_id: Identifier. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -472,9 +478,19 @@ def list( 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}/access/custom_pages", - page=AsyncSinglePage[CustomPageWithoutHTML], + page=AsyncV4PagePaginationArray[CustomPageWithoutHTML], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + custom_page_list_params.CustomPageListParams, + ), ), model=CustomPageWithoutHTML, ) @@ -489,7 +505,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPageDeleteResponse]: """ Delete a custom page @@ -533,7 +549,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomPage]: """ Fetches a custom page and also returns its HTML. diff --git a/src/cloudflare/resources/zero_trust/access/gateway_ca.py b/src/cloudflare/resources/zero_trust/access/gateway_ca.py index 7b209befcc8..ed2e6346595 100644 --- a/src/cloudflare/resources/zero_trust/access/gateway_ca.py +++ b/src/cloudflare/resources/zero_trust/access/gateway_ca.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -54,7 +54,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayCACreateResponse]: """ Adds a new SSH Certificate Authority (CA). @@ -93,7 +93,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[GatewayCAListResponse]: """ Lists SSH Certificate Authorities (CA). @@ -130,7 +130,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayCADeleteResponse]: """ Deletes an SSH Certificate Authority. @@ -194,7 +194,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayCACreateResponse]: """ Adds a new SSH Certificate Authority (CA). @@ -233,7 +233,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[GatewayCAListResponse, AsyncSinglePage[GatewayCAListResponse]]: """ Lists SSH Certificate Authorities (CA). @@ -270,7 +270,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayCADeleteResponse]: """ Deletes an SSH Certificate Authority. diff --git a/src/cloudflare/resources/zero_trust/access/groups.py b/src/cloudflare/resources/zero_trust/access/groups.py index 92eabfb366f..c27dba939fb 100644 --- a/src/cloudflare/resources/zero_trust/access/groups.py +++ b/src/cloudflare/resources/zero_trust/access/groups.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -17,7 +17,7 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options from ....types.zero_trust.access import group_list_params, group_create_params, group_update_params from ....types.zero_trust.access.group_get_response import GroupGetResponse @@ -55,17 +55,17 @@ def create( *, include: Iterable[AccessRuleParam], name: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - is_default: bool | NotGiven = NOT_GIVEN, - require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GroupCreateResponse]: """ Creates a new Access group. @@ -136,17 +136,17 @@ def update( *, include: Iterable[AccessRuleParam], name: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - is_default: bool | NotGiven = NOT_GIVEN, - require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GroupUpdateResponse]: """ Updates a configured Access group. @@ -218,17 +218,19 @@ def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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, - ) -> SyncSinglePage[GroupListResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[GroupListResponse]: """ Lists all Access groups. @@ -239,6 +241,10 @@ def list( name: The name of the group. + page: Page number of results. + + per_page: Number of results per page. + search: Search for groups by other listed query parameters. extra_headers: Send extra headers @@ -263,7 +269,7 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/groups", - page=SyncSinglePage[GroupListResponse], + page=SyncV4PagePaginationArray[GroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -272,6 +278,8 @@ def list( query=maybe_transform( { "name": name, + "page": page, + "per_page": per_page, "search": search, }, group_list_params.GroupListParams, @@ -284,14 +292,14 @@ def delete( self, group_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GroupDeleteResponse]: """ Deletes an Access group. @@ -341,14 +349,14 @@ def get( self, group_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GroupGetResponse]: """ Fetches a single Access group. @@ -420,17 +428,17 @@ async def create( *, include: Iterable[AccessRuleParam], name: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - is_default: bool | NotGiven = NOT_GIVEN, - require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GroupCreateResponse]: """ Creates a new Access group. @@ -501,17 +509,17 @@ async def update( *, include: Iterable[AccessRuleParam], name: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - is_default: bool | NotGiven = NOT_GIVEN, - require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GroupUpdateResponse]: """ Updates a configured Access group. @@ -583,17 +591,19 @@ async def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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[GroupListResponse, AsyncSinglePage[GroupListResponse]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[GroupListResponse, AsyncV4PagePaginationArray[GroupListResponse]]: """ Lists all Access groups. @@ -604,6 +614,10 @@ def list( name: The name of the group. + page: Page number of results. + + per_page: Number of results per page. + search: Search for groups by other listed query parameters. extra_headers: Send extra headers @@ -628,7 +642,7 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/groups", - page=AsyncSinglePage[GroupListResponse], + page=AsyncV4PagePaginationArray[GroupListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -637,6 +651,8 @@ def list( query=maybe_transform( { "name": name, + "page": page, + "per_page": per_page, "search": search, }, group_list_params.GroupListParams, @@ -649,14 +665,14 @@ async def delete( self, group_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GroupDeleteResponse]: """ Deletes an Access group. @@ -706,14 +722,14 @@ async def get( self, group_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GroupGetResponse]: """ Fetches a single Access group. diff --git a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py index 9777959d93f..79543f77c2f 100644 --- a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py +++ b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py @@ -3,13 +3,13 @@ from __future__ import annotations import typing_extensions -from typing import List, Type, Union, Iterable, Optional, cast +from typing import Type, Union, Iterable, Optional, cast from datetime import datetime from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ....._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -69,7 +69,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TargetCreateResponse]: """ Create new target @@ -124,7 +124,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TargetUpdateResponse]: """ Update target @@ -175,32 +175,32 @@ def list( self, *, account_id: str, - created_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - created_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - hostname: Optional[str] | NotGiven = NOT_GIVEN, - hostname_contains: Optional[str] | NotGiven = NOT_GIVEN, - ip_like: Optional[str] | NotGiven = NOT_GIVEN, - ip_v4: Optional[str] | NotGiven = NOT_GIVEN, - ip_v6: Optional[str] | NotGiven = NOT_GIVEN, - ips: List[str] | NotGiven = NOT_GIVEN, - ipv4_end: Optional[str] | NotGiven = NOT_GIVEN, - ipv4_start: Optional[str] | NotGiven = NOT_GIVEN, - ipv6_end: Optional[str] | NotGiven = NOT_GIVEN, - ipv6_start: Optional[str] | NotGiven = NOT_GIVEN, - modified_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - modified_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - order: Literal["hostname", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - target_ids: List[str] | NotGiven = NOT_GIVEN, - virtual_network_id: Optional[str] | NotGiven = NOT_GIVEN, + created_after: Union[str, datetime, None] | Omit = omit, + created_before: Union[str, datetime, None] | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + hostname: Optional[str] | Omit = omit, + hostname_contains: Optional[str] | Omit = omit, + ip_like: Optional[str] | Omit = omit, + ip_v4: Optional[str] | Omit = omit, + ip_v6: Optional[str] | Omit = omit, + ips: SequenceNotStr[str] | Omit = omit, + ipv4_end: Optional[str] | Omit = omit, + ipv4_start: Optional[str] | Omit = omit, + ipv6_end: Optional[str] | Omit = omit, + ipv6_start: Optional[str] | Omit = omit, + modified_after: Union[str, datetime, None] | Omit = omit, + modified_before: Union[str, datetime, None] | Omit = omit, + order: Literal["hostname", "created_at"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + target_ids: SequenceNotStr[str] | Omit = omit, + virtual_network_id: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[TargetListResponse]: """Lists and sorts an account’s targets. @@ -314,7 +314,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Delete target @@ -355,7 +355,7 @@ def bulk_delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Removes one or more targets. @@ -386,13 +386,13 @@ def bulk_delete_v2( self, *, account_id: str, - target_ids: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Removes one or more targets. @@ -432,7 +432,7 @@ def bulk_update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[TargetBulkUpdateResponse]: """ Adds one or more targets. @@ -471,7 +471,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TargetGetResponse]: """ Get target @@ -537,7 +537,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TargetCreateResponse]: """ Create new target @@ -592,7 +592,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TargetUpdateResponse]: """ Update target @@ -643,32 +643,32 @@ def list( self, *, account_id: str, - created_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - created_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - hostname: Optional[str] | NotGiven = NOT_GIVEN, - hostname_contains: Optional[str] | NotGiven = NOT_GIVEN, - ip_like: Optional[str] | NotGiven = NOT_GIVEN, - ip_v4: Optional[str] | NotGiven = NOT_GIVEN, - ip_v6: Optional[str] | NotGiven = NOT_GIVEN, - ips: List[str] | NotGiven = NOT_GIVEN, - ipv4_end: Optional[str] | NotGiven = NOT_GIVEN, - ipv4_start: Optional[str] | NotGiven = NOT_GIVEN, - ipv6_end: Optional[str] | NotGiven = NOT_GIVEN, - ipv6_start: Optional[str] | NotGiven = NOT_GIVEN, - modified_after: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - modified_before: Union[str, datetime, None] | NotGiven = NOT_GIVEN, - order: Literal["hostname", "created_at"] | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - target_ids: List[str] | NotGiven = NOT_GIVEN, - virtual_network_id: Optional[str] | NotGiven = NOT_GIVEN, + created_after: Union[str, datetime, None] | Omit = omit, + created_before: Union[str, datetime, None] | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + hostname: Optional[str] | Omit = omit, + hostname_contains: Optional[str] | Omit = omit, + ip_like: Optional[str] | Omit = omit, + ip_v4: Optional[str] | Omit = omit, + ip_v6: Optional[str] | Omit = omit, + ips: SequenceNotStr[str] | Omit = omit, + ipv4_end: Optional[str] | Omit = omit, + ipv4_start: Optional[str] | Omit = omit, + ipv6_end: Optional[str] | Omit = omit, + ipv6_start: Optional[str] | Omit = omit, + modified_after: Union[str, datetime, None] | Omit = omit, + modified_before: Union[str, datetime, None] | Omit = omit, + order: Literal["hostname", "created_at"] | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + target_ids: SequenceNotStr[str] | Omit = omit, + virtual_network_id: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TargetListResponse, AsyncV4PagePaginationArray[TargetListResponse]]: """Lists and sorts an account’s targets. @@ -782,7 +782,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Delete target @@ -823,7 +823,7 @@ async def bulk_delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Removes one or more targets. @@ -854,13 +854,13 @@ async def bulk_delete_v2( self, *, account_id: str, - target_ids: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ Removes one or more targets. @@ -902,7 +902,7 @@ def bulk_update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TargetBulkUpdateResponse, AsyncSinglePage[TargetBulkUpdateResponse]]: """ Adds one or more targets. @@ -941,7 +941,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TargetGetResponse]: """ Get target @@ -994,7 +994,7 @@ def __init__(self, targets: TargetsResource) -> None: ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - targets.bulk_delete # pyright: ignore[reportDeprecated], + targets.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete_v2 = to_raw_response_wrapper( @@ -1026,7 +1026,7 @@ def __init__(self, targets: AsyncTargetsResource) -> None: ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - targets.bulk_delete # pyright: ignore[reportDeprecated], + targets.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete_v2 = async_to_raw_response_wrapper( @@ -1058,7 +1058,7 @@ def __init__(self, targets: TargetsResource) -> None: ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - targets.bulk_delete # pyright: ignore[reportDeprecated], + targets.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete_v2 = to_streamed_response_wrapper( @@ -1090,7 +1090,7 @@ def __init__(self, targets: AsyncTargetsResource) -> None: ) self.bulk_delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - targets.bulk_delete # pyright: ignore[reportDeprecated], + targets.bulk_delete, # pyright: ignore[reportDeprecated], ) ) self.bulk_delete_v2 = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/zero_trust/access/keys.py b/src/cloudflare/resources/zero_trust/access/keys.py index cf9cbcc4a26..075fc667f34 100644 --- a/src/cloudflare/resources/zero_trust/access/keys.py +++ b/src/cloudflare/resources/zero_trust/access/keys.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyUpdateResponse]: """ Updates the Access key rotation settings for an account. @@ -100,7 +100,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyGetResponse]: """ Gets the Access key rotation settings for an account. @@ -139,7 +139,7 @@ def rotate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyRotateResponse]: """ Perfoms a key rotation for an account. @@ -200,7 +200,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyUpdateResponse]: """ Updates the Access key rotation settings for an account. @@ -244,7 +244,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyGetResponse]: """ Gets the Access key rotation settings for an account. @@ -283,7 +283,7 @@ async def rotate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeyRotateResponse]: """ Perfoms a key rotation for an account. 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 e960d4dae1d..ef42ea8f447 100644 --- a/src/cloudflare/resources/zero_trust/access/logs/access_requests.py +++ b/src/cloudflare/resources/zero_trust/access/logs/access_requests.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,16 +50,21 @@ def list( self, *, account_id: str, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + direction: Literal["desc", "asc"] | Omit = omit, + email: str | Omit = omit, + email_exact: bool | Omit = omit, + limit: int | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + since: Union[str, datetime] | Omit = omit, + until: Union[str, datetime] | Omit = omit, + user_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccessRequestListResponse]: """ Gets a list of Access authentication audit logs for an account. @@ -69,12 +74,25 @@ def list( direction: The chronological sorting order for the logs. + email: Filter by user email. Defaults to substring matching. To force exact matching, + set `email_exact=true`. Example (default): `email=@example.com` returns all + events with that domain. Example (exact): + `email=user@example.com&email_exact=true` returns only that user. + + email_exact: When true, `email` is matched exactly instead of substring matching. + limit: The maximum number of log entries to retrieve. + page: Page number of results. + + per_page: Number of results per page. + since: The earliest event timestamp to query. until: The latest event timestamp to query. + user_id: Filter by user UUID. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -95,9 +113,14 @@ def list( query=maybe_transform( { "direction": direction, + "email": email, + "email_exact": email_exact, "limit": limit, + "page": page, + "per_page": per_page, "since": since, "until": until, + "user_id": user_id, }, access_request_list_params.AccessRequestListParams, ), @@ -131,16 +154,21 @@ async def list( self, *, account_id: str, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + direction: Literal["desc", "asc"] | Omit = omit, + email: str | Omit = omit, + email_exact: bool | Omit = omit, + limit: int | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + since: Union[str, datetime] | Omit = omit, + until: Union[str, datetime] | Omit = omit, + user_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccessRequestListResponse]: """ Gets a list of Access authentication audit logs for an account. @@ -150,12 +178,25 @@ async def list( direction: The chronological sorting order for the logs. + email: Filter by user email. Defaults to substring matching. To force exact matching, + set `email_exact=true`. Example (default): `email=@example.com` returns all + events with that domain. Example (exact): + `email=user@example.com&email_exact=true` returns only that user. + + email_exact: When true, `email` is matched exactly instead of substring matching. + limit: The maximum number of log entries to retrieve. + page: Page number of results. + + per_page: Number of results per page. + since: The earliest event timestamp to query. until: The latest event timestamp to query. + user_id: Filter by user UUID. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -176,9 +217,14 @@ async def list( query=await async_maybe_transform( { "direction": direction, + "email": email, + "email_exact": email_exact, "limit": limit, + "page": page, + "per_page": per_page, "since": since, "until": until, + "user_id": user_id, }, access_request_list_params.AccessRequestListParams, ), 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 ae79ab160b4..73ae5fcc87f 100644 --- a/src/cloudflare/resources/zero_trust/access/logs/scim/updates.py +++ b/src/cloudflare/resources/zero_trust/access/logs/scim/updates.py @@ -8,7 +8,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource @@ -18,7 +18,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ......pagination import SyncSinglePage, AsyncSinglePage +from ......pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ......_base_client import AsyncPaginator, make_request_options from ......types.zero_trust.access.logs.scim import update_list_params from ......types.zero_trust.access.logs.scim.update_list_response import UpdateListResponse @@ -50,25 +50,27 @@ def list( self, *, account_id: str, - idp_id: List[str], - cf_resource_id: str | NotGiven = NOT_GIVEN, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - idp_resource_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - request_method: List[Literal["DELETE", "PATCH", "POST", "PUT"]] | NotGiven = NOT_GIVEN, - resource_group_name: str | NotGiven = NOT_GIVEN, - resource_type: List[Literal["USER", "GROUP"]] | NotGiven = NOT_GIVEN, - resource_user_email: str | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - status: List[Literal["FAILURE", "SUCCESS"]] | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + idp_id: SequenceNotStr[str], + cf_resource_id: str | Omit = omit, + direction: Literal["desc", "asc"] | Omit = omit, + idp_resource_id: str | Omit = omit, + limit: int | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + request_method: List[Literal["DELETE", "PATCH", "POST", "PUT"]] | Omit = omit, + resource_group_name: str | Omit = omit, + resource_type: List[Literal["USER", "GROUP"]] | Omit = omit, + resource_user_email: str | Omit = omit, + since: Union[str, datetime] | Omit = omit, + status: List[Literal["FAILURE", "SUCCESS"]] | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[UpdateListResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[UpdateListResponse]: """ Lists Access SCIM update logs that maintain a record of updates made to User and Group resources synced to Cloudflare via the System for Cross-domain Identity @@ -87,6 +89,10 @@ def list( limit: The maximum number of update logs to retrieve. + page: Page number of results. + + per_page: Number of results per page. + request_method: The request method of the SCIM request. resource_group_name: The display name of the SCIM Group resource. @@ -113,7 +119,7 @@ def list( 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}/access/logs/scim/updates", - page=SyncSinglePage[UpdateListResponse], + page=SyncV4PagePaginationArray[UpdateListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -126,6 +132,8 @@ def list( "direction": direction, "idp_resource_id": idp_resource_id, "limit": limit, + "page": page, + "per_page": per_page, "request_method": request_method, "resource_group_name": resource_group_name, "resource_type": resource_type, @@ -165,25 +173,27 @@ def list( self, *, account_id: str, - idp_id: List[str], - cf_resource_id: str | NotGiven = NOT_GIVEN, - direction: Literal["desc", "asc"] | NotGiven = NOT_GIVEN, - idp_resource_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - request_method: List[Literal["DELETE", "PATCH", "POST", "PUT"]] | NotGiven = NOT_GIVEN, - resource_group_name: str | NotGiven = NOT_GIVEN, - resource_type: List[Literal["USER", "GROUP"]] | NotGiven = NOT_GIVEN, - resource_user_email: str | NotGiven = NOT_GIVEN, - since: Union[str, datetime] | NotGiven = NOT_GIVEN, - status: List[Literal["FAILURE", "SUCCESS"]] | NotGiven = NOT_GIVEN, - until: Union[str, datetime] | NotGiven = NOT_GIVEN, + idp_id: SequenceNotStr[str], + cf_resource_id: str | Omit = omit, + direction: Literal["desc", "asc"] | Omit = omit, + idp_resource_id: str | Omit = omit, + limit: int | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + request_method: List[Literal["DELETE", "PATCH", "POST", "PUT"]] | Omit = omit, + resource_group_name: str | Omit = omit, + resource_type: List[Literal["USER", "GROUP"]] | Omit = omit, + resource_user_email: str | Omit = omit, + since: Union[str, datetime] | Omit = omit, + status: List[Literal["FAILURE", "SUCCESS"]] | Omit = omit, + until: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[UpdateListResponse, AsyncSinglePage[UpdateListResponse]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[UpdateListResponse, AsyncV4PagePaginationArray[UpdateListResponse]]: """ Lists Access SCIM update logs that maintain a record of updates made to User and Group resources synced to Cloudflare via the System for Cross-domain Identity @@ -202,6 +212,10 @@ def list( limit: The maximum number of update logs to retrieve. + page: Page number of results. + + per_page: Number of results per page. + request_method: The request method of the SCIM request. resource_group_name: The display name of the SCIM Group resource. @@ -228,7 +242,7 @@ def list( 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}/access/logs/scim/updates", - page=AsyncSinglePage[UpdateListResponse], + page=AsyncV4PagePaginationArray[UpdateListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -241,6 +255,8 @@ def list( "direction": direction, "idp_resource_id": idp_resource_id, "limit": limit, + "page": page, + "per_page": per_page, "request_method": request_method, "resource_group_name": resource_group_name, "resource_type": resource_type, diff --git a/src/cloudflare/resources/zero_trust/access/policies.py b/src/cloudflare/resources/zero_trust/access/policies.py index 70aaf6b29b7..8e80d9f3b1d 100644 --- a/src/cloudflare/resources/zero_trust/access/policies.py +++ b/src/cloudflare/resources/zero_trust/access/policies.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -17,9 +17,9 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options -from ....types.zero_trust.access import Decision, policy_create_params, policy_update_params +from ....types.zero_trust.access import Decision, policy_list_params, policy_create_params, policy_update_params from ....types.zero_trust.access.decision import Decision from ....types.zero_trust.access.policy_get_response import PolicyGetResponse from ....types.zero_trust.access.approval_group_param import ApprovalGroupParam @@ -59,20 +59,20 @@ def create( decision: Decision, include: Iterable[AccessRuleParam], name: str, - approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, - approval_required: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - isolation_required: bool | NotGiven = NOT_GIVEN, - purpose_justification_prompt: str | NotGiven = NOT_GIVEN, - purpose_justification_required: bool | NotGiven = NOT_GIVEN, - require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, + approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, + approval_required: bool | Omit = omit, + exclude: Iterable[AccessRuleParam] | Omit = omit, + isolation_required: bool | Omit = omit, + purpose_justification_prompt: str | Omit = omit, + purpose_justification_required: bool | Omit = omit, + require: Iterable[AccessRuleParam] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyCreateResponse]: """ Creates a new Access reusable policy. @@ -157,20 +157,20 @@ def update( decision: Decision, include: Iterable[AccessRuleParam], name: str, - approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, - approval_required: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - isolation_required: bool | NotGiven = NOT_GIVEN, - purpose_justification_prompt: str | NotGiven = NOT_GIVEN, - purpose_justification_required: bool | NotGiven = NOT_GIVEN, - require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, + approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, + approval_required: bool | Omit = omit, + exclude: Iterable[AccessRuleParam] | Omit = omit, + isolation_required: bool | Omit = omit, + purpose_justification_prompt: str | Omit = omit, + purpose_justification_required: bool | Omit = omit, + require: Iterable[AccessRuleParam] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyUpdateResponse]: """ Updates a Access reusable policy. @@ -255,19 +255,25 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[PolicyListResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[PolicyListResponse]: """ Lists Access reusable policies. Args: account_id: Identifier. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -280,9 +286,19 @@ def list( 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}/access/policies", - page=SyncSinglePage[PolicyListResponse], + page=SyncV4PagePaginationArray[PolicyListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + policy_list_params.PolicyListParams, + ), ), model=PolicyListResponse, ) @@ -297,7 +313,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyDeleteResponse]: """ Deletes an Access reusable policy. @@ -341,7 +357,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyGetResponse]: """ Fetches a single Access reusable policy. @@ -403,20 +419,20 @@ async def create( decision: Decision, include: Iterable[AccessRuleParam], name: str, - approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, - approval_required: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - isolation_required: bool | NotGiven = NOT_GIVEN, - purpose_justification_prompt: str | NotGiven = NOT_GIVEN, - purpose_justification_required: bool | NotGiven = NOT_GIVEN, - require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, + approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, + approval_required: bool | Omit = omit, + exclude: Iterable[AccessRuleParam] | Omit = omit, + isolation_required: bool | Omit = omit, + purpose_justification_prompt: str | Omit = omit, + purpose_justification_required: bool | Omit = omit, + require: Iterable[AccessRuleParam] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyCreateResponse]: """ Creates a new Access reusable policy. @@ -501,20 +517,20 @@ async def update( decision: Decision, include: Iterable[AccessRuleParam], name: str, - approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, - approval_required: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - isolation_required: bool | NotGiven = NOT_GIVEN, - purpose_justification_prompt: str | NotGiven = NOT_GIVEN, - purpose_justification_required: bool | NotGiven = NOT_GIVEN, - require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, + approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, + approval_required: bool | Omit = omit, + exclude: Iterable[AccessRuleParam] | Omit = omit, + isolation_required: bool | Omit = omit, + purpose_justification_prompt: str | Omit = omit, + purpose_justification_required: bool | Omit = omit, + require: Iterable[AccessRuleParam] | Omit = omit, + session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyUpdateResponse]: """ Updates a Access reusable policy. @@ -599,19 +615,25 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[PolicyListResponse, AsyncSinglePage[PolicyListResponse]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[PolicyListResponse, AsyncV4PagePaginationArray[PolicyListResponse]]: """ Lists Access reusable policies. Args: account_id: Identifier. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -624,9 +646,19 @@ def list( 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}/access/policies", - page=AsyncSinglePage[PolicyListResponse], + page=AsyncV4PagePaginationArray[PolicyListResponse], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + policy_list_params.PolicyListParams, + ), ), model=PolicyListResponse, ) @@ -641,7 +673,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyDeleteResponse]: """ Deletes an Access reusable policy. @@ -685,7 +717,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PolicyGetResponse]: """ Fetches a single Access reusable policy. diff --git a/src/cloudflare/resources/zero_trust/access/service_tokens.py b/src/cloudflare/resources/zero_trust/access/service_tokens.py index a912e7a5e19..c08436ab5ab 100644 --- a/src/cloudflare/resources/zero_trust/access/service_tokens.py +++ b/src/cloudflare/resources/zero_trust/access/service_tokens.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing import Type, Optional, cast +from typing import Type, Union, Optional, cast +from datetime import datetime import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -17,11 +18,12 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options from ....types.zero_trust.access import ( service_token_list_params, service_token_create_params, + service_token_rotate_params, service_token_update_params, ) from ....types.zero_trust.access.service_token import ServiceToken @@ -55,15 +57,17 @@ def create( self, *, name: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - duration: str | NotGiven = NOT_GIVEN, + 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceTokenCreateResponse]: """Generates a new service token. @@ -78,10 +82,20 @@ def create( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + client_secret_version: A version number identifying the current `client_secret` associated with the + service token. Incrementing it triggers a rotation; the previous secret will + still be accepted until the time indicated by + `previous_client_secret_expires_at`. + duration: The duration for how long the service token will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h). + previous_client_secret_expires_at: The expiration of the previous `client_secret`. This can be modified at any + point after a rotation. For example, you may extend it further into the future + if you need more time to update services with the new secret; or move it into + the past to immediately invalidate the previous token in case of compromise. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -107,7 +121,9 @@ def create( body=maybe_transform( { "name": name, + "client_secret_version": client_secret_version, "duration": duration, + "previous_client_secret_expires_at": previous_client_secret_expires_at, }, service_token_create_params.ServiceTokenCreateParams, ), @@ -125,16 +141,18 @@ def update( self, service_token_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - duration: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + client_secret_version: float | Omit = omit, + duration: str | Omit = omit, + name: str | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceToken]: """ Updates a configured service token. @@ -146,12 +164,22 @@ def update( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + client_secret_version: A version number identifying the current `client_secret` associated with the + service token. Incrementing it triggers a rotation; the previous secret will + still be accepted until the time indicated by + `previous_client_secret_expires_at`. + duration: The duration for how long the service token will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h). name: The name of the service token. + previous_client_secret_expires_at: The expiration of the previous `client_secret`. This can be modified at any + point after a rotation. For example, you may extend it further into the future + if you need more time to update services with the new secret; or move it into + the past to immediately invalidate the previous token in case of compromise. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -178,8 +206,10 @@ def update( f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens/{service_token_id}", body=maybe_transform( { + "client_secret_version": client_secret_version, "duration": duration, "name": name, + "previous_client_secret_expires_at": previous_client_secret_expires_at, }, service_token_update_params.ServiceTokenUpdateParams, ), @@ -196,17 +226,19 @@ def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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, - ) -> SyncSinglePage[ServiceToken]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[ServiceToken]: """ Lists all service tokens. @@ -217,6 +249,10 @@ def list( name: The name of the service token. + page: Page number of results. + + per_page: Number of results per page. + search: Search for service tokens by other listed query parameters. extra_headers: Send extra headers @@ -241,7 +277,7 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens", - page=SyncSinglePage[ServiceToken], + page=SyncV4PagePaginationArray[ServiceToken], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -250,6 +286,8 @@ def list( query=maybe_transform( { "name": name, + "page": page, + "per_page": per_page, "search": search, }, service_token_list_params.ServiceTokenListParams, @@ -262,14 +300,14 @@ def delete( self, service_token_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceToken]: """ Deletes a service token. @@ -319,14 +357,14 @@ def get( self, service_token_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceToken]: """ Fetches a single service token. @@ -382,7 +420,7 @@ def refresh( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceToken]: """ Refreshes the expiration of a service token. @@ -421,12 +459,13 @@ def rotate( service_token_id: str, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceTokenRotateResponse]: """ Generates a new Client Secret for a service token and revokes the old one. @@ -436,6 +475,9 @@ def rotate( service_token_id: UUID. + previous_client_secret_expires_at: The expiration of the previous `client_secret`. If not provided, it defaults to + the current timestamp in order to immediately expire the previous secret. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -450,6 +492,10 @@ def rotate( raise ValueError(f"Expected a non-empty value for `service_token_id` but received {service_token_id!r}") return self._post( f"/accounts/{account_id}/access/service_tokens/{service_token_id}/rotate", + body=maybe_transform( + {"previous_client_secret_expires_at": previous_client_secret_expires_at}, + service_token_rotate_params.ServiceTokenRotateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -485,15 +531,17 @@ async def create( self, *, name: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - duration: str | NotGiven = NOT_GIVEN, + 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceTokenCreateResponse]: """Generates a new service token. @@ -508,10 +556,20 @@ async def create( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + client_secret_version: A version number identifying the current `client_secret` associated with the + service token. Incrementing it triggers a rotation; the previous secret will + still be accepted until the time indicated by + `previous_client_secret_expires_at`. + duration: The duration for how long the service token will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h). + previous_client_secret_expires_at: The expiration of the previous `client_secret`. This can be modified at any + point after a rotation. For example, you may extend it further into the future + if you need more time to update services with the new secret; or move it into + the past to immediately invalidate the previous token in case of compromise. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -537,7 +595,9 @@ async def create( body=await async_maybe_transform( { "name": name, + "client_secret_version": client_secret_version, "duration": duration, + "previous_client_secret_expires_at": previous_client_secret_expires_at, }, service_token_create_params.ServiceTokenCreateParams, ), @@ -555,16 +615,18 @@ async def update( self, service_token_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - duration: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + client_secret_version: float | Omit = omit, + duration: str | Omit = omit, + name: str | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceToken]: """ Updates a configured service token. @@ -576,12 +638,22 @@ async def update( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + client_secret_version: A version number identifying the current `client_secret` associated with the + service token. Incrementing it triggers a rotation; the previous secret will + still be accepted until the time indicated by + `previous_client_secret_expires_at`. + duration: The duration for how long the service token will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h). name: The name of the service token. + previous_client_secret_expires_at: The expiration of the previous `client_secret`. This can be modified at any + point after a rotation. For example, you may extend it further into the future + if you need more time to update services with the new secret; or move it into + the past to immediately invalidate the previous token in case of compromise. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -608,8 +680,10 @@ async def update( f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens/{service_token_id}", body=await async_maybe_transform( { + "client_secret_version": client_secret_version, "duration": duration, "name": name, + "previous_client_secret_expires_at": previous_client_secret_expires_at, }, service_token_update_params.ServiceTokenUpdateParams, ), @@ -626,17 +700,19 @@ async def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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[ServiceToken, AsyncSinglePage[ServiceToken]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ServiceToken, AsyncV4PagePaginationArray[ServiceToken]]: """ Lists all service tokens. @@ -647,6 +723,10 @@ def list( name: The name of the service token. + page: Page number of results. + + per_page: Number of results per page. + search: Search for service tokens by other listed query parameters. extra_headers: Send extra headers @@ -671,7 +751,7 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/service_tokens", - page=AsyncSinglePage[ServiceToken], + page=AsyncV4PagePaginationArray[ServiceToken], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -680,6 +760,8 @@ def list( query=maybe_transform( { "name": name, + "page": page, + "per_page": per_page, "search": search, }, service_token_list_params.ServiceTokenListParams, @@ -692,14 +774,14 @@ async def delete( self, service_token_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceToken]: """ Deletes a service token. @@ -749,14 +831,14 @@ async def get( self, service_token_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceToken]: """ Fetches a single service token. @@ -812,7 +894,7 @@ async def refresh( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceToken]: """ Refreshes the expiration of a service token. @@ -851,12 +933,13 @@ async def rotate( service_token_id: str, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceTokenRotateResponse]: """ Generates a new Client Secret for a service token and revokes the old one. @@ -866,6 +949,9 @@ async def rotate( service_token_id: UUID. + previous_client_secret_expires_at: The expiration of the previous `client_secret`. If not provided, it defaults to + the current timestamp in order to immediately expire the previous secret. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -880,6 +966,10 @@ async def rotate( raise ValueError(f"Expected a non-empty value for `service_token_id` but received {service_token_id!r}") return await self._post( f"/accounts/{account_id}/access/service_tokens/{service_token_id}/rotate", + body=await async_maybe_transform( + {"previous_client_secret_expires_at": previous_client_secret_expires_at}, + service_token_rotate_params.ServiceTokenRotateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/zero_trust/access/tags.py b/src/cloudflare/resources/zero_trust/access/tags.py index 8efb831c668..869d3e13bff 100644 --- a/src/cloudflare/resources/zero_trust/access/tags.py +++ b/src/cloudflare/resources/zero_trust/access/tags.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -17,9 +17,9 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options -from ....types.zero_trust.access import tag_create_params, tag_update_params +from ....types.zero_trust.access import tag_list_params, tag_create_params, tag_update_params from ....types.zero_trust.access.tag import Tag from ....types.zero_trust.access.tag_delete_response import TagDeleteResponse @@ -50,13 +50,13 @@ def create( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Tag]: """ Create a tag @@ -100,7 +100,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Tag]: """ Update a tag @@ -141,19 +141,25 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[Tag]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[Tag]: """ List tags Args: account_id: Identifier. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -166,9 +172,19 @@ def list( 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}/access/tags", - page=SyncSinglePage[Tag], + page=SyncV4PagePaginationArray[Tag], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + tag_list_params.TagListParams, + ), ), model=Tag, ) @@ -183,7 +199,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TagDeleteResponse]: """ Delete a tag @@ -227,7 +243,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Tag]: """ Get a tag @@ -286,13 +302,13 @@ async def create( self, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Tag]: """ Create a tag @@ -336,7 +352,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Tag]: """ Update a tag @@ -377,19 +393,25 @@ def list( self, *, 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. # The extra values given here take precedence over values defined on the client or passed to this 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[Tag, AsyncSinglePage[Tag]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[Tag, AsyncV4PagePaginationArray[Tag]]: """ List tags Args: account_id: Identifier. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -402,9 +424,19 @@ def list( 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}/access/tags", - page=AsyncSinglePage[Tag], + page=AsyncV4PagePaginationArray[Tag], options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + tag_list_params.TagListParams, + ), ), model=Tag, ) @@ -419,7 +451,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TagDeleteResponse]: """ Delete a tag @@ -463,7 +495,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Tag]: """ Get a tag 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 f1d455b6176..fba9194b251 100644 --- a/src/cloudflare/resources/zero_trust/access/users/active_sessions.py +++ b/src/cloudflare/resources/zero_trust/access/users/active_sessions.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -54,7 +54,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ActiveSessionListResponse]: """ Get active sessions for a single user. @@ -96,7 +96,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ActiveSessionGetResponse]: """ Get an active session for a single user. @@ -163,7 +163,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ActiveSessionListResponse, AsyncSinglePage[ActiveSessionListResponse]]: """ Get active sessions for a single user. @@ -205,7 +205,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ActiveSessionGetResponse]: """ Get an active session for a single user. 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 219380389b9..34131b36ae4 100644 --- a/src/cloudflare/resources/zero_trust/access/users/failed_logins.py +++ b/src/cloudflare/resources/zero_trust/access/users/failed_logins.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -50,7 +50,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FailedLoginListResponse]: """ Get all failed login attempts for a single user. @@ -112,7 +112,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FailedLoginListResponse, AsyncSinglePage[FailedLoginListResponse]]: """ Get all failed login attempts for a single user. 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 5d3907f8327..8ed147fdd5d 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 @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Identity]: """ Get last seen identity for a single user. @@ -117,7 +117,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Identity]: """ Get last seen identity for a single user. diff --git a/src/cloudflare/resources/zero_trust/access/users/users.py b/src/cloudflare/resources/zero_trust/access/users/users.py index 4f011139fc2..515fed442eb 100644 --- a/src/cloudflare/resources/zero_trust/access/users/users.py +++ b/src/cloudflare/resources/zero_trust/access/users/users.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -22,7 +22,7 @@ FailedLoginsResourceWithStreamingResponse, AsyncFailedLoginsResourceWithStreamingResponse, ) -from .....pagination import SyncSinglePage, AsyncSinglePage +from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from .active_sessions import ( ActiveSessionsResource, AsyncActiveSessionsResource, @@ -82,16 +82,18 @@ def list( self, *, account_id: str, - email: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + email: str | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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, - ) -> SyncSinglePage[UserListResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[UserListResponse]: """ Gets a list of users for an account. @@ -102,6 +104,10 @@ def list( name: The name of the user. + page: Page number of results. + + per_page: Number of results per page. + search: Search for users by other listed query parameters. extra_headers: Send extra headers @@ -116,7 +122,7 @@ def list( 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}/access/users", - page=SyncSinglePage[UserListResponse], + page=SyncV4PagePaginationArray[UserListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -126,6 +132,8 @@ def list( { "email": email, "name": name, + "page": page, + "per_page": per_page, "search": search, }, user_list_params.UserListParams, @@ -171,16 +179,18 @@ def list( self, *, account_id: str, - email: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, + email: str | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + search: 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[UserListResponse, AsyncSinglePage[UserListResponse]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[UserListResponse, AsyncV4PagePaginationArray[UserListResponse]]: """ Gets a list of users for an account. @@ -191,6 +201,10 @@ def list( name: The name of the user. + page: Page number of results. + + per_page: Number of results per page. + search: Search for users by other listed query parameters. extra_headers: Send extra headers @@ -205,7 +219,7 @@ def list( 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}/access/users", - page=AsyncSinglePage[UserListResponse], + page=AsyncV4PagePaginationArray[UserListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -215,6 +229,8 @@ def list( { "email": email, "name": name, + "page": page, + "per_page": per_page, "search": search, }, user_list_params.UserListParams, diff --git a/src/cloudflare/resources/zero_trust/connectivity/__init__.py b/src/cloudflare/resources/zero_trust/connectivity/__init__.py new file mode 100644 index 00000000000..3cfa691be6c --- /dev/null +++ b/src/cloudflare/resources/zero_trust/connectivity/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .directory import ( + DirectoryResource, + AsyncDirectoryResource, + DirectoryResourceWithRawResponse, + AsyncDirectoryResourceWithRawResponse, + DirectoryResourceWithStreamingResponse, + AsyncDirectoryResourceWithStreamingResponse, +) +from .connectivity import ( + ConnectivityResource, + AsyncConnectivityResource, + ConnectivityResourceWithRawResponse, + AsyncConnectivityResourceWithRawResponse, + ConnectivityResourceWithStreamingResponse, + AsyncConnectivityResourceWithStreamingResponse, +) + +__all__ = [ + "DirectoryResource", + "AsyncDirectoryResource", + "DirectoryResourceWithRawResponse", + "AsyncDirectoryResourceWithRawResponse", + "DirectoryResourceWithStreamingResponse", + "AsyncDirectoryResourceWithStreamingResponse", + "ConnectivityResource", + "AsyncConnectivityResource", + "ConnectivityResourceWithRawResponse", + "AsyncConnectivityResourceWithRawResponse", + "ConnectivityResourceWithStreamingResponse", + "AsyncConnectivityResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zero_trust/connectivity/connectivity.py b/src/cloudflare/resources/zero_trust/connectivity/connectivity.py new file mode 100644 index 00000000000..b4aa841c7a7 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/connectivity/connectivity.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from .directory.directory import ( + DirectoryResource, + AsyncDirectoryResource, + DirectoryResourceWithRawResponse, + AsyncDirectoryResourceWithRawResponse, + DirectoryResourceWithStreamingResponse, + AsyncDirectoryResourceWithStreamingResponse, +) + +__all__ = ["ConnectivityResource", "AsyncConnectivityResource"] + + +class ConnectivityResource(SyncAPIResource): + @cached_property + def directory(self) -> DirectoryResource: + return DirectoryResource(self._client) + + @cached_property + def with_raw_response(self) -> ConnectivityResourceWithRawResponse: + """ + 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 ConnectivityResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ConnectivityResourceWithStreamingResponse: + """ + 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 ConnectivityResourceWithStreamingResponse(self) + + +class AsyncConnectivityResource(AsyncAPIResource): + @cached_property + def directory(self) -> AsyncDirectoryResource: + return AsyncDirectoryResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncConnectivityResourceWithRawResponse: + """ + 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 AsyncConnectivityResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncConnectivityResourceWithStreamingResponse: + """ + 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 AsyncConnectivityResourceWithStreamingResponse(self) + + +class ConnectivityResourceWithRawResponse: + def __init__(self, connectivity: ConnectivityResource) -> None: + self._connectivity = connectivity + + @cached_property + def directory(self) -> DirectoryResourceWithRawResponse: + return DirectoryResourceWithRawResponse(self._connectivity.directory) + + +class AsyncConnectivityResourceWithRawResponse: + def __init__(self, connectivity: AsyncConnectivityResource) -> None: + self._connectivity = connectivity + + @cached_property + def directory(self) -> AsyncDirectoryResourceWithRawResponse: + return AsyncDirectoryResourceWithRawResponse(self._connectivity.directory) + + +class ConnectivityResourceWithStreamingResponse: + def __init__(self, connectivity: ConnectivityResource) -> None: + self._connectivity = connectivity + + @cached_property + def directory(self) -> DirectoryResourceWithStreamingResponse: + return DirectoryResourceWithStreamingResponse(self._connectivity.directory) + + +class AsyncConnectivityResourceWithStreamingResponse: + def __init__(self, connectivity: AsyncConnectivityResource) -> None: + self._connectivity = connectivity + + @cached_property + def directory(self) -> AsyncDirectoryResourceWithStreamingResponse: + return AsyncDirectoryResourceWithStreamingResponse(self._connectivity.directory) diff --git a/src/cloudflare/resources/zero_trust/connectivity/directory/__init__.py b/src/cloudflare/resources/zero_trust/connectivity/directory/__init__.py new file mode 100644 index 00000000000..80fc8709b04 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/connectivity/directory/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .services import ( + ServicesResource, + AsyncServicesResource, + ServicesResourceWithRawResponse, + AsyncServicesResourceWithRawResponse, + ServicesResourceWithStreamingResponse, + AsyncServicesResourceWithStreamingResponse, +) +from .directory import ( + DirectoryResource, + AsyncDirectoryResource, + DirectoryResourceWithRawResponse, + AsyncDirectoryResourceWithRawResponse, + DirectoryResourceWithStreamingResponse, + AsyncDirectoryResourceWithStreamingResponse, +) + +__all__ = [ + "ServicesResource", + "AsyncServicesResource", + "ServicesResourceWithRawResponse", + "AsyncServicesResourceWithRawResponse", + "ServicesResourceWithStreamingResponse", + "AsyncServicesResourceWithStreamingResponse", + "DirectoryResource", + "AsyncDirectoryResource", + "DirectoryResourceWithRawResponse", + "AsyncDirectoryResourceWithRawResponse", + "DirectoryResourceWithStreamingResponse", + "AsyncDirectoryResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zero_trust/connectivity/directory/directory.py b/src/cloudflare/resources/zero_trust/connectivity/directory/directory.py new file mode 100644 index 00000000000..a0a5c4d3949 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/connectivity/directory/directory.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .services import ( + ServicesResource, + AsyncServicesResource, + ServicesResourceWithRawResponse, + AsyncServicesResourceWithRawResponse, + ServicesResourceWithStreamingResponse, + AsyncServicesResourceWithStreamingResponse, +) +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["DirectoryResource", "AsyncDirectoryResource"] + + +class DirectoryResource(SyncAPIResource): + @cached_property + def services(self) -> ServicesResource: + return ServicesResource(self._client) + + @cached_property + def with_raw_response(self) -> DirectoryResourceWithRawResponse: + """ + 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 DirectoryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DirectoryResourceWithStreamingResponse: + """ + 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 DirectoryResourceWithStreamingResponse(self) + + +class AsyncDirectoryResource(AsyncAPIResource): + @cached_property + def services(self) -> AsyncServicesResource: + return AsyncServicesResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncDirectoryResourceWithRawResponse: + """ + 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 AsyncDirectoryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDirectoryResourceWithStreamingResponse: + """ + 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 AsyncDirectoryResourceWithStreamingResponse(self) + + +class DirectoryResourceWithRawResponse: + def __init__(self, directory: DirectoryResource) -> None: + self._directory = directory + + @cached_property + def services(self) -> ServicesResourceWithRawResponse: + return ServicesResourceWithRawResponse(self._directory.services) + + +class AsyncDirectoryResourceWithRawResponse: + def __init__(self, directory: AsyncDirectoryResource) -> None: + self._directory = directory + + @cached_property + def services(self) -> AsyncServicesResourceWithRawResponse: + return AsyncServicesResourceWithRawResponse(self._directory.services) + + +class DirectoryResourceWithStreamingResponse: + def __init__(self, directory: DirectoryResource) -> None: + self._directory = directory + + @cached_property + def services(self) -> ServicesResourceWithStreamingResponse: + return ServicesResourceWithStreamingResponse(self._directory.services) + + +class AsyncDirectoryResourceWithStreamingResponse: + def __init__(self, directory: AsyncDirectoryResource) -> None: + self._directory = directory + + @cached_property + def services(self) -> AsyncServicesResourceWithStreamingResponse: + return AsyncServicesResourceWithStreamingResponse(self._directory.services) diff --git a/src/cloudflare/resources/zero_trust/connectivity/directory/services.py b/src/cloudflare/resources/zero_trust/connectivity/directory/services.py new file mode 100644 index 00000000000..b809a44fd8b --- /dev/null +++ b/src/cloudflare/resources/zero_trust/connectivity/directory/services.py @@ -0,0 +1,639 @@ +# 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, NoneType, 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.zero_trust.connectivity.directory import ( + service_list_params, + service_create_params, + service_update_params, +) +from .....types.zero_trust.connectivity.directory.service_get_response import ServiceGetResponse +from .....types.zero_trust.connectivity.directory.service_list_response import ServiceListResponse +from .....types.zero_trust.connectivity.directory.service_create_response import ServiceCreateResponse +from .....types.zero_trust.connectivity.directory.service_update_response import ServiceUpdateResponse + +__all__ = ["ServicesResource", "AsyncServicesResource"] + + +class ServicesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ServicesResourceWithRawResponse: + """ + 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 ServicesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: + """ + 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 ServicesResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + host: service_create_params.Host, + name: str, + type: Literal["http"], + http_port: Optional[int] | Omit = omit, + https_port: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[ServiceCreateResponse]: + """ + Create connectivity service + + Args: + account_id: Account 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 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}/connectivity/directory/services", + body=maybe_transform( + { + "host": host, + "name": name, + "type": type, + "http_port": http_port, + "https_port": https_port, + }, + service_create_params.ServiceCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[ServiceCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[ServiceCreateResponse]], ResultWrapper[ServiceCreateResponse]), + ) + + def update( + self, + service_id: str, + *, + account_id: str, + host: service_update_params.Host, + name: str, + type: Literal["http"], + http_port: Optional[int] | Omit = omit, + https_port: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[ServiceUpdateResponse]: + """ + Update connectivity service + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not service_id: + raise ValueError(f"Expected a non-empty value for `service_id` but received {service_id!r}") + return self._put( + f"/accounts/{account_id}/connectivity/directory/services/{service_id}", + body=maybe_transform( + { + "host": host, + "name": name, + "type": type, + "http_port": http_port, + "https_port": https_port, + }, + service_update_params.ServiceUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[ServiceUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[ServiceUpdateResponse]], ResultWrapper[ServiceUpdateResponse]), + ) + + def list( + self, + *, + account_id: str, + page: int | Omit = omit, + per_page: int | Omit = omit, + type: Optional[Literal["http"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[ServiceListResponse]: + """ + List connectivity services + + Args: + account_id: Account identifier + + page: Current page in the response + + per_page: Max amount of entries returned 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 + """ + if 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}/connectivity/directory/services", + page=SyncV4PagePaginationArray[ServiceListResponse], + 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, + "type": type, + }, + service_list_params.ServiceListParams, + ), + ), + model=ServiceListResponse, + ) + + def delete( + self, + service_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, + ) -> None: + """ + Delete connectivity service + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not service_id: + raise ValueError(f"Expected a non-empty value for `service_id` but received {service_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + f"/accounts/{account_id}/connectivity/directory/services/{service_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + def get( + self, + service_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, + ) -> Optional[ServiceGetResponse]: + """ + Get connectivity service + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not service_id: + raise ValueError(f"Expected a non-empty value for `service_id` but received {service_id!r}") + return self._get( + f"/accounts/{account_id}/connectivity/directory/services/{service_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[ServiceGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[ServiceGetResponse]], ResultWrapper[ServiceGetResponse]), + ) + + +class AsyncServicesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncServicesResourceWithRawResponse: + """ + 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 AsyncServicesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: + """ + 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 AsyncServicesResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + host: service_create_params.Host, + name: str, + type: Literal["http"], + http_port: Optional[int] | Omit = omit, + https_port: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[ServiceCreateResponse]: + """ + Create connectivity service + + Args: + account_id: Account 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 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}/connectivity/directory/services", + body=await async_maybe_transform( + { + "host": host, + "name": name, + "type": type, + "http_port": http_port, + "https_port": https_port, + }, + service_create_params.ServiceCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[ServiceCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[ServiceCreateResponse]], ResultWrapper[ServiceCreateResponse]), + ) + + async def update( + self, + service_id: str, + *, + account_id: str, + host: service_update_params.Host, + name: str, + type: Literal["http"], + http_port: Optional[int] | Omit = omit, + https_port: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[ServiceUpdateResponse]: + """ + Update connectivity service + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not service_id: + raise ValueError(f"Expected a non-empty value for `service_id` but received {service_id!r}") + return await self._put( + f"/accounts/{account_id}/connectivity/directory/services/{service_id}", + body=await async_maybe_transform( + { + "host": host, + "name": name, + "type": type, + "http_port": http_port, + "https_port": https_port, + }, + service_update_params.ServiceUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[ServiceUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[ServiceUpdateResponse]], ResultWrapper[ServiceUpdateResponse]), + ) + + def list( + self, + *, + account_id: str, + page: int | Omit = omit, + per_page: int | Omit = omit, + type: Optional[Literal["http"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[ServiceListResponse, AsyncV4PagePaginationArray[ServiceListResponse]]: + """ + List connectivity services + + Args: + account_id: Account identifier + + page: Current page in the response + + per_page: Max amount of entries returned 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 + """ + if 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}/connectivity/directory/services", + page=AsyncV4PagePaginationArray[ServiceListResponse], + 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, + "type": type, + }, + service_list_params.ServiceListParams, + ), + ), + model=ServiceListResponse, + ) + + async def delete( + self, + service_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, + ) -> None: + """ + Delete connectivity service + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not service_id: + raise ValueError(f"Expected a non-empty value for `service_id` but received {service_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + f"/accounts/{account_id}/connectivity/directory/services/{service_id}", + 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, + service_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, + ) -> Optional[ServiceGetResponse]: + """ + Get connectivity service + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not service_id: + raise ValueError(f"Expected a non-empty value for `service_id` but received {service_id!r}") + return await self._get( + f"/accounts/{account_id}/connectivity/directory/services/{service_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[ServiceGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[ServiceGetResponse]], ResultWrapper[ServiceGetResponse]), + ) + + +class ServicesResourceWithRawResponse: + def __init__(self, services: ServicesResource) -> None: + self._services = services + + self.create = to_raw_response_wrapper( + services.create, + ) + self.update = to_raw_response_wrapper( + services.update, + ) + self.list = to_raw_response_wrapper( + services.list, + ) + self.delete = to_raw_response_wrapper( + services.delete, + ) + self.get = to_raw_response_wrapper( + services.get, + ) + + +class AsyncServicesResourceWithRawResponse: + def __init__(self, services: AsyncServicesResource) -> None: + self._services = services + + self.create = async_to_raw_response_wrapper( + services.create, + ) + self.update = async_to_raw_response_wrapper( + services.update, + ) + self.list = async_to_raw_response_wrapper( + services.list, + ) + self.delete = async_to_raw_response_wrapper( + services.delete, + ) + self.get = async_to_raw_response_wrapper( + services.get, + ) + + +class ServicesResourceWithStreamingResponse: + def __init__(self, services: ServicesResource) -> None: + self._services = services + + self.create = to_streamed_response_wrapper( + services.create, + ) + self.update = to_streamed_response_wrapper( + services.update, + ) + self.list = to_streamed_response_wrapper( + services.list, + ) + self.delete = to_streamed_response_wrapper( + services.delete, + ) + self.get = to_streamed_response_wrapper( + services.get, + ) + + +class AsyncServicesResourceWithStreamingResponse: + def __init__(self, services: AsyncServicesResource) -> None: + self._services = services + + self.create = async_to_streamed_response_wrapper( + services.create, + ) + self.update = async_to_streamed_response_wrapper( + services.update, + ) + self.list = async_to_streamed_response_wrapper( + services.list, + ) + self.delete = async_to_streamed_response_wrapper( + services.delete, + ) + self.get = async_to_streamed_response_wrapper( + services.get, + ) diff --git a/src/cloudflare/resources/zero_trust/connectivity_settings.py b/src/cloudflare/resources/zero_trust/connectivity_settings.py index 6f6b177b0d3..5e91980161b 100644 --- a/src/cloudflare/resources/zero_trust/connectivity_settings.py +++ b/src/cloudflare/resources/zero_trust/connectivity_settings.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,14 +49,14 @@ def edit( self, *, account_id: str, - icmp_proxy_enabled: bool | NotGiven = NOT_GIVEN, - offramp_warp_enabled: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectivitySettingEditResponse: """ Updates the Zero Trust Connectivity Settings for the given account. @@ -106,7 +106,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectivitySettingGetResponse: """ Gets the Zero Trust Connectivity Settings for the given account. @@ -161,14 +161,14 @@ async def edit( self, *, account_id: str, - icmp_proxy_enabled: bool | NotGiven = NOT_GIVEN, - offramp_warp_enabled: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectivitySettingEditResponse: """ Updates the Zero Trust Connectivity Settings for the given account. @@ -218,7 +218,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConnectivitySettingGetResponse: """ Gets the Zero Trust Connectivity Settings for the given account. diff --git a/src/cloudflare/resources/zero_trust/devices/devices.py b/src/cloudflare/resources/zero_trust/devices/devices.py index f0a289fbea0..ce53ece99fb 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices.py +++ b/src/cloudflare/resources/zero_trust/devices/devices.py @@ -40,7 +40,7 @@ UnrevokeResourceWithStreamingResponse, AsyncUnrevokeResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from .dex_tests import ( DEXTestsResource, AsyncDEXTestsResource, @@ -192,7 +192,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Device]: """List WARP devices. @@ -236,7 +236,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceGetResponse]: """Fetches a single WARP device. @@ -356,7 +356,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Device, AsyncSinglePage[Device]]: """List WARP devices. @@ -400,7 +400,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceGetResponse]: """Fetches a single WARP device. @@ -448,12 +448,12 @@ def __init__(self, devices: DevicesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - devices.list # pyright: ignore[reportDeprecated], + devices.list, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - devices.get # pyright: ignore[reportDeprecated], + devices.get, # pyright: ignore[reportDeprecated], ) ) @@ -512,12 +512,12 @@ def __init__(self, devices: AsyncDevicesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - devices.list # pyright: ignore[reportDeprecated], + devices.list, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - devices.get # pyright: ignore[reportDeprecated], + devices.get, # pyright: ignore[reportDeprecated], ) ) @@ -576,12 +576,12 @@ def __init__(self, devices: DevicesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - devices.list # pyright: ignore[reportDeprecated], + devices.list, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - devices.get # pyright: ignore[reportDeprecated], + devices.get, # pyright: ignore[reportDeprecated], ) ) @@ -640,12 +640,12 @@ def __init__(self, devices: AsyncDevicesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - devices.list # pyright: ignore[reportDeprecated], + devices.list, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - devices.get # pyright: ignore[reportDeprecated], + devices.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/zero_trust/devices/devices_.py b/src/cloudflare/resources/zero_trust/devices/devices_.py index 82113483ab9..68ceefcdf58 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices_.py +++ b/src/cloudflare/resources/zero_trust/devices/devices_.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import maybe_transform +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 ( @@ -20,7 +20,7 @@ from ...._wrappers import ResultWrapper from ....pagination import SyncCursorPagination, AsyncCursorPagination from ...._base_client import AsyncPaginator, make_request_options -from ....types.zero_trust.devices import device_list_params +from ....types.zero_trust.devices import device_get_params, device_list_params from ....types.zero_trust.devices.device_get_response import DeviceGetResponse from ....types.zero_trust.devices.device_list_response import DeviceListResponse @@ -51,26 +51,26 @@ def list( self, *, account_id: str, - id: List[str] | NotGiven = NOT_GIVEN, - active_registrations: Literal["include", "only", "exclude"] | NotGiven = NOT_GIVEN, - cursor: str | NotGiven = NOT_GIVEN, - include: str | NotGiven = NOT_GIVEN, - last_seen_user: device_list_params.LastSeenUser | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - seen_after: str | NotGiven = NOT_GIVEN, - seen_before: str | NotGiven = NOT_GIVEN, + id: SequenceNotStr[str] | Omit = omit, + active_registrations: Literal["include", "only", "exclude"] | Omit = omit, + cursor: str | Omit = omit, + include: str | Omit = omit, + last_seen_user: device_list_params.LastSeenUser | Omit = omit, + per_page: int | Omit = omit, + search: str | Omit = omit, + seen_after: str | Omit = omit, + seen_before: str | Omit = omit, sort_by: Literal[ "name", "id", "client_version", "last_seen_user.email", "last_seen_at", "active_registrations", "created_at" ] - | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursorPagination[DeviceListResponse]: """ Lists WARP devices. @@ -85,11 +85,14 @@ def list( records. A cursor value can be obtained from the result_info.cursor field in the response. + include: Comma-separated list of additional information that should be included in the + device response. Supported values are: "last_seen_registration.policy". + per_page: The maximum number of devices to return in a single response. search: Search by device details. - seen_after: Filters by the last_seen timestamp - returns only devices last seen after this + seen_after: Filter by the last_seen timestamp - returns only devices last seen after this timestamp. seen_before: Filter by the last_seen timestamp - returns only devices last seen before this @@ -147,7 +150,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a WARP device. @@ -182,17 +185,21 @@ def get( device_id: str, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DeviceGetResponse: """ Fetches a single WARP device. Args: + include: Comma-separated list of additional information that should be included in the + device response. Supported values are: "last_seen_registration.policy". + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -212,6 +219,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform({"include": include}, device_get_params.DeviceGetParams), post_parser=ResultWrapper[DeviceGetResponse]._unwrapper, ), cast_to=cast(Type[DeviceGetResponse], ResultWrapper[DeviceGetResponse]), @@ -227,7 +235,7 @@ def revoke( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Revokes all WARP registrations associated with the specified device. @@ -282,26 +290,26 @@ def list( self, *, account_id: str, - id: List[str] | NotGiven = NOT_GIVEN, - active_registrations: Literal["include", "only", "exclude"] | NotGiven = NOT_GIVEN, - cursor: str | NotGiven = NOT_GIVEN, - include: str | NotGiven = NOT_GIVEN, - last_seen_user: device_list_params.LastSeenUser | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - seen_after: str | NotGiven = NOT_GIVEN, - seen_before: str | NotGiven = NOT_GIVEN, + id: SequenceNotStr[str] | Omit = omit, + active_registrations: Literal["include", "only", "exclude"] | Omit = omit, + cursor: str | Omit = omit, + include: str | Omit = omit, + last_seen_user: device_list_params.LastSeenUser | Omit = omit, + per_page: int | Omit = omit, + search: str | Omit = omit, + seen_after: str | Omit = omit, + seen_before: str | Omit = omit, sort_by: Literal[ "name", "id", "client_version", "last_seen_user.email", "last_seen_at", "active_registrations", "created_at" ] - | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DeviceListResponse, AsyncCursorPagination[DeviceListResponse]]: """ Lists WARP devices. @@ -316,11 +324,14 @@ def list( records. A cursor value can be obtained from the result_info.cursor field in the response. + include: Comma-separated list of additional information that should be included in the + device response. Supported values are: "last_seen_registration.policy". + per_page: The maximum number of devices to return in a single response. search: Search by device details. - seen_after: Filters by the last_seen timestamp - returns only devices last seen after this + seen_after: Filter by the last_seen timestamp - returns only devices last seen after this timestamp. seen_before: Filter by the last_seen timestamp - returns only devices last seen before this @@ -378,7 +389,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a WARP device. @@ -413,17 +424,21 @@ async def get( device_id: str, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DeviceGetResponse: """ Fetches a single WARP device. Args: + include: Comma-separated list of additional information that should be included in the + device response. Supported values are: "last_seen_registration.policy". + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -443,6 +458,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=await async_maybe_transform({"include": include}, device_get_params.DeviceGetParams), post_parser=ResultWrapper[DeviceGetResponse]._unwrapper, ), cast_to=cast(Type[DeviceGetResponse], ResultWrapper[DeviceGetResponse]), @@ -458,7 +474,7 @@ async def revoke( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Revokes all WARP registrations associated with the specified device. diff --git a/src/cloudflare/resources/zero_trust/devices/dex_tests.py b/src/cloudflare/resources/zero_trust/devices/dex_tests.py index 241e238dee1..23802a6b093 100644 --- a/src/cloudflare/resources/zero_trust/devices/dex_tests.py +++ b/src/cloudflare/resources/zero_trust/devices/dex_tests.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -57,15 +57,15 @@ def create( enabled: bool, interval: str, name: str, - description: str | NotGiven = NOT_GIVEN, - target_policies: Iterable[dex_test_create_params.TargetPolicy] | NotGiven = NOT_GIVEN, - targeted: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + target_policies: Iterable[dex_test_create_params.TargetPolicy] | Omit = omit, + targeted: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DEXTestCreateResponse]: """ Create a DEX test. @@ -127,15 +127,15 @@ def update( enabled: bool, interval: str, name: str, - description: str | NotGiven = NOT_GIVEN, - target_policies: Iterable[dex_test_update_params.TargetPolicy] | NotGiven = NOT_GIVEN, - targeted: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + target_policies: Iterable[dex_test_update_params.TargetPolicy] | Omit = omit, + targeted: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DEXTestUpdateResponse]: """ Update a DEX test. @@ -201,10 +201,10 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DEXTestListResponse]: """ - Fetch all DEX tests. + Fetch all DEX tests Args: extra_headers: Send extra headers @@ -236,7 +236,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DEXTestDeleteResponse]: """Delete a Device DEX test. @@ -280,7 +280,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DEXTestGetResponse]: """ Fetch a single DEX test. @@ -341,15 +341,15 @@ async def create( enabled: bool, interval: str, name: str, - description: str | NotGiven = NOT_GIVEN, - target_policies: Iterable[dex_test_create_params.TargetPolicy] | NotGiven = NOT_GIVEN, - targeted: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + target_policies: Iterable[dex_test_create_params.TargetPolicy] | Omit = omit, + targeted: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DEXTestCreateResponse]: """ Create a DEX test. @@ -411,15 +411,15 @@ async def update( enabled: bool, interval: str, name: str, - description: str | NotGiven = NOT_GIVEN, - target_policies: Iterable[dex_test_update_params.TargetPolicy] | NotGiven = NOT_GIVEN, - targeted: bool | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + target_policies: Iterable[dex_test_update_params.TargetPolicy] | Omit = omit, + targeted: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DEXTestUpdateResponse]: """ Update a DEX test. @@ -485,10 +485,10 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DEXTestListResponse, AsyncSinglePage[DEXTestListResponse]]: """ - Fetch all DEX tests. + Fetch all DEX tests Args: extra_headers: Send extra headers @@ -520,7 +520,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DEXTestDeleteResponse]: """Delete a Device DEX test. @@ -564,7 +564,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DEXTestGetResponse]: """ Fetch a single DEX test. diff --git a/src/cloudflare/resources/zero_trust/devices/fleet_status.py b/src/cloudflare/resources/zero_trust/devices/fleet_status.py index 69e529756f4..993e9e1cb1b 100644 --- a/src/cloudflare/resources/zero_trust/devices/fleet_status.py +++ b/src/cloudflare/resources/zero_trust/devices/fleet_status.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -47,14 +47,14 @@ def get( *, account_id: str, since_minutes: float, - colo: str | NotGiven = NOT_GIVEN, - time_now: str | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + time_now: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FleetStatusGetResponse: """ Get the live status of a latest device given device_id from the device_state @@ -127,14 +127,14 @@ async def get( *, account_id: str, since_minutes: float, - colo: str | NotGiven = NOT_GIVEN, - time_now: str | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + time_now: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FleetStatusGetResponse: """ Get the live status of a latest device given device_id from the device_state diff --git a/src/cloudflare/resources/zero_trust/devices/networks.py b/src/cloudflare/resources/zero_trust/devices/networks.py index 97a3eed27a3..51be71ecb74 100644 --- a/src/cloudflare/resources/zero_trust/devices/networks.py +++ b/src/cloudflare/resources/zero_trust/devices/networks.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,7 +58,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceNetwork]: """ Creates a new device managed network. @@ -106,15 +106,15 @@ def update( network_id: str, *, account_id: str, - config: network_update_params.Config | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - type: Literal["tls"] | NotGiven = NOT_GIVEN, + config: network_update_params.Config | Omit = omit, + name: str | Omit = omit, + type: Literal["tls"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceNetwork]: """ Updates a configured device managed network. @@ -170,7 +170,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DeviceNetwork]: """ Fetches a list of managed networks for an account. @@ -205,7 +205,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DeviceNetwork]: """ Deletes a device managed network and fetches a list of the remaining device @@ -246,7 +246,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceNetwork]: """ Fetches details for a single managed network. @@ -311,7 +311,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceNetwork]: """ Creates a new device managed network. @@ -359,15 +359,15 @@ async def update( network_id: str, *, account_id: str, - config: network_update_params.Config | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - type: Literal["tls"] | NotGiven = NOT_GIVEN, + config: network_update_params.Config | Omit = omit, + name: str | Omit = omit, + type: Literal["tls"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceNetwork]: """ Updates a configured device managed network. @@ -423,7 +423,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DeviceNetwork, AsyncSinglePage[DeviceNetwork]]: """ Fetches a list of managed networks for an account. @@ -458,7 +458,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DeviceNetwork, AsyncSinglePage[DeviceNetwork]]: """ Deletes a device managed network and fetches a list of the remaining device @@ -499,7 +499,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceNetwork]: """ Fetches details for a single managed network. diff --git a/src/cloudflare/resources/zero_trust/devices/override_codes.py b/src/cloudflare/resources/zero_trust/devices/override_codes.py index 7f4e45e7339..405cd081c63 100644 --- a/src/cloudflare/resources/zero_trust/devices/override_codes.py +++ b/src/cloudflare/resources/zero_trust/devices/override_codes.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -55,7 +55,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[object]: """Fetches a one-time use admin override code for a device. @@ -102,7 +102,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OverrideCodeGetResponse: """Fetches one-time use admin override codes for a registration. @@ -166,7 +166,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[object, AsyncSinglePage[object]]: """Fetches a one-time use admin override code for a device. @@ -213,7 +213,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OverrideCodeGetResponse: """Fetches one-time use admin override codes for a registration. @@ -252,7 +252,7 @@ def __init__(self, override_codes: OverrideCodesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - override_codes.list # pyright: ignore[reportDeprecated], + override_codes.list, # pyright: ignore[reportDeprecated], ) ) self.get = to_raw_response_wrapper( @@ -266,7 +266,7 @@ def __init__(self, override_codes: AsyncOverrideCodesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - override_codes.list # pyright: ignore[reportDeprecated], + override_codes.list, # pyright: ignore[reportDeprecated], ) ) self.get = async_to_raw_response_wrapper( @@ -280,7 +280,7 @@ def __init__(self, override_codes: OverrideCodesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - override_codes.list # pyright: ignore[reportDeprecated], + override_codes.list, # pyright: ignore[reportDeprecated], ) ) self.get = to_streamed_response_wrapper( @@ -294,7 +294,7 @@ def __init__(self, override_codes: AsyncOverrideCodesResource) -> None: self.list = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - override_codes.list # pyright: ignore[reportDeprecated], + override_codes.list, # pyright: ignore[reportDeprecated], ) ) self.get = async_to_streamed_response_wrapper( 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 3fe6aa7d649..23dcd074d92 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py @@ -22,7 +22,7 @@ IncludesResourceWithStreamingResponse, AsyncIncludesResourceWithStreamingResponse, ) -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -90,31 +90,31 @@ def create( match: str, name: str, precedence: float, - allow_mode_switch: bool | NotGiven = NOT_GIVEN, - allow_updates: bool | NotGiven = NOT_GIVEN, - allowed_to_leave: bool | NotGiven = NOT_GIVEN, - auto_connect: float | NotGiven = NOT_GIVEN, - captive_portal: float | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_auto_fallback: bool | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[SplitTunnelExcludeParam] | NotGiven = NOT_GIVEN, - exclude_office_ips: bool | NotGiven = NOT_GIVEN, - include: Iterable[SplitTunnelIncludeParam] | NotGiven = NOT_GIVEN, - lan_allow_minutes: float | NotGiven = NOT_GIVEN, - lan_allow_subnet_size: float | NotGiven = NOT_GIVEN, - register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, - sccm_vpn_boundary_support: bool | NotGiven = NOT_GIVEN, - service_mode_v2: custom_create_params.ServiceModeV2 | NotGiven = NOT_GIVEN, - support_url: str | NotGiven = NOT_GIVEN, - switch_locked: bool | NotGiven = NOT_GIVEN, - tunnel_protocol: str | NotGiven = NOT_GIVEN, + allow_mode_switch: bool | Omit = omit, + allow_updates: bool | Omit = omit, + allowed_to_leave: bool | Omit = omit, + auto_connect: float | Omit = omit, + captive_portal: float | Omit = omit, + description: str | Omit = omit, + disable_auto_fallback: bool | Omit = omit, + enabled: bool | Omit = omit, + exclude: Iterable[SplitTunnelExcludeParam] | Omit = omit, + exclude_office_ips: bool | Omit = omit, + include: Iterable[SplitTunnelIncludeParam] | Omit = omit, + lan_allow_minutes: float | Omit = omit, + lan_allow_subnet_size: float | Omit = omit, + register_interface_ip_with_dns: bool | Omit = omit, + sccm_vpn_boundary_support: bool | Omit = omit, + service_mode_v2: custom_create_params.ServiceModeV2 | Omit = omit, + support_url: str | Omit = omit, + switch_locked: bool | Omit = omit, + tunnel_protocol: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingsPolicy]: """ Creates a device settings profile to be applied to certain devices matching the @@ -236,7 +236,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SettingsPolicy]: """ Fetches a list of the device settings profiles for an account. @@ -271,7 +271,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SettingsPolicy]: """ Deletes a device settings profile and fetches a list of the remaining profiles @@ -305,34 +305,34 @@ def edit( policy_id: str, *, account_id: str, - allow_mode_switch: bool | NotGiven = NOT_GIVEN, - allow_updates: bool | NotGiven = NOT_GIVEN, - allowed_to_leave: bool | NotGiven = NOT_GIVEN, - auto_connect: float | NotGiven = NOT_GIVEN, - captive_portal: float | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_auto_fallback: bool | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[SplitTunnelExcludeParam] | NotGiven = NOT_GIVEN, - exclude_office_ips: bool | NotGiven = NOT_GIVEN, - include: Iterable[SplitTunnelIncludeParam] | NotGiven = NOT_GIVEN, - lan_allow_minutes: float | NotGiven = NOT_GIVEN, - lan_allow_subnet_size: float | NotGiven = NOT_GIVEN, - match: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - precedence: float | NotGiven = NOT_GIVEN, - register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, - sccm_vpn_boundary_support: bool | NotGiven = NOT_GIVEN, - service_mode_v2: custom_edit_params.ServiceModeV2 | NotGiven = NOT_GIVEN, - support_url: str | NotGiven = NOT_GIVEN, - switch_locked: bool | NotGiven = NOT_GIVEN, - tunnel_protocol: str | NotGiven = NOT_GIVEN, + allow_mode_switch: bool | Omit = omit, + allow_updates: bool | Omit = omit, + allowed_to_leave: bool | Omit = omit, + auto_connect: float | Omit = omit, + captive_portal: float | Omit = omit, + description: str | Omit = omit, + disable_auto_fallback: bool | Omit = omit, + enabled: bool | Omit = omit, + exclude: Iterable[SplitTunnelExcludeParam] | Omit = omit, + exclude_office_ips: bool | Omit = omit, + include: Iterable[SplitTunnelIncludeParam] | Omit = omit, + lan_allow_minutes: float | Omit = omit, + lan_allow_subnet_size: float | Omit = omit, + match: str | Omit = omit, + name: str | Omit = omit, + precedence: float | Omit = omit, + register_interface_ip_with_dns: bool | Omit = omit, + sccm_vpn_boundary_support: bool | Omit = omit, + service_mode_v2: custom_edit_params.ServiceModeV2 | Omit = omit, + support_url: str | Omit = omit, + switch_locked: bool | Omit = omit, + tunnel_protocol: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingsPolicy]: """ Updates a configured device settings profile. @@ -456,7 +456,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingsPolicy]: """ Fetches a device settings profile by ID. @@ -526,31 +526,31 @@ async def create( match: str, name: str, precedence: float, - allow_mode_switch: bool | NotGiven = NOT_GIVEN, - allow_updates: bool | NotGiven = NOT_GIVEN, - allowed_to_leave: bool | NotGiven = NOT_GIVEN, - auto_connect: float | NotGiven = NOT_GIVEN, - captive_portal: float | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_auto_fallback: bool | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[SplitTunnelExcludeParam] | NotGiven = NOT_GIVEN, - exclude_office_ips: bool | NotGiven = NOT_GIVEN, - include: Iterable[SplitTunnelIncludeParam] | NotGiven = NOT_GIVEN, - lan_allow_minutes: float | NotGiven = NOT_GIVEN, - lan_allow_subnet_size: float | NotGiven = NOT_GIVEN, - register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, - sccm_vpn_boundary_support: bool | NotGiven = NOT_GIVEN, - service_mode_v2: custom_create_params.ServiceModeV2 | NotGiven = NOT_GIVEN, - support_url: str | NotGiven = NOT_GIVEN, - switch_locked: bool | NotGiven = NOT_GIVEN, - tunnel_protocol: str | NotGiven = NOT_GIVEN, + allow_mode_switch: bool | Omit = omit, + allow_updates: bool | Omit = omit, + allowed_to_leave: bool | Omit = omit, + auto_connect: float | Omit = omit, + captive_portal: float | Omit = omit, + description: str | Omit = omit, + disable_auto_fallback: bool | Omit = omit, + enabled: bool | Omit = omit, + exclude: Iterable[SplitTunnelExcludeParam] | Omit = omit, + exclude_office_ips: bool | Omit = omit, + include: Iterable[SplitTunnelIncludeParam] | Omit = omit, + lan_allow_minutes: float | Omit = omit, + lan_allow_subnet_size: float | Omit = omit, + register_interface_ip_with_dns: bool | Omit = omit, + sccm_vpn_boundary_support: bool | Omit = omit, + service_mode_v2: custom_create_params.ServiceModeV2 | Omit = omit, + support_url: str | Omit = omit, + switch_locked: bool | Omit = omit, + tunnel_protocol: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingsPolicy]: """ Creates a device settings profile to be applied to certain devices matching the @@ -672,7 +672,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SettingsPolicy, AsyncSinglePage[SettingsPolicy]]: """ Fetches a list of the device settings profiles for an account. @@ -707,7 +707,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SettingsPolicy, AsyncSinglePage[SettingsPolicy]]: """ Deletes a device settings profile and fetches a list of the remaining profiles @@ -741,34 +741,34 @@ async def edit( policy_id: str, *, account_id: str, - allow_mode_switch: bool | NotGiven = NOT_GIVEN, - allow_updates: bool | NotGiven = NOT_GIVEN, - allowed_to_leave: bool | NotGiven = NOT_GIVEN, - auto_connect: float | NotGiven = NOT_GIVEN, - captive_portal: float | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - disable_auto_fallback: bool | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[SplitTunnelExcludeParam] | NotGiven = NOT_GIVEN, - exclude_office_ips: bool | NotGiven = NOT_GIVEN, - include: Iterable[SplitTunnelIncludeParam] | NotGiven = NOT_GIVEN, - lan_allow_minutes: float | NotGiven = NOT_GIVEN, - lan_allow_subnet_size: float | NotGiven = NOT_GIVEN, - match: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - precedence: float | NotGiven = NOT_GIVEN, - register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, - sccm_vpn_boundary_support: bool | NotGiven = NOT_GIVEN, - service_mode_v2: custom_edit_params.ServiceModeV2 | NotGiven = NOT_GIVEN, - support_url: str | NotGiven = NOT_GIVEN, - switch_locked: bool | NotGiven = NOT_GIVEN, - tunnel_protocol: str | NotGiven = NOT_GIVEN, + allow_mode_switch: bool | Omit = omit, + allow_updates: bool | Omit = omit, + allowed_to_leave: bool | Omit = omit, + auto_connect: float | Omit = omit, + captive_portal: float | Omit = omit, + description: str | Omit = omit, + disable_auto_fallback: bool | Omit = omit, + enabled: bool | Omit = omit, + exclude: Iterable[SplitTunnelExcludeParam] | Omit = omit, + exclude_office_ips: bool | Omit = omit, + include: Iterable[SplitTunnelIncludeParam] | Omit = omit, + lan_allow_minutes: float | Omit = omit, + lan_allow_subnet_size: float | Omit = omit, + match: str | Omit = omit, + name: str | Omit = omit, + precedence: float | Omit = omit, + register_interface_ip_with_dns: bool | Omit = omit, + sccm_vpn_boundary_support: bool | Omit = omit, + service_mode_v2: custom_edit_params.ServiceModeV2 | Omit = omit, + support_url: str | Omit = omit, + switch_locked: bool | Omit = omit, + tunnel_protocol: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingsPolicy]: """ Updates a configured device settings profile. @@ -892,7 +892,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingsPolicy]: """ Fetches a device settings profile by 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 2393b3eab14..d9ad788b570 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Query, Headers, NotGiven, not_given from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource @@ -55,7 +55,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SplitTunnelExclude]: """ Sets the list of routes excluded from the WARP client's tunnel for a specific @@ -95,7 +95,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SplitTunnelExclude]: """ Fetches the list of routes excluded from the WARP client's tunnel for a specific @@ -155,7 +155,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SplitTunnelExclude, AsyncSinglePage[SplitTunnelExclude]]: """ Sets the list of routes excluded from the WARP client's tunnel for a specific @@ -195,7 +195,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SplitTunnelExclude, AsyncSinglePage[SplitTunnelExclude]]: """ Fetches the list of routes excluded from the WARP client's tunnel for a specific 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 30c386ba4d3..1cde309592c 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 @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Query, Headers, NotGiven, not_given from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource @@ -55,7 +55,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FallbackDomain]: """Sets the list of domains to bypass Gateway DNS resolution. @@ -97,7 +97,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FallbackDomain]: """ Fetches the list of domains to bypass Gateway DNS resolution from a specified @@ -158,7 +158,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FallbackDomain, AsyncSinglePage[FallbackDomain]]: """Sets the list of domains to bypass Gateway DNS resolution. @@ -200,7 +200,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FallbackDomain, AsyncSinglePage[FallbackDomain]]: """ Fetches the list of domains to bypass Gateway DNS resolution from a specified 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 08fb8357f26..dff40cf931c 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Query, Headers, NotGiven, not_given from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource @@ -55,7 +55,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SplitTunnelInclude]: """ Sets the list of routes included in the WARP client's tunnel for a specific @@ -95,7 +95,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SplitTunnelInclude]: """ Fetches the list of routes included in the WARP client's tunnel for a specific @@ -155,7 +155,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SplitTunnelInclude, AsyncSinglePage[SplitTunnelInclude]]: """ Sets the list of routes included in the WARP client's tunnel for a specific @@ -195,7 +195,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SplitTunnelInclude, AsyncSinglePage[SplitTunnelInclude]]: """ Fetches the list of routes included in the WARP client's tunnel for a specific 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 e70abe44586..1237c6a47bc 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,7 +54,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DevicePolicyCertificates]: """ Enable Zero Trust Clients to provision a certificate, containing a x509 subject, @@ -97,7 +97,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DevicePolicyCertificates]: """ Fetches device certificate provisioning. @@ -156,7 +156,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DevicePolicyCertificates]: """ Enable Zero Trust Clients to provision a certificate, containing a x509 subject, @@ -199,7 +199,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DevicePolicyCertificates]: """ Fetches device certificate provisioning. 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 4c9b081675e..15d3c7fec8f 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py @@ -22,7 +22,7 @@ IncludesResourceWithStreamingResponse, AsyncIncludesResourceWithStreamingResponse, ) -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .certificates import ( @@ -99,29 +99,29 @@ def edit( self, *, account_id: str, - allow_mode_switch: bool | NotGiven = NOT_GIVEN, - allow_updates: bool | NotGiven = NOT_GIVEN, - allowed_to_leave: bool | NotGiven = NOT_GIVEN, - auto_connect: float | NotGiven = NOT_GIVEN, - captive_portal: float | NotGiven = NOT_GIVEN, - disable_auto_fallback: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[SplitTunnelExcludeParam] | NotGiven = NOT_GIVEN, - exclude_office_ips: bool | NotGiven = NOT_GIVEN, - include: Iterable[SplitTunnelIncludeParam] | NotGiven = NOT_GIVEN, - lan_allow_minutes: float | NotGiven = NOT_GIVEN, - lan_allow_subnet_size: float | NotGiven = NOT_GIVEN, - register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, - sccm_vpn_boundary_support: bool | NotGiven = NOT_GIVEN, - service_mode_v2: default_edit_params.ServiceModeV2 | NotGiven = NOT_GIVEN, - support_url: str | NotGiven = NOT_GIVEN, - switch_locked: bool | NotGiven = NOT_GIVEN, - tunnel_protocol: str | NotGiven = NOT_GIVEN, + allow_mode_switch: bool | Omit = omit, + allow_updates: bool | Omit = omit, + allowed_to_leave: bool | Omit = omit, + auto_connect: float | Omit = omit, + captive_portal: float | Omit = omit, + disable_auto_fallback: bool | Omit = omit, + exclude: Iterable[SplitTunnelExcludeParam] | Omit = omit, + exclude_office_ips: bool | Omit = omit, + include: Iterable[SplitTunnelIncludeParam] | Omit = omit, + lan_allow_minutes: float | Omit = omit, + lan_allow_subnet_size: float | Omit = omit, + register_interface_ip_with_dns: bool | Omit = omit, + sccm_vpn_boundary_support: bool | Omit = omit, + service_mode_v2: default_edit_params.ServiceModeV2 | Omit = omit, + support_url: str | Omit = omit, + switch_locked: bool | Omit = omit, + tunnel_protocol: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DefaultEditResponse]: """ Updates the default device settings profile for an account. @@ -223,7 +223,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DefaultGetResponse]: """ Fetches the default device settings profile for an account. @@ -292,29 +292,29 @@ async def edit( self, *, account_id: str, - allow_mode_switch: bool | NotGiven = NOT_GIVEN, - allow_updates: bool | NotGiven = NOT_GIVEN, - allowed_to_leave: bool | NotGiven = NOT_GIVEN, - auto_connect: float | NotGiven = NOT_GIVEN, - captive_portal: float | NotGiven = NOT_GIVEN, - disable_auto_fallback: bool | NotGiven = NOT_GIVEN, - exclude: Iterable[SplitTunnelExcludeParam] | NotGiven = NOT_GIVEN, - exclude_office_ips: bool | NotGiven = NOT_GIVEN, - include: Iterable[SplitTunnelIncludeParam] | NotGiven = NOT_GIVEN, - lan_allow_minutes: float | NotGiven = NOT_GIVEN, - lan_allow_subnet_size: float | NotGiven = NOT_GIVEN, - register_interface_ip_with_dns: bool | NotGiven = NOT_GIVEN, - sccm_vpn_boundary_support: bool | NotGiven = NOT_GIVEN, - service_mode_v2: default_edit_params.ServiceModeV2 | NotGiven = NOT_GIVEN, - support_url: str | NotGiven = NOT_GIVEN, - switch_locked: bool | NotGiven = NOT_GIVEN, - tunnel_protocol: str | NotGiven = NOT_GIVEN, + allow_mode_switch: bool | Omit = omit, + allow_updates: bool | Omit = omit, + allowed_to_leave: bool | Omit = omit, + auto_connect: float | Omit = omit, + captive_portal: float | Omit = omit, + disable_auto_fallback: bool | Omit = omit, + exclude: Iterable[SplitTunnelExcludeParam] | Omit = omit, + exclude_office_ips: bool | Omit = omit, + include: Iterable[SplitTunnelIncludeParam] | Omit = omit, + lan_allow_minutes: float | Omit = omit, + lan_allow_subnet_size: float | Omit = omit, + register_interface_ip_with_dns: bool | Omit = omit, + sccm_vpn_boundary_support: bool | Omit = omit, + service_mode_v2: default_edit_params.ServiceModeV2 | Omit = omit, + support_url: str | Omit = omit, + switch_locked: bool | Omit = omit, + tunnel_protocol: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DefaultEditResponse]: """ Updates the default device settings profile for an account. @@ -416,7 +416,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DefaultGetResponse]: """ Fetches the default device settings profile for an account. 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 5b607d24e5f..67461b4415a 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Query, Headers, NotGiven, not_given from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource @@ -54,7 +54,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SplitTunnelExclude]: """ Sets the list of routes excluded from the WARP client's tunnel. @@ -90,7 +90,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SplitTunnelExclude]: """ Fetches the list of routes excluded from the WARP client's tunnel. @@ -146,7 +146,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SplitTunnelExclude, AsyncSinglePage[SplitTunnelExclude]]: """ Sets the list of routes excluded from the WARP client's tunnel. @@ -182,7 +182,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SplitTunnelExclude, AsyncSinglePage[SplitTunnelExclude]]: """ Fetches the list of routes excluded from the WARP client's tunnel. 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 7903025fae8..bb8d5f0c2a9 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 @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Query, Headers, NotGiven, not_given from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource @@ -54,7 +54,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FallbackDomain]: """Sets the list of domains to bypass Gateway DNS resolution. @@ -92,7 +92,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[FallbackDomain]: """Fetches a list of domains to bypass Gateway DNS resolution. @@ -150,7 +150,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FallbackDomain, AsyncSinglePage[FallbackDomain]]: """Sets the list of domains to bypass Gateway DNS resolution. @@ -188,7 +188,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[FallbackDomain, AsyncSinglePage[FallbackDomain]]: """Fetches a list of domains to bypass Gateway DNS resolution. 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 9dacfd40d10..1e0fcd34b8a 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py @@ -6,7 +6,7 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Query, Headers, NotGiven, not_given from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource @@ -54,7 +54,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SplitTunnelInclude]: """ Sets the list of routes included in the WARP client's tunnel. @@ -90,7 +90,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[SplitTunnelInclude]: """ Fetches the list of routes included in the WARP client's tunnel. @@ -146,7 +146,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SplitTunnelInclude, AsyncSinglePage[SplitTunnelInclude]]: """ Sets the list of routes included in the WARP client's tunnel. @@ -182,7 +182,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SplitTunnelInclude, AsyncSinglePage[SplitTunnelInclude]]: """ Fetches the list of routes included in the WARP client's tunnel. diff --git a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py index b2aa69855b3..233d4828cc0 100644 --- a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py +++ b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py @@ -7,7 +7,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -69,7 +69,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Integration]: """ Create a new device posture integration. @@ -124,7 +124,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Integration]: """ Fetches the list of device posture integrations for an account. @@ -159,7 +159,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IntegrationDeleteResponse]: """ Delete a configured device posture integration. @@ -201,9 +201,9 @@ def edit( integration_id: str, *, account_id: str, - config: integration_edit_params.Config | NotGiven = NOT_GIVEN, - interval: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + config: integration_edit_params.Config | Omit = omit, + interval: str | Omit = omit, + name: str | Omit = omit, type: Literal[ "workspace_one", "crowdstrike_s2s", @@ -214,13 +214,13 @@ def edit( "sentinelone_s2s", "custom_s2s", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Integration]: """ Updates a configured device posture integration. @@ -280,7 +280,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Integration]: """ Fetches details for a single device posture integration. @@ -355,7 +355,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Integration]: """ Create a new device posture integration. @@ -410,7 +410,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Integration, AsyncSinglePage[Integration]]: """ Fetches the list of device posture integrations for an account. @@ -445,7 +445,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IntegrationDeleteResponse]: """ Delete a configured device posture integration. @@ -487,9 +487,9 @@ async def edit( integration_id: str, *, account_id: str, - config: integration_edit_params.Config | NotGiven = NOT_GIVEN, - interval: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + config: integration_edit_params.Config | Omit = omit, + interval: str | Omit = omit, + name: str | Omit = omit, type: Literal[ "workspace_one", "crowdstrike_s2s", @@ -500,13 +500,13 @@ async def edit( "sentinelone_s2s", "custom_s2s", ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Integration]: """ Updates a configured device posture integration. @@ -566,7 +566,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Integration]: """ Fetches details for a single device posture integration. diff --git a/src/cloudflare/resources/zero_trust/devices/posture/posture.py b/src/cloudflare/resources/zero_trust/devices/posture/posture.py index 22e6f294a72..7fef62e4a7e 100644 --- a/src/cloudflare/resources/zero_trust/devices/posture/posture.py +++ b/src/cloudflare/resources/zero_trust/devices/posture/posture.py @@ -7,7 +7,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .integrations import ( @@ -90,17 +90,17 @@ def create( "sentinelone_s2s", "custom_s2s", ], - description: str | NotGiven = NOT_GIVEN, - expiration: str | NotGiven = NOT_GIVEN, - input: DeviceInputParam | NotGiven = NOT_GIVEN, - match: Iterable[DeviceMatchParam] | NotGiven = NOT_GIVEN, - schedule: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + expiration: str | Omit = omit, + input: DeviceInputParam | Omit = omit, + match: Iterable[DeviceMatchParam] | Omit = omit, + schedule: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DevicePostureRule]: """ Creates a new device posture rule. @@ -186,17 +186,17 @@ def update( "sentinelone_s2s", "custom_s2s", ], - description: str | NotGiven = NOT_GIVEN, - expiration: str | NotGiven = NOT_GIVEN, - input: DeviceInputParam | NotGiven = NOT_GIVEN, - match: Iterable[DeviceMatchParam] | NotGiven = NOT_GIVEN, - schedule: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + expiration: str | Omit = omit, + input: DeviceInputParam | Omit = omit, + match: Iterable[DeviceMatchParam] | Omit = omit, + schedule: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DevicePostureRule]: """ Updates a device posture rule. @@ -265,7 +265,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DevicePostureRule]: """ Fetches device posture rules for a Zero Trust account. @@ -300,7 +300,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PostureDeleteResponse]: """ Deletes a device posture rule. @@ -342,7 +342,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DevicePostureRule]: """ Fetches a single device posture rule. @@ -428,17 +428,17 @@ async def create( "sentinelone_s2s", "custom_s2s", ], - description: str | NotGiven = NOT_GIVEN, - expiration: str | NotGiven = NOT_GIVEN, - input: DeviceInputParam | NotGiven = NOT_GIVEN, - match: Iterable[DeviceMatchParam] | NotGiven = NOT_GIVEN, - schedule: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + expiration: str | Omit = omit, + input: DeviceInputParam | Omit = omit, + match: Iterable[DeviceMatchParam] | Omit = omit, + schedule: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DevicePostureRule]: """ Creates a new device posture rule. @@ -524,17 +524,17 @@ async def update( "sentinelone_s2s", "custom_s2s", ], - description: str | NotGiven = NOT_GIVEN, - expiration: str | NotGiven = NOT_GIVEN, - input: DeviceInputParam | NotGiven = NOT_GIVEN, - match: Iterable[DeviceMatchParam] | NotGiven = NOT_GIVEN, - schedule: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + expiration: str | Omit = omit, + input: DeviceInputParam | Omit = omit, + match: Iterable[DeviceMatchParam] | Omit = omit, + schedule: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DevicePostureRule]: """ Updates a device posture rule. @@ -603,7 +603,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DevicePostureRule, AsyncSinglePage[DevicePostureRule]]: """ Fetches device posture rules for a Zero Trust account. @@ -638,7 +638,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PostureDeleteResponse]: """ Deletes a device posture rule. @@ -680,7 +680,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DevicePostureRule]: """ Fetches a single device posture rule. diff --git a/src/cloudflare/resources/zero_trust/devices/registrations.py b/src/cloudflare/resources/zero_trust/devices/registrations.py index 7e129cc380d..c1a7c477403 100644 --- a/src/cloudflare/resources/zero_trust/devices/registrations.py +++ b/src/cloudflare/resources/zero_trust/devices/registrations.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -21,6 +21,7 @@ from ....pagination import SyncCursorPagination, AsyncCursorPagination from ...._base_client import AsyncPaginator, make_request_options from ....types.zero_trust.devices import ( + registration_get_params, registration_list_params, registration_revoke_params, registration_unrevoke_params, @@ -56,24 +57,24 @@ def list( self, *, account_id: str, - id: List[str] | NotGiven = NOT_GIVEN, - cursor: str | NotGiven = NOT_GIVEN, - device: registration_list_params.Device | NotGiven = NOT_GIVEN, - include: str | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - seen_after: str | NotGiven = NOT_GIVEN, - seen_before: str | NotGiven = NOT_GIVEN, - sort_by: Literal["id", "user.name", "user.email", "last_seen_at", "created_at"] | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - status: Literal["active", "all", "revoked"] | NotGiven = NOT_GIVEN, - user: registration_list_params.User | NotGiven = NOT_GIVEN, + id: SequenceNotStr[str] | Omit = omit, + cursor: str | Omit = omit, + device: registration_list_params.Device | Omit = omit, + include: str | Omit = omit, + per_page: int | Omit = omit, + search: str | Omit = omit, + seen_after: str | Omit = omit, + seen_before: str | Omit = omit, + sort_by: Literal["id", "user.name", "user.email", "last_seen_at", "created_at"] | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, + status: Literal["active", "all", "revoked"] | Omit = omit, + user: registration_list_params.User | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncCursorPagination[RegistrationListResponse]: """ Lists WARP registrations. @@ -85,14 +86,17 @@ def list( records. A cursor value can be obtained from the result_info.cursor field in the response. + include: Comma-separated list of additional information that should be included in the + registration response. Supported values are: "policy". + per_page: The maximum number of devices to return in a single response. search: Filter by registration details. - seen_after: Filters by the last_seen timestamp - returns only registrations last seen after + seen_after: Filter by the last_seen timestamp - returns only registrations last seen after this timestamp. - seen_before: Filters by the last_seen timestamp - returns only registrations last seen before + seen_before: Filter by the last_seen timestamp - returns only registrations last seen before this timestamp. sort_by: The registration field to order results by. @@ -150,7 +154,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a WARP registration. @@ -184,13 +188,13 @@ def bulk_delete( self, *, account_id: str, - id: List[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a list of WARP registrations. @@ -226,17 +230,21 @@ def get( registration_id: str, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RegistrationGetResponse: """ Fetches a single WARP registration. Args: + include: Comma-separated list of additional information that should be included in the + registration response. Supported values are: "policy". + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -256,6 +264,7 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform({"include": include}, registration_get_params.RegistrationGetParams), post_parser=ResultWrapper[RegistrationGetResponse]._unwrapper, ), cast_to=cast(Type[RegistrationGetResponse], ResultWrapper[RegistrationGetResponse]), @@ -265,13 +274,13 @@ def revoke( self, *, account_id: str, - id: List[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Revokes a list of WARP registrations. @@ -306,13 +315,13 @@ def unrevoke( self, *, account_id: str, - id: List[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Unrevokes a list of WARP registrations. @@ -368,24 +377,24 @@ def list( self, *, account_id: str, - id: List[str] | NotGiven = NOT_GIVEN, - cursor: str | NotGiven = NOT_GIVEN, - device: registration_list_params.Device | NotGiven = NOT_GIVEN, - include: str | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - seen_after: str | NotGiven = NOT_GIVEN, - seen_before: str | NotGiven = NOT_GIVEN, - sort_by: Literal["id", "user.name", "user.email", "last_seen_at", "created_at"] | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - status: Literal["active", "all", "revoked"] | NotGiven = NOT_GIVEN, - user: registration_list_params.User | NotGiven = NOT_GIVEN, + id: SequenceNotStr[str] | Omit = omit, + cursor: str | Omit = omit, + device: registration_list_params.Device | Omit = omit, + include: str | Omit = omit, + per_page: int | Omit = omit, + search: str | Omit = omit, + seen_after: str | Omit = omit, + seen_before: str | Omit = omit, + sort_by: Literal["id", "user.name", "user.email", "last_seen_at", "created_at"] | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, + status: Literal["active", "all", "revoked"] | Omit = omit, + user: registration_list_params.User | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RegistrationListResponse, AsyncCursorPagination[RegistrationListResponse]]: """ Lists WARP registrations. @@ -397,14 +406,17 @@ def list( records. A cursor value can be obtained from the result_info.cursor field in the response. + include: Comma-separated list of additional information that should be included in the + registration response. Supported values are: "policy". + per_page: The maximum number of devices to return in a single response. search: Filter by registration details. - seen_after: Filters by the last_seen timestamp - returns only registrations last seen after + seen_after: Filter by the last_seen timestamp - returns only registrations last seen after this timestamp. - seen_before: Filters by the last_seen timestamp - returns only registrations last seen before + seen_before: Filter by the last_seen timestamp - returns only registrations last seen before this timestamp. sort_by: The registration field to order results by. @@ -462,7 +474,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a WARP registration. @@ -496,13 +508,13 @@ async def bulk_delete( self, *, account_id: str, - id: List[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a list of WARP registrations. @@ -540,17 +552,21 @@ async def get( registration_id: str, *, 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RegistrationGetResponse: """ Fetches a single WARP registration. Args: + include: Comma-separated list of additional information that should be included in the + registration response. Supported values are: "policy". + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -570,6 +586,7 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=await async_maybe_transform({"include": include}, registration_get_params.RegistrationGetParams), post_parser=ResultWrapper[RegistrationGetResponse]._unwrapper, ), cast_to=cast(Type[RegistrationGetResponse], ResultWrapper[RegistrationGetResponse]), @@ -579,13 +596,13 @@ async def revoke( self, *, account_id: str, - id: List[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Revokes a list of WARP registrations. @@ -620,13 +637,13 @@ async def unrevoke( self, *, account_id: str, - id: List[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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Unrevokes a list of WARP registrations. 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 ce0c76c294d..33f8cf8650e 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 @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,13 +52,13 @@ def create( *, account_id: str, disconnect: bool, - justification: str | NotGiven = NOT_GIVEN, + justification: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GlobalWARPOverrideCreateResponse]: """ Sets the Global WARP override state. @@ -109,7 +109,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GlobalWARPOverrideGetResponse]: """ Fetch the Global WARP override state. @@ -163,13 +163,13 @@ async def create( *, account_id: str, disconnect: bool, - justification: str | NotGiven = NOT_GIVEN, + justification: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GlobalWARPOverrideCreateResponse]: """ Sets the Global WARP override state. @@ -220,7 +220,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GlobalWARPOverrideGetResponse]: """ Fetch the Global WARP override state. diff --git a/src/cloudflare/resources/zero_trust/devices/revoke.py b/src/cloudflare/resources/zero_trust/devices/revoke.py index 8cbceb332c1..b1fc0267ac5 100644 --- a/src/cloudflare/resources/zero_trust/devices/revoke.py +++ b/src/cloudflare/resources/zero_trust/devices/revoke.py @@ -3,11 +3,11 @@ from __future__ import annotations import typing_extensions -from typing import Any, List, Optional, cast +from typing import Any, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -49,13 +49,13 @@ def create( self, *, account_id: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RevokeCreateResponse]: """Revokes a list of devices. @@ -83,7 +83,7 @@ def create( Optional[RevokeCreateResponse], self._post( f"/accounts/{account_id}/devices/revoke", - body=maybe_transform(body, List[str]), + body=maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -123,13 +123,13 @@ async def create( self, *, account_id: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RevokeCreateResponse]: """Revokes a list of devices. @@ -157,7 +157,7 @@ async def create( Optional[RevokeCreateResponse], await self._post( f"/accounts/{account_id}/devices/revoke", - body=await async_maybe_transform(body, List[str]), + body=await async_maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -178,7 +178,7 @@ def __init__(self, revoke: RevokeResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - revoke.create # pyright: ignore[reportDeprecated], + revoke.create, # pyright: ignore[reportDeprecated], ) ) @@ -189,7 +189,7 @@ def __init__(self, revoke: AsyncRevokeResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - revoke.create # pyright: ignore[reportDeprecated], + revoke.create, # pyright: ignore[reportDeprecated], ) ) @@ -200,7 +200,7 @@ def __init__(self, revoke: RevokeResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - revoke.create # pyright: ignore[reportDeprecated], + revoke.create, # pyright: ignore[reportDeprecated], ) ) @@ -211,6 +211,6 @@ def __init__(self, revoke: AsyncRevokeResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - revoke.create # pyright: ignore[reportDeprecated], + revoke.create, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/zero_trust/devices/settings.py b/src/cloudflare/resources/zero_trust/devices/settings.py index e8a1c865dcd..f525614bc82 100644 --- a/src/cloudflare/resources/zero_trust/devices/settings.py +++ b/src/cloudflare/resources/zero_trust/devices/settings.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,17 +48,17 @@ def update( self, *, account_id: str, - disable_for_time: float | NotGiven = NOT_GIVEN, - gateway_proxy_enabled: bool | NotGiven = NOT_GIVEN, - gateway_udp_proxy_enabled: bool | NotGiven = NOT_GIVEN, - root_certificate_installation_enabled: bool | NotGiven = NOT_GIVEN, - use_zt_virtual_ip: bool | NotGiven = NOT_GIVEN, + disable_for_time: float | Omit = omit, + gateway_proxy_enabled: bool | Omit = omit, + gateway_udp_proxy_enabled: bool | Omit = omit, + root_certificate_installation_enabled: bool | Omit = omit, + use_zt_virtual_ip: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceSettings]: """ Updates the current device settings for a Zero Trust account. @@ -116,7 +116,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceSettings]: """ Resets the current device settings for a Zero Trust account. @@ -148,17 +148,17 @@ def edit( self, *, account_id: str, - disable_for_time: float | NotGiven = NOT_GIVEN, - gateway_proxy_enabled: bool | NotGiven = NOT_GIVEN, - gateway_udp_proxy_enabled: bool | NotGiven = NOT_GIVEN, - root_certificate_installation_enabled: bool | NotGiven = NOT_GIVEN, - use_zt_virtual_ip: bool | NotGiven = NOT_GIVEN, + disable_for_time: float | Omit = omit, + gateway_proxy_enabled: bool | Omit = omit, + gateway_udp_proxy_enabled: bool | Omit = omit, + root_certificate_installation_enabled: bool | Omit = omit, + use_zt_virtual_ip: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceSettings]: """ Patches the current device settings for a Zero Trust account. @@ -216,7 +216,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceSettings]: """ Describes the current device settings for a Zero Trust account. @@ -269,17 +269,17 @@ async def update( self, *, account_id: str, - disable_for_time: float | NotGiven = NOT_GIVEN, - gateway_proxy_enabled: bool | NotGiven = NOT_GIVEN, - gateway_udp_proxy_enabled: bool | NotGiven = NOT_GIVEN, - root_certificate_installation_enabled: bool | NotGiven = NOT_GIVEN, - use_zt_virtual_ip: bool | NotGiven = NOT_GIVEN, + disable_for_time: float | Omit = omit, + gateway_proxy_enabled: bool | Omit = omit, + gateway_udp_proxy_enabled: bool | Omit = omit, + root_certificate_installation_enabled: bool | Omit = omit, + use_zt_virtual_ip: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceSettings]: """ Updates the current device settings for a Zero Trust account. @@ -337,7 +337,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceSettings]: """ Resets the current device settings for a Zero Trust account. @@ -369,17 +369,17 @@ async def edit( self, *, account_id: str, - disable_for_time: float | NotGiven = NOT_GIVEN, - gateway_proxy_enabled: bool | NotGiven = NOT_GIVEN, - gateway_udp_proxy_enabled: bool | NotGiven = NOT_GIVEN, - root_certificate_installation_enabled: bool | NotGiven = NOT_GIVEN, - use_zt_virtual_ip: bool | NotGiven = NOT_GIVEN, + disable_for_time: float | Omit = omit, + gateway_proxy_enabled: bool | Omit = omit, + gateway_udp_proxy_enabled: bool | Omit = omit, + root_certificate_installation_enabled: bool | Omit = omit, + use_zt_virtual_ip: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceSettings]: """ Patches the current device settings for a Zero Trust account. @@ -437,7 +437,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DeviceSettings]: """ Describes the current device settings for a Zero Trust account. diff --git a/src/cloudflare/resources/zero_trust/devices/unrevoke.py b/src/cloudflare/resources/zero_trust/devices/unrevoke.py index 70236c85538..c2763bff599 100644 --- a/src/cloudflare/resources/zero_trust/devices/unrevoke.py +++ b/src/cloudflare/resources/zero_trust/devices/unrevoke.py @@ -3,11 +3,11 @@ from __future__ import annotations import typing_extensions -from typing import Any, List, Optional, cast +from typing import Any, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -49,13 +49,13 @@ def create( self, *, account_id: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UnrevokeCreateResponse]: """Unrevokes a list of devices. @@ -83,7 +83,7 @@ def create( Optional[UnrevokeCreateResponse], self._post( f"/accounts/{account_id}/devices/unrevoke", - body=maybe_transform(body, List[str]), + body=maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -123,13 +123,13 @@ async def create( self, *, account_id: str, - body: List[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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UnrevokeCreateResponse]: """Unrevokes a list of devices. @@ -157,7 +157,7 @@ async def create( Optional[UnrevokeCreateResponse], await self._post( f"/accounts/{account_id}/devices/unrevoke", - body=await async_maybe_transform(body, List[str]), + body=await async_maybe_transform(body, SequenceNotStr[str]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -178,7 +178,7 @@ def __init__(self, unrevoke: UnrevokeResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - unrevoke.create # pyright: ignore[reportDeprecated], + unrevoke.create, # pyright: ignore[reportDeprecated], ) ) @@ -189,7 +189,7 @@ def __init__(self, unrevoke: AsyncUnrevokeResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - unrevoke.create # pyright: ignore[reportDeprecated], + unrevoke.create, # pyright: ignore[reportDeprecated], ) ) @@ -200,7 +200,7 @@ def __init__(self, unrevoke: UnrevokeResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - unrevoke.create # pyright: ignore[reportDeprecated], + unrevoke.create, # pyright: ignore[reportDeprecated], ) ) @@ -211,6 +211,6 @@ def __init__(self, unrevoke: AsyncUnrevokeResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - unrevoke.create # pyright: ignore[reportDeprecated], + unrevoke.create, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/zero_trust/dex/colos.py b/src/cloudflare/resources/zero_trust/dex/colos.py index deb75fd721a..a6cc09c1db1 100644 --- a/src/cloudflare/resources/zero_trust/dex/colos.py +++ b/src/cloudflare/resources/zero_trust/dex/colos.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,13 +49,13 @@ def list( account_id: str, from_: str, to: str, - sort_by: Literal["fleet-status-usage", "application-tests-usage"] | NotGiven = NOT_GIVEN, + sort_by: Literal["fleet-status-usage", "application-tests-usage"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[object]: """ List Cloudflare colos that account's devices were connected to during a time @@ -127,13 +127,13 @@ def list( account_id: str, from_: str, to: str, - sort_by: Literal["fleet-status-usage", "application-tests-usage"] | NotGiven = NOT_GIVEN, + sort_by: Literal["fleet-status-usage", "application-tests-usage"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[object, AsyncSinglePage[object]]: """ List Cloudflare colos that account's devices were connected to during a time diff --git a/src/cloudflare/resources/zero_trust/dex/commands/commands.py b/src/cloudflare/resources/zero_trust/dex/commands/commands.py index 97849083fc4..67a335103cc 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/commands.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/commands.py @@ -32,7 +32,7 @@ DownloadsResourceWithStreamingResponse, AsyncDownloadsResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -94,7 +94,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CommandCreateResponse]: """ Initiate commands for up to 10 devices per account @@ -131,18 +131,18 @@ def list( account_id: str, page: float, per_page: float, - command_type: str | NotGiven = NOT_GIVEN, - device_id: str | NotGiven = NOT_GIVEN, - from_: Union[str, datetime] | NotGiven = NOT_GIVEN, - status: Literal["PENDING_EXEC", "PENDING_UPLOAD", "SUCCESS", "FAILED"] | NotGiven = NOT_GIVEN, - to: Union[str, datetime] | NotGiven = NOT_GIVEN, - user_email: str | NotGiven = NOT_GIVEN, + command_type: str | Omit = omit, + device_id: str | Omit = omit, + from_: Union[str, datetime] | Omit = omit, + status: Literal["PENDING_EXEC", "PENDING_UPLOAD", "SUCCESS", "FAILED"] | Omit = omit, + to: Union[str, datetime] | Omit = omit, + user_email: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[Optional[CommandListResponse]]: """ Retrieves a paginated list of commands issued to devices under the specified @@ -243,7 +243,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CommandCreateResponse]: """ Initiate commands for up to 10 devices per account @@ -280,18 +280,18 @@ def list( account_id: str, page: float, per_page: float, - command_type: str | NotGiven = NOT_GIVEN, - device_id: str | NotGiven = NOT_GIVEN, - from_: Union[str, datetime] | NotGiven = NOT_GIVEN, - status: Literal["PENDING_EXEC", "PENDING_UPLOAD", "SUCCESS", "FAILED"] | NotGiven = NOT_GIVEN, - to: Union[str, datetime] | NotGiven = NOT_GIVEN, - user_email: str | NotGiven = NOT_GIVEN, + command_type: str | Omit = omit, + device_id: str | Omit = omit, + from_: Union[str, datetime] | Omit = omit, + status: Literal["PENDING_EXEC", "PENDING_UPLOAD", "SUCCESS", "FAILED"] | Omit = omit, + to: Union[str, datetime] | Omit = omit, + user_email: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[CommandListResponse], AsyncV4PagePagination[Optional[CommandListResponse]]]: """ Retrieves a paginated list of commands issued to devices under the specified diff --git a/src/cloudflare/resources/zero_trust/dex/commands/devices.py b/src/cloudflare/resources/zero_trust/dex/commands/devices.py index 978a00cfa12..f48131bf7ee 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/devices.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/devices.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,13 +50,13 @@ def list( account_id: str, page: float, per_page: float, - search: str | NotGiven = NOT_GIVEN, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[Optional[DeviceListResponse]]: """ List devices with WARP client support for remote captures which have been @@ -126,13 +126,13 @@ def list( account_id: str, page: float, per_page: float, - search: str | NotGiven = NOT_GIVEN, + search: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[DeviceListResponse], AsyncV4PagePagination[Optional[DeviceListResponse]]]: """ List devices with WARP client support for remote captures which have been diff --git a/src/cloudflare/resources/zero_trust/dex/commands/downloads.py b/src/cloudflare/resources/zero_trust/dex/commands/downloads.py index 5bc3cfafdbd..49d4323cba3 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/downloads.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/downloads.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -53,7 +53,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: """Downloads artifacts for an executed command. @@ -117,7 +117,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: """Downloads artifacts for an executed command. diff --git a/src/cloudflare/resources/zero_trust/dex/commands/quota.py b/src/cloudflare/resources/zero_trust/dex/commands/quota.py index 58afb723bf7..196340864a5 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/quota.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/quota.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[QuotaGetResponse]: """ Retrieves the current quota usage and limits for device commands within a @@ -110,7 +110,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[QuotaGetResponse]: """ Retrieves the current quota usage and limits for device commands within a 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 b46a240b4e5..e61329c8e13 100644 --- a/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py +++ b/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,21 +52,20 @@ def list( page: float, per_page: float, to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: str | NotGiven = NOT_GIVEN, - mode: str | NotGiven = NOT_GIVEN, - platform: str | NotGiven = NOT_GIVEN, - sort_by: Literal["colo", "device_id", "mode", "platform", "status", "timestamp", "version"] - | NotGiven = NOT_GIVEN, - source: Literal["last_seen", "hourly", "raw"] | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, - version: str | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: str | Omit = omit, + mode: str | Omit = omit, + platform: str | Omit = omit, + sort_by: Literal["colo", "device_id", "mode", "platform", "status", "timestamp", "version"] | Omit = omit, + source: Literal["last_seen", "hourly", "raw"] | Omit = omit, + status: str | Omit = omit, + version: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[DeviceListResponse]: """ List details for devices using WARP @@ -169,21 +168,20 @@ def list( page: float, per_page: float, to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: str | NotGiven = NOT_GIVEN, - mode: str | NotGiven = NOT_GIVEN, - platform: str | NotGiven = NOT_GIVEN, - sort_by: Literal["colo", "device_id", "mode", "platform", "status", "timestamp", "version"] - | NotGiven = NOT_GIVEN, - source: Literal["last_seen", "hourly", "raw"] | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, - version: str | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: str | Omit = omit, + mode: str | Omit = omit, + platform: str | Omit = omit, + sort_by: Literal["colo", "device_id", "mode", "platform", "status", "timestamp", "version"] | Omit = omit, + source: Literal["last_seen", "hourly", "raw"] | Omit = omit, + status: str | Omit = omit, + version: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DeviceListResponse, AsyncV4PagePaginationArray[DeviceListResponse]]: """ List details for devices using WARP 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 3816bba7bdc..16d1b39f0af 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 @@ -14,7 +14,7 @@ DevicesResourceWithStreamingResponse, AsyncDevicesResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ....._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -66,7 +66,7 @@ def live( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FleetStatusLiveResponse]: """ List details for live (up to 60 minutes) devices using WARP @@ -103,14 +103,14 @@ def over_time( account_id: str, from_: str, to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: str | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ List details for devices using WARP, up to 7 days @@ -190,7 +190,7 @@ async def live( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FleetStatusLiveResponse]: """ List details for live (up to 60 minutes) devices using WARP @@ -229,14 +229,14 @@ async def over_time( account_id: str, from_: str, to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: str | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ List details for devices using WARP, up to 7 days 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 0f1f4a91410..58ce0db4487 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 @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 .percentiles import ( @@ -65,14 +65,14 @@ def get( from_: str, interval: Literal["minute", "hour"], to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: List[str] | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HTTPDetails]: """ Get test details and aggregate performance metrics for an http test for a given @@ -160,14 +160,14 @@ async def get( from_: str, interval: Literal["minute", "hour"], to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: List[str] | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HTTPDetails]: """ Get test details and aggregate performance metrics for an http test for a given 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 4885c3cd64d..9416da48657 100644 --- a/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py +++ b/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,14 +51,14 @@ def get( account_id: str, from_: str, to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: List[str] | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HTTPDetailsPercentiles]: """ Get percentiles for an http test for a given time period between 1 hour and 7 @@ -138,14 +138,14 @@ async def get( account_id: str, from_: str, to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: List[str] | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HTTPDetailsPercentiles]: """ Get percentiles for an http test for a given time period between 1 hour and 7 diff --git a/src/cloudflare/resources/zero_trust/dex/tests/tests.py b/src/cloudflare/resources/zero_trust/dex/tests/tests.py index 09a1dae7547..400e7e9ca50 100644 --- a/src/cloudflare/resources/zero_trust/dex/tests/tests.py +++ b/src/cloudflare/resources/zero_trust/dex/tests/tests.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ....._utils import maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -62,17 +62,17 @@ def list( self, *, account_id: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: List[str] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - test_name: str | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: SequenceNotStr[str] | Omit = omit, + page: float | Omit = omit, + per_page: float | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePagination[Optional[Tests]]: """ List DEX tests with overview metrics @@ -151,17 +151,17 @@ def list( self, *, account_id: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: List[str] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - test_name: str | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: SequenceNotStr[str] | Omit = omit, + page: float | Omit = omit, + per_page: float | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Optional[Tests], AsyncV4PagePagination[Optional[Tests]]]: """ List DEX tests with overview metrics 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 6ed2065aa39..0cc5b6647ed 100644 --- a/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py +++ b/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,14 +48,14 @@ def list( self, *, account_id: str, - device_id: List[str] | NotGiven = NOT_GIVEN, - test_name: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UniqueDevices]: """ Returns unique count of devices that have run synthetic application monitoring @@ -121,14 +121,14 @@ async def list( self, *, account_id: str, - device_id: List[str] | NotGiven = NOT_GIVEN, - test_name: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[UniqueDevices]: """ Returns unique count of devices that have run synthetic application monitoring 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 12b3b952b2e..2d01628d26f 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 @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NetworkPathGetResponse]: """ Get a breakdown of hops and performance metrics for a specific traceroute test @@ -116,7 +116,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NetworkPathGetResponse]: """ Get a breakdown of hops and performance metrics for a specific traceroute test diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py b/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py index b8501c2c329..474ce3f2362 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast from typing_extensions import Literal import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -59,14 +59,14 @@ def get( from_: str, interval: Literal["minute", "hour"], to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: List[str] | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Traceroute]: """ Get test details and aggregate performance metrics for an traceroute test for a @@ -135,7 +135,7 @@ def network_path( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NetworkPathResponse]: """ Get a breakdown of metrics by hop for individual traceroute test runs @@ -191,14 +191,14 @@ def percentiles( account_id: str, from_: str, to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: List[str] | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TracerouteTestPercentilesResponse]: """ Get percentiles for a traceroute test for a given time period between 1 hour and @@ -281,14 +281,14 @@ async def get( from_: str, interval: Literal["minute", "hour"], to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: List[str] | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Traceroute]: """ Get test details and aggregate performance metrics for an traceroute test for a @@ -357,7 +357,7 @@ async def network_path( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NetworkPathResponse]: """ Get a breakdown of metrics by hop for individual traceroute test runs @@ -413,14 +413,14 @@ async def percentiles( account_id: str, from_: str, to: str, - colo: str | NotGiven = NOT_GIVEN, - device_id: List[str] | NotGiven = NOT_GIVEN, + colo: str | Omit = omit, + device_id: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[TracerouteTestPercentilesResponse]: """ Get percentiles for a traceroute test for a given time period between 1 hour and 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 4a8f654af05..0b2630a813d 100644 --- a/src/cloudflare/resources/zero_trust/dex/warp_change_events.py +++ b/src/cloudflare/resources/zero_trust/dex/warp_change_events.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -53,17 +53,17 @@ def get( page: float, per_page: float, to: str, - account_name: str | NotGiven = NOT_GIVEN, - config_name: str | NotGiven = NOT_GIVEN, - sort_order: Literal["ASC", "DESC"] | NotGiven = NOT_GIVEN, - toggle: Literal["on", "off"] | NotGiven = NOT_GIVEN, - type: Literal["config", "toggle"] | NotGiven = NOT_GIVEN, + account_name: str | Omit = omit, + config_name: str | Omit = omit, + sort_order: Literal["ASC", "DESC"] | Omit = omit, + toggle: Literal["on", "off"] | Omit = omit, + type: Literal["config", "toggle"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[WARPChangeEventGetResponse]: """ List WARP configuration and enablement toggle change events by device. @@ -153,17 +153,17 @@ async def get( page: float, per_page: float, to: str, - account_name: str | NotGiven = NOT_GIVEN, - config_name: str | NotGiven = NOT_GIVEN, - sort_order: Literal["ASC", "DESC"] | NotGiven = NOT_GIVEN, - toggle: Literal["on", "off"] | NotGiven = NOT_GIVEN, - type: Literal["config", "toggle"] | NotGiven = NOT_GIVEN, + account_name: str | Omit = omit, + config_name: str | Omit = omit, + sort_order: Literal["ASC", "DESC"] | Omit = omit, + toggle: Literal["on", "off"] | Omit = omit, + type: Literal["config", "toggle"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[WARPChangeEventGetResponse]: """ List WARP configuration and enablement toggle change events by device. diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py b/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py index 7b6ee3d631b..6aa79dd7ef5 100644 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py @@ -14,7 +14,7 @@ UploadResourceWithStreamingResponse, AsyncUploadResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ....._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -75,16 +75,16 @@ def create( *, account_id: str, name: str, - case_sensitive: bool | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - encoding_version: int | NotGiven = NOT_GIVEN, - secret: bool | NotGiven = NOT_GIVEN, + case_sensitive: bool | Omit = omit, + description: Optional[str] | Omit = omit, + encoding_version: int | Omit = omit, + secret: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DatasetCreation]: """Create a new dataset @@ -145,15 +145,15 @@ def update( dataset_id: str, *, account_id: str, - case_sensitive: bool | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + case_sensitive: bool | Omit = omit, + description: Optional[str] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Dataset]: """ Update details about a dataset @@ -208,7 +208,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Dataset]: """ Fetch all datasets @@ -243,7 +243,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ This deletes all versions of the dataset. @@ -280,7 +280,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Dataset]: """ Fetch a specific dataset @@ -344,16 +344,16 @@ async def create( *, account_id: str, name: str, - case_sensitive: bool | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - encoding_version: int | NotGiven = NOT_GIVEN, - secret: bool | NotGiven = NOT_GIVEN, + case_sensitive: bool | Omit = omit, + description: Optional[str] | Omit = omit, + encoding_version: int | Omit = omit, + secret: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DatasetCreation]: """Create a new dataset @@ -414,15 +414,15 @@ async def update( dataset_id: str, *, account_id: str, - case_sensitive: bool | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + case_sensitive: bool | Omit = omit, + description: Optional[str] | Omit = omit, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Dataset]: """ Update details about a dataset @@ -477,7 +477,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Dataset, AsyncSinglePage[Dataset]]: """ Fetch all datasets @@ -512,7 +512,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> None: """ This deletes all versions of the dataset. @@ -549,7 +549,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Dataset]: """ Fetch a specific dataset diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py b/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py index 0c9b54b6b0b..ae789bc99b2 100644 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py @@ -6,8 +6,8 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from ....._utils import maybe_transform, async_maybe_transform +from ....._files import read_file_content, async_read_file_content +from ....._types import Body, Query, Headers, NotGiven, FileContent, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -19,7 +19,6 @@ from ....._wrappers import ResultWrapper from ....._base_client import make_request_options from .....types.zero_trust.dlp.dataset import Dataset -from .....types.zero_trust.dlp.datasets import upload_edit_params from .....types.zero_trust.dlp.datasets.new_version import NewVersion __all__ = ["UploadResource", "AsyncUploadResource"] @@ -55,7 +54,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NewVersion]: """ Prepare to upload a new version of a dataset @@ -88,16 +87,16 @@ def create( def edit( self, version: int, + dataset: FileContent, *, account_id: str, dataset_id: str, - body: FileTypes, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Dataset]: """This is used for single-column EDMv1 and Custom Word Lists. @@ -119,9 +118,10 @@ def edit( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") + extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})} return self._post( f"/accounts/{account_id}/dlp/datasets/{dataset_id}/upload/{version}", - body=maybe_transform(body, upload_edit_params.UploadEditParams), + body=read_file_content(dataset), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -163,7 +163,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[NewVersion]: """ Prepare to upload a new version of a dataset @@ -196,16 +196,16 @@ async def create( async def edit( self, version: int, + dataset: FileContent, *, account_id: str, dataset_id: str, - body: FileTypes, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Dataset]: """This is used for single-column EDMv1 and Custom Word Lists. @@ -227,9 +227,10 @@ async def edit( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") + extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})} return await self._post( f"/accounts/{account_id}/dlp/datasets/{dataset_id}/upload/{version}", - body=await async_maybe_transform(body, upload_edit_params.UploadEditParams), + body=await async_read_file_content(dataset), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, 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 aeabf816cee..33d1dba893f 100755 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py @@ -6,8 +6,8 @@ import httpx -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from ......_utils import maybe_transform, async_maybe_transform +from ......_files import read_file_content, async_read_file_content +from ......_types import Body, Query, Headers, NotGiven, FileContent, not_given from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource from ......_response import ( @@ -18,7 +18,6 @@ ) from ......_wrappers import ResultWrapper from ......_base_client import make_request_options -from ......types.zero_trust.dlp.datasets.versions import entry_create_params from ......types.zero_trust.dlp.datasets.versions.entry_create_response import EntryCreateResponse __all__ = ["EntriesResource", "AsyncEntriesResource"] @@ -47,17 +46,17 @@ def with_streaming_response(self) -> EntriesResourceWithStreamingResponse: def create( self, entry_id: str, + dataset_version_entry: FileContent, *, account_id: str, dataset_id: str, version: int, - body: FileTypes, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryCreateResponse]: """This is used for multi-column EDMv2 datasets. @@ -79,9 +78,10 @@ def create( raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") if not entry_id: raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})} return self._post( f"/accounts/{account_id}/dlp/datasets/{dataset_id}/versions/{version}/entries/{entry_id}", - body=maybe_transform(body, entry_create_params.EntryCreateParams), + body=read_file_content(dataset_version_entry), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -116,17 +116,17 @@ def with_streaming_response(self) -> AsyncEntriesResourceWithStreamingResponse: async def create( self, entry_id: str, + dataset_version_entry: FileContent, *, account_id: str, dataset_id: str, version: int, - body: FileTypes, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryCreateResponse]: """This is used for multi-column EDMv2 datasets. @@ -148,9 +148,10 @@ async def create( raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") if not entry_id: raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})} return await self._post( f"/accounts/{account_id}/dlp/datasets/{dataset_id}/versions/{version}/entries/{entry_id}", - body=await async_maybe_transform(body, entry_create_params.EntryCreateParams), + body=await async_read_file_content(dataset_version_entry), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, 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 2caf310919d..90b562051a9 100755 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py @@ -14,7 +14,7 @@ EntriesResourceWithStreamingResponse, AsyncEntriesResourceWithStreamingResponse, ) -from ......_types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ......_types import Body, Query, Headers, NotGiven, not_given from ......_utils import maybe_transform from ......_compat import cached_property from ......_resource import SyncAPIResource, AsyncAPIResource @@ -68,7 +68,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[VersionCreateResponse]: """This is used for multi-column EDMv2 datasets. @@ -137,7 +137,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[VersionCreateResponse, AsyncSinglePage[VersionCreateResponse]]: """This is used for multi-column EDMv2 datasets. diff --git a/src/cloudflare/resources/zero_trust/dlp/dlp.py b/src/cloudflare/resources/zero_trust/dlp/dlp.py index 3769892598e..7444c2b17de 100644 --- a/src/cloudflare/resources/zero_trust/dlp/dlp.py +++ b/src/cloudflare/resources/zero_trust/dlp/dlp.py @@ -10,14 +10,6 @@ LimitsResourceWithStreamingResponse, AsyncLimitsResourceWithStreamingResponse, ) -from .entries import ( - EntriesResource, - AsyncEntriesResource, - EntriesResourceWithRawResponse, - AsyncEntriesResourceWithRawResponse, - EntriesResourceWithStreamingResponse, - AsyncEntriesResourceWithStreamingResponse, -) from .patterns import ( PatternsResource, AsyncPatternsResource, @@ -44,6 +36,14 @@ PayloadLogsResourceWithStreamingResponse, AsyncPayloadLogsResourceWithStreamingResponse, ) +from .entries.entries import ( + EntriesResource, + AsyncEntriesResource, + EntriesResourceWithRawResponse, + AsyncEntriesResourceWithRawResponse, + EntriesResourceWithStreamingResponse, + AsyncEntriesResourceWithStreamingResponse, +) from .datasets.datasets import ( DatasetsResource, AsyncDatasetsResource, 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 0fa4416421f..41ef3fa93e8 100644 --- a/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py +++ b/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,7 +55,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountMappingCreateResponse]: """ Create mapping @@ -95,7 +95,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountMappingGetResponse]: """ Get mapping @@ -154,7 +154,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountMappingCreateResponse]: """ Create mapping @@ -194,7 +194,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountMappingGetResponse]: """ Get mapping diff --git a/src/cloudflare/resources/zero_trust/dlp/email/rules.py b/src/cloudflare/resources/zero_trust/dlp/email/rules.py index 187502cc0b7..1930c5cf88f 100644 --- a/src/cloudflare/resources/zero_trust/dlp/email/rules.py +++ b/src/cloudflare/resources/zero_trust/dlp/email/rules.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,13 +58,13 @@ def create( conditions: Iterable[rule_create_params.Condition], enabled: bool, name: str, - description: Optional[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleCreateResponse]: """ Create email scanner rule @@ -113,13 +113,13 @@ def update( conditions: Iterable[rule_update_params.Condition], enabled: bool, name: str, - description: Optional[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleUpdateResponse]: """ Update email scanner rule @@ -170,7 +170,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[RuleListResponse]: """ Lists all email scanner rules for an account. @@ -205,7 +205,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleDeleteResponse]: """ Delete email scanner rule @@ -245,7 +245,7 @@ def bulk_edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleBulkEditResponse]: """ Update email scanner rule priorities @@ -284,7 +284,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleGetResponse]: """ Get an email scanner rule @@ -343,13 +343,13 @@ async def create( conditions: Iterable[rule_create_params.Condition], enabled: bool, name: str, - description: Optional[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleCreateResponse]: """ Create email scanner rule @@ -398,13 +398,13 @@ async def update( conditions: Iterable[rule_update_params.Condition], enabled: bool, name: str, - description: Optional[str] | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleUpdateResponse]: """ Update email scanner rule @@ -455,7 +455,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RuleListResponse, AsyncSinglePage[RuleListResponse]]: """ Lists all email scanner rules for an account. @@ -490,7 +490,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleDeleteResponse]: """ Delete email scanner rule @@ -530,7 +530,7 @@ async def bulk_edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleBulkEditResponse]: """ Update email scanner rule priorities @@ -571,7 +571,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RuleGetResponse]: """ Get an email scanner rule diff --git a/src/cloudflare/resources/zero_trust/dlp/entries/__init__.py b/src/cloudflare/resources/zero_trust/dlp/entries/__init__.py new file mode 100644 index 00000000000..01f7546037f --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dlp/entries/__init__.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .custom import ( + CustomResource, + AsyncCustomResource, + CustomResourceWithRawResponse, + AsyncCustomResourceWithRawResponse, + CustomResourceWithStreamingResponse, + AsyncCustomResourceWithStreamingResponse, +) +from .entries import ( + EntriesResource, + AsyncEntriesResource, + EntriesResourceWithRawResponse, + AsyncEntriesResourceWithRawResponse, + EntriesResourceWithStreamingResponse, + AsyncEntriesResourceWithStreamingResponse, +) +from .predefined import ( + PredefinedResource, + AsyncPredefinedResource, + PredefinedResourceWithRawResponse, + AsyncPredefinedResourceWithRawResponse, + PredefinedResourceWithStreamingResponse, + AsyncPredefinedResourceWithStreamingResponse, +) +from .integration import ( + IntegrationResource, + AsyncIntegrationResource, + IntegrationResourceWithRawResponse, + AsyncIntegrationResourceWithRawResponse, + IntegrationResourceWithStreamingResponse, + AsyncIntegrationResourceWithStreamingResponse, +) + +__all__ = [ + "CustomResource", + "AsyncCustomResource", + "CustomResourceWithRawResponse", + "AsyncCustomResourceWithRawResponse", + "CustomResourceWithStreamingResponse", + "AsyncCustomResourceWithStreamingResponse", + "PredefinedResource", + "AsyncPredefinedResource", + "PredefinedResourceWithRawResponse", + "AsyncPredefinedResourceWithRawResponse", + "PredefinedResourceWithStreamingResponse", + "AsyncPredefinedResourceWithStreamingResponse", + "IntegrationResource", + "AsyncIntegrationResource", + "IntegrationResourceWithRawResponse", + "AsyncIntegrationResourceWithRawResponse", + "IntegrationResourceWithStreamingResponse", + "AsyncIntegrationResourceWithStreamingResponse", + "EntriesResource", + "AsyncEntriesResource", + "EntriesResourceWithRawResponse", + "AsyncEntriesResourceWithRawResponse", + "EntriesResourceWithStreamingResponse", + "AsyncEntriesResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/zero_trust/dlp/entries/custom.py b/src/cloudflare/resources/zero_trust/dlp/entries/custom.py new file mode 100644 index 00000000000..ad9e74d0e47 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dlp/entries/custom.py @@ -0,0 +1,595 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Any, 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.zero_trust.dlp.entries import custom_create_params, custom_update_params +from .....types.zero_trust.dlp.profiles.pattern_param import PatternParam +from .....types.zero_trust.dlp.entries.custom_get_response import CustomGetResponse +from .....types.zero_trust.dlp.entries.custom_list_response import CustomListResponse +from .....types.zero_trust.dlp.entries.custom_create_response import CustomCreateResponse +from .....types.zero_trust.dlp.entries.custom_update_response import CustomUpdateResponse + +__all__ = ["CustomResource", "AsyncCustomResource"] + + +class CustomResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> CustomResourceWithRawResponse: + """ + 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 CustomResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CustomResourceWithStreamingResponse: + """ + 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 CustomResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + enabled: bool, + name: str, + pattern: PatternParam, + profile_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[CustomCreateResponse]: + """ + Creates a DLP custom entry. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + 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}/dlp/entries", + body=maybe_transform( + { + "enabled": enabled, + "name": name, + "pattern": pattern, + "profile_id": profile_id, + }, + custom_create_params.CustomCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomCreateResponse]], ResultWrapper[CustomCreateResponse]), + ) + + def update( + self, + entry_id: str, + *, + account_id: str, + enabled: bool, + name: str, + pattern: PatternParam, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[CustomUpdateResponse]: + """ + Updates a DLP custom entry. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return self._put( + f"/accounts/{account_id}/dlp/entries/custom/{entry_id}", + body=maybe_transform( + { + "enabled": enabled, + "name": name, + "pattern": pattern, + }, + custom_update_params.CustomUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomUpdateResponse]], ResultWrapper[CustomUpdateResponse]), + ) + + def list( + 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[CustomListResponse]: + """ + Lists all DLP entries in an account. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if 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}/dlp/entries", + page=SyncSinglePage[CustomListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=cast(Any, CustomListResponse), # Union types cannot be passed in as arguments in the type system + ) + + def delete( + self, + entry_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, + ) -> object: + """ + Deletes a DLP custom entry. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return self._delete( + f"/accounts/{account_id}/dlp/entries/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + def get( + self, + entry_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, + ) -> Optional[CustomGetResponse]: + """ + Fetches a DLP entry by ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return cast( + Optional[CustomGetResponse], + self._get( + f"/accounts/{account_id}/dlp/entries/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CustomGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class AsyncCustomResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncCustomResourceWithRawResponse: + """ + 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 AsyncCustomResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCustomResourceWithStreamingResponse: + """ + 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 AsyncCustomResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + enabled: bool, + name: str, + pattern: PatternParam, + profile_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[CustomCreateResponse]: + """ + Creates a DLP custom entry. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + 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}/dlp/entries", + body=await async_maybe_transform( + { + "enabled": enabled, + "name": name, + "pattern": pattern, + "profile_id": profile_id, + }, + custom_create_params.CustomCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomCreateResponse]], ResultWrapper[CustomCreateResponse]), + ) + + async def update( + self, + entry_id: str, + *, + account_id: str, + enabled: bool, + name: str, + pattern: PatternParam, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[CustomUpdateResponse]: + """ + Updates a DLP custom entry. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return await self._put( + f"/accounts/{account_id}/dlp/entries/custom/{entry_id}", + body=await async_maybe_transform( + { + "enabled": enabled, + "name": name, + "pattern": pattern, + }, + custom_update_params.CustomUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomUpdateResponse]], ResultWrapper[CustomUpdateResponse]), + ) + + def list( + 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[CustomListResponse, AsyncSinglePage[CustomListResponse]]: + """ + Lists all DLP entries in an account. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if 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}/dlp/entries", + page=AsyncSinglePage[CustomListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=cast(Any, CustomListResponse), # Union types cannot be passed in as arguments in the type system + ) + + async def delete( + self, + entry_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, + ) -> object: + """ + Deletes a DLP custom entry. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return await self._delete( + f"/accounts/{account_id}/dlp/entries/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + async def get( + self, + entry_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, + ) -> Optional[CustomGetResponse]: + """ + Fetches a DLP entry by ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return cast( + Optional[CustomGetResponse], + await self._get( + f"/accounts/{account_id}/dlp/entries/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[CustomGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class CustomResourceWithRawResponse: + def __init__(self, custom: CustomResource) -> None: + self._custom = custom + + self.create = to_raw_response_wrapper( + custom.create, + ) + self.update = to_raw_response_wrapper( + custom.update, + ) + self.list = to_raw_response_wrapper( + custom.list, + ) + self.delete = to_raw_response_wrapper( + custom.delete, + ) + self.get = to_raw_response_wrapper( + custom.get, + ) + + +class AsyncCustomResourceWithRawResponse: + def __init__(self, custom: AsyncCustomResource) -> None: + self._custom = custom + + self.create = async_to_raw_response_wrapper( + custom.create, + ) + self.update = async_to_raw_response_wrapper( + custom.update, + ) + self.list = async_to_raw_response_wrapper( + custom.list, + ) + self.delete = async_to_raw_response_wrapper( + custom.delete, + ) + self.get = async_to_raw_response_wrapper( + custom.get, + ) + + +class CustomResourceWithStreamingResponse: + def __init__(self, custom: CustomResource) -> None: + self._custom = custom + + self.create = to_streamed_response_wrapper( + custom.create, + ) + self.update = to_streamed_response_wrapper( + custom.update, + ) + self.list = to_streamed_response_wrapper( + custom.list, + ) + self.delete = to_streamed_response_wrapper( + custom.delete, + ) + self.get = to_streamed_response_wrapper( + custom.get, + ) + + +class AsyncCustomResourceWithStreamingResponse: + def __init__(self, custom: AsyncCustomResource) -> None: + self._custom = custom + + self.create = async_to_streamed_response_wrapper( + custom.create, + ) + self.update = async_to_streamed_response_wrapper( + custom.update, + ) + self.list = async_to_streamed_response_wrapper( + custom.list, + ) + self.delete = async_to_streamed_response_wrapper( + custom.delete, + ) + self.get = async_to_streamed_response_wrapper( + custom.get, + ) diff --git a/src/cloudflare/resources/zero_trust/dlp/entries.py b/src/cloudflare/resources/zero_trust/dlp/entries/entries.py similarity index 81% rename from src/cloudflare/resources/zero_trust/dlp/entries.py rename to src/cloudflare/resources/zero_trust/dlp/entries/entries.py index 162b3e79fe5..a2e7b357ae1 100644 --- a/src/cloudflare/resources/zero_trust/dlp/entries.py +++ b/src/cloudflare/resources/zero_trust/dlp/entries/entries.py @@ -7,30 +7,66 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import required_args, maybe_transform, async_maybe_transform -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from .custom import ( + CustomResource, + AsyncCustomResource, + CustomResourceWithRawResponse, + AsyncCustomResourceWithRawResponse, + CustomResourceWithStreamingResponse, + AsyncCustomResourceWithStreamingResponse, +) +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ....._utils import required_args, maybe_transform, async_maybe_transform +from .predefined import ( + PredefinedResource, + AsyncPredefinedResource, + PredefinedResourceWithRawResponse, + AsyncPredefinedResourceWithRawResponse, + PredefinedResourceWithStreamingResponse, + AsyncPredefinedResourceWithStreamingResponse, +) +from ....._compat import cached_property +from .integration import ( + IntegrationResource, + AsyncIntegrationResource, + IntegrationResourceWithRawResponse, + AsyncIntegrationResourceWithRawResponse, + IntegrationResourceWithStreamingResponse, + AsyncIntegrationResourceWithStreamingResponse, +) +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.zero_trust.dlp import entry_create_params, entry_update_params -from ....types.zero_trust.dlp.entry_get_response import EntryGetResponse -from ....types.zero_trust.dlp.entry_list_response import EntryListResponse -from ....types.zero_trust.dlp.entry_create_response import EntryCreateResponse -from ....types.zero_trust.dlp.entry_update_response import EntryUpdateResponse -from ....types.zero_trust.dlp.profiles.pattern_param import PatternParam +from ....._wrappers import ResultWrapper +from .....pagination import SyncSinglePage, AsyncSinglePage +from ....._base_client import AsyncPaginator, make_request_options +from .....types.zero_trust.dlp import entry_create_params, entry_update_params +from .....types.zero_trust.dlp.entry_get_response import EntryGetResponse +from .....types.zero_trust.dlp.entry_list_response import EntryListResponse +from .....types.zero_trust.dlp.entry_create_response import EntryCreateResponse +from .....types.zero_trust.dlp.entry_update_response import EntryUpdateResponse +from .....types.zero_trust.dlp.profiles.pattern_param import PatternParam __all__ = ["EntriesResource", "AsyncEntriesResource"] class EntriesResource(SyncAPIResource): + @cached_property + def custom(self) -> CustomResource: + return CustomResource(self._client) + + @cached_property + def predefined(self) -> PredefinedResource: + return PredefinedResource(self._client) + + @cached_property + def integration(self) -> IntegrationResource: + return IntegrationResource(self._client) + @cached_property def with_raw_response(self) -> EntriesResourceWithRawResponse: """ @@ -57,13 +93,13 @@ def create( enabled: bool, name: str, pattern: PatternParam, - profile_id: str, + profile_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryCreateResponse]: """ Creates a DLP custom entry. @@ -109,13 +145,13 @@ def update( name: str, pattern: PatternParam, type: Literal["custom"], - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryUpdateResponse]: """ Updates a DLP entry. @@ -138,13 +174,13 @@ def update( *, account_id: str, type: Literal["predefined"], - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryUpdateResponse]: """ Updates a DLP entry. @@ -167,13 +203,13 @@ def update( *, account_id: str, type: Literal["integration"], - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryUpdateResponse]: """ Updates a DLP entry. @@ -195,16 +231,16 @@ def update( entry_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - pattern: PatternParam | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + pattern: PatternParam | Omit = omit, type: Literal["custom"] | Literal["predefined"] | Literal["integration"], - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -245,7 +281,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[EntryListResponse]: """ Lists all DLP entries in an account. @@ -280,7 +316,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a DLP custom entry. @@ -320,7 +356,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryGetResponse]: """ Fetches a DLP entry by ID. @@ -357,6 +393,18 @@ def get( class AsyncEntriesResource(AsyncAPIResource): + @cached_property + def custom(self) -> AsyncCustomResource: + return AsyncCustomResource(self._client) + + @cached_property + def predefined(self) -> AsyncPredefinedResource: + return AsyncPredefinedResource(self._client) + + @cached_property + def integration(self) -> AsyncIntegrationResource: + return AsyncIntegrationResource(self._client) + @cached_property def with_raw_response(self) -> AsyncEntriesResourceWithRawResponse: """ @@ -383,13 +431,13 @@ async def create( enabled: bool, name: str, pattern: PatternParam, - profile_id: str, + profile_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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryCreateResponse]: """ Creates a DLP custom entry. @@ -435,13 +483,13 @@ async def update( name: str, pattern: PatternParam, type: Literal["custom"], - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryUpdateResponse]: """ Updates a DLP entry. @@ -464,13 +512,13 @@ async def update( *, account_id: str, type: Literal["predefined"], - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryUpdateResponse]: """ Updates a DLP entry. @@ -493,13 +541,13 @@ async def update( *, account_id: str, type: Literal["integration"], - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryUpdateResponse]: """ Updates a DLP entry. @@ -521,16 +569,16 @@ async def update( entry_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - pattern: PatternParam | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + pattern: PatternParam | Omit = omit, type: Literal["custom"] | Literal["predefined"] | Literal["integration"], - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") @@ -571,7 +619,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EntryListResponse, AsyncSinglePage[EntryListResponse]]: """ Lists all DLP entries in an account. @@ -606,7 +654,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a DLP custom entry. @@ -646,7 +694,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryGetResponse]: """ Fetches a DLP entry by ID. @@ -702,6 +750,18 @@ def __init__(self, entries: EntriesResource) -> None: entries.get, ) + @cached_property + def custom(self) -> CustomResourceWithRawResponse: + return CustomResourceWithRawResponse(self._entries.custom) + + @cached_property + def predefined(self) -> PredefinedResourceWithRawResponse: + return PredefinedResourceWithRawResponse(self._entries.predefined) + + @cached_property + def integration(self) -> IntegrationResourceWithRawResponse: + return IntegrationResourceWithRawResponse(self._entries.integration) + class AsyncEntriesResourceWithRawResponse: def __init__(self, entries: AsyncEntriesResource) -> None: @@ -723,6 +783,18 @@ def __init__(self, entries: AsyncEntriesResource) -> None: entries.get, ) + @cached_property + def custom(self) -> AsyncCustomResourceWithRawResponse: + return AsyncCustomResourceWithRawResponse(self._entries.custom) + + @cached_property + def predefined(self) -> AsyncPredefinedResourceWithRawResponse: + return AsyncPredefinedResourceWithRawResponse(self._entries.predefined) + + @cached_property + def integration(self) -> AsyncIntegrationResourceWithRawResponse: + return AsyncIntegrationResourceWithRawResponse(self._entries.integration) + class EntriesResourceWithStreamingResponse: def __init__(self, entries: EntriesResource) -> None: @@ -744,6 +816,18 @@ def __init__(self, entries: EntriesResource) -> None: entries.get, ) + @cached_property + def custom(self) -> CustomResourceWithStreamingResponse: + return CustomResourceWithStreamingResponse(self._entries.custom) + + @cached_property + def predefined(self) -> PredefinedResourceWithStreamingResponse: + return PredefinedResourceWithStreamingResponse(self._entries.predefined) + + @cached_property + def integration(self) -> IntegrationResourceWithStreamingResponse: + return IntegrationResourceWithStreamingResponse(self._entries.integration) + class AsyncEntriesResourceWithStreamingResponse: def __init__(self, entries: AsyncEntriesResource) -> None: @@ -764,3 +848,15 @@ def __init__(self, entries: AsyncEntriesResource) -> None: self.get = async_to_streamed_response_wrapper( entries.get, ) + + @cached_property + def custom(self) -> AsyncCustomResourceWithStreamingResponse: + return AsyncCustomResourceWithStreamingResponse(self._entries.custom) + + @cached_property + def predefined(self) -> AsyncPredefinedResourceWithStreamingResponse: + return AsyncPredefinedResourceWithStreamingResponse(self._entries.predefined) + + @cached_property + def integration(self) -> AsyncIntegrationResourceWithStreamingResponse: + return AsyncIntegrationResourceWithStreamingResponse(self._entries.integration) diff --git a/src/cloudflare/resources/zero_trust/dlp/entries/integration.py b/src/cloudflare/resources/zero_trust/dlp/entries/integration.py new file mode 100644 index 00000000000..0e6c86883f4 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dlp/entries/integration.py @@ -0,0 +1,582 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Any, 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.zero_trust.dlp.entries import integration_create_params, integration_update_params +from .....types.zero_trust.dlp.entries.integration_get_response import IntegrationGetResponse +from .....types.zero_trust.dlp.entries.integration_list_response import IntegrationListResponse +from .....types.zero_trust.dlp.entries.integration_create_response import IntegrationCreateResponse +from .....types.zero_trust.dlp.entries.integration_update_response import IntegrationUpdateResponse + +__all__ = ["IntegrationResource", "AsyncIntegrationResource"] + + +class IntegrationResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> IntegrationResourceWithRawResponse: + """ + 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 IntegrationResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> IntegrationResourceWithStreamingResponse: + """ + 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 IntegrationResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + enabled: bool, + entry_id: str, + profile_id: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[IntegrationCreateResponse]: + """ + Integration entries can't be created, this will update an existing integration + entry This is needed for our generated terraform API + + Args: + profile_id: This field is not actually used as the owning profile for a predefined entry is + already set to a predefined profile + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/dlp/entries/integration", + body=maybe_transform( + { + "enabled": enabled, + "entry_id": entry_id, + "profile_id": profile_id, + }, + integration_create_params.IntegrationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[IntegrationCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[IntegrationCreateResponse]], ResultWrapper[IntegrationCreateResponse]), + ) + + def update( + self, + entry_id: str, + *, + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[IntegrationUpdateResponse]: + """ + Updates a DLP entry. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return self._put( + f"/accounts/{account_id}/dlp/entries/integration/{entry_id}", + body=maybe_transform({"enabled": enabled}, integration_update_params.IntegrationUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[IntegrationUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[IntegrationUpdateResponse]], ResultWrapper[IntegrationUpdateResponse]), + ) + + def list( + 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[IntegrationListResponse]: + """ + Lists all DLP entries in an account. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if 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}/dlp/entries", + page=SyncSinglePage[IntegrationListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=cast(Any, IntegrationListResponse), # Union types cannot be passed in as arguments in the type system + ) + + def delete( + self, + entry_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, + ) -> object: + """ + This is a no-op as integration entires can't be deleted but is needed for our + generated terraform API + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return self._delete( + f"/accounts/{account_id}/dlp/entries/integration/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + def get( + self, + entry_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, + ) -> Optional[IntegrationGetResponse]: + """ + Fetches a DLP entry by ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return cast( + Optional[IntegrationGetResponse], + self._get( + f"/accounts/{account_id}/dlp/entries/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[IntegrationGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[IntegrationGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class AsyncIntegrationResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncIntegrationResourceWithRawResponse: + """ + 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 AsyncIntegrationResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncIntegrationResourceWithStreamingResponse: + """ + 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 AsyncIntegrationResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + enabled: bool, + entry_id: str, + profile_id: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[IntegrationCreateResponse]: + """ + Integration entries can't be created, this will update an existing integration + entry This is needed for our generated terraform API + + Args: + profile_id: This field is not actually used as the owning profile for a predefined entry is + already set to a predefined profile + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/dlp/entries/integration", + body=await async_maybe_transform( + { + "enabled": enabled, + "entry_id": entry_id, + "profile_id": profile_id, + }, + integration_create_params.IntegrationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[IntegrationCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[IntegrationCreateResponse]], ResultWrapper[IntegrationCreateResponse]), + ) + + async def update( + self, + entry_id: str, + *, + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[IntegrationUpdateResponse]: + """ + Updates a DLP entry. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return await self._put( + f"/accounts/{account_id}/dlp/entries/integration/{entry_id}", + body=await async_maybe_transform({"enabled": enabled}, integration_update_params.IntegrationUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[IntegrationUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[IntegrationUpdateResponse]], ResultWrapper[IntegrationUpdateResponse]), + ) + + def list( + 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[IntegrationListResponse, AsyncSinglePage[IntegrationListResponse]]: + """ + Lists all DLP entries in an account. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if 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}/dlp/entries", + page=AsyncSinglePage[IntegrationListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=cast(Any, IntegrationListResponse), # Union types cannot be passed in as arguments in the type system + ) + + async def delete( + self, + entry_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, + ) -> object: + """ + This is a no-op as integration entires can't be deleted but is needed for our + generated terraform API + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return await self._delete( + f"/accounts/{account_id}/dlp/entries/integration/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + async def get( + self, + entry_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, + ) -> Optional[IntegrationGetResponse]: + """ + Fetches a DLP entry by ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return cast( + Optional[IntegrationGetResponse], + await self._get( + f"/accounts/{account_id}/dlp/entries/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[IntegrationGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[IntegrationGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class IntegrationResourceWithRawResponse: + def __init__(self, integration: IntegrationResource) -> None: + self._integration = integration + + self.create = to_raw_response_wrapper( + integration.create, + ) + self.update = to_raw_response_wrapper( + integration.update, + ) + self.list = to_raw_response_wrapper( + integration.list, + ) + self.delete = to_raw_response_wrapper( + integration.delete, + ) + self.get = to_raw_response_wrapper( + integration.get, + ) + + +class AsyncIntegrationResourceWithRawResponse: + def __init__(self, integration: AsyncIntegrationResource) -> None: + self._integration = integration + + self.create = async_to_raw_response_wrapper( + integration.create, + ) + self.update = async_to_raw_response_wrapper( + integration.update, + ) + self.list = async_to_raw_response_wrapper( + integration.list, + ) + self.delete = async_to_raw_response_wrapper( + integration.delete, + ) + self.get = async_to_raw_response_wrapper( + integration.get, + ) + + +class IntegrationResourceWithStreamingResponse: + def __init__(self, integration: IntegrationResource) -> None: + self._integration = integration + + self.create = to_streamed_response_wrapper( + integration.create, + ) + self.update = to_streamed_response_wrapper( + integration.update, + ) + self.list = to_streamed_response_wrapper( + integration.list, + ) + self.delete = to_streamed_response_wrapper( + integration.delete, + ) + self.get = to_streamed_response_wrapper( + integration.get, + ) + + +class AsyncIntegrationResourceWithStreamingResponse: + def __init__(self, integration: AsyncIntegrationResource) -> None: + self._integration = integration + + self.create = async_to_streamed_response_wrapper( + integration.create, + ) + self.update = async_to_streamed_response_wrapper( + integration.update, + ) + self.list = async_to_streamed_response_wrapper( + integration.list, + ) + self.delete = async_to_streamed_response_wrapper( + integration.delete, + ) + self.get = async_to_streamed_response_wrapper( + integration.get, + ) diff --git a/src/cloudflare/resources/zero_trust/dlp/entries/predefined.py b/src/cloudflare/resources/zero_trust/dlp/entries/predefined.py new file mode 100644 index 00000000000..cc42dc1e6d9 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dlp/entries/predefined.py @@ -0,0 +1,582 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Any, 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.zero_trust.dlp.entries import predefined_create_params, predefined_update_params +from .....types.zero_trust.dlp.entries.predefined_get_response import PredefinedGetResponse +from .....types.zero_trust.dlp.entries.predefined_list_response import PredefinedListResponse +from .....types.zero_trust.dlp.entries.predefined_create_response import PredefinedCreateResponse +from .....types.zero_trust.dlp.entries.predefined_update_response import PredefinedUpdateResponse + +__all__ = ["PredefinedResource", "AsyncPredefinedResource"] + + +class PredefinedResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> PredefinedResourceWithRawResponse: + """ + 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 PredefinedResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PredefinedResourceWithStreamingResponse: + """ + 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 PredefinedResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + enabled: bool, + entry_id: str, + profile_id: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[PredefinedCreateResponse]: + """ + Predefined entries can't be created, this will update an existing predefined + entry This is needed for our generated terraform API + + Args: + profile_id: This field is not actually used as the owning profile for a predefined entry is + already set to a predefined profile + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/dlp/entries/predefined", + body=maybe_transform( + { + "enabled": enabled, + "entry_id": entry_id, + "profile_id": profile_id, + }, + predefined_create_params.PredefinedCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PredefinedCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[PredefinedCreateResponse]], ResultWrapper[PredefinedCreateResponse]), + ) + + def update( + self, + entry_id: str, + *, + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[PredefinedUpdateResponse]: + """ + Updates a DLP entry. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return self._put( + f"/accounts/{account_id}/dlp/entries/predefined/{entry_id}", + body=maybe_transform({"enabled": enabled}, predefined_update_params.PredefinedUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PredefinedUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[PredefinedUpdateResponse]], ResultWrapper[PredefinedUpdateResponse]), + ) + + def list( + 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[PredefinedListResponse]: + """ + Lists all DLP entries in an account. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if 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}/dlp/entries", + page=SyncSinglePage[PredefinedListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=cast(Any, PredefinedListResponse), # Union types cannot be passed in as arguments in the type system + ) + + def delete( + self, + entry_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, + ) -> object: + """ + This is a no-op as predefined entires can't be deleted but is needed for our + generated terraform API + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return self._delete( + f"/accounts/{account_id}/dlp/entries/predefined/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + def get( + self, + entry_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, + ) -> Optional[PredefinedGetResponse]: + """ + Fetches a DLP entry by ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return cast( + Optional[PredefinedGetResponse], + self._get( + f"/accounts/{account_id}/dlp/entries/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PredefinedGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[PredefinedGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class AsyncPredefinedResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncPredefinedResourceWithRawResponse: + """ + 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 AsyncPredefinedResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPredefinedResourceWithStreamingResponse: + """ + 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 AsyncPredefinedResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + enabled: bool, + entry_id: str, + profile_id: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[PredefinedCreateResponse]: + """ + Predefined entries can't be created, this will update an existing predefined + entry This is needed for our generated terraform API + + Args: + profile_id: This field is not actually used as the owning profile for a predefined entry is + already set to a predefined profile + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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}/dlp/entries/predefined", + body=await async_maybe_transform( + { + "enabled": enabled, + "entry_id": entry_id, + "profile_id": profile_id, + }, + predefined_create_params.PredefinedCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PredefinedCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[PredefinedCreateResponse]], ResultWrapper[PredefinedCreateResponse]), + ) + + async def update( + self, + entry_id: str, + *, + 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[PredefinedUpdateResponse]: + """ + Updates a DLP entry. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return await self._put( + f"/accounts/{account_id}/dlp/entries/predefined/{entry_id}", + body=await async_maybe_transform({"enabled": enabled}, predefined_update_params.PredefinedUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PredefinedUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[PredefinedUpdateResponse]], ResultWrapper[PredefinedUpdateResponse]), + ) + + def list( + 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[PredefinedListResponse, AsyncSinglePage[PredefinedListResponse]]: + """ + Lists all DLP entries in an account. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if 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}/dlp/entries", + page=AsyncSinglePage[PredefinedListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=cast(Any, PredefinedListResponse), # Union types cannot be passed in as arguments in the type system + ) + + async def delete( + self, + entry_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, + ) -> object: + """ + This is a no-op as predefined entires can't be deleted but is needed for our + generated terraform API + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return await self._delete( + f"/accounts/{account_id}/dlp/entries/predefined/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + async def get( + self, + entry_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, + ) -> Optional[PredefinedGetResponse]: + """ + Fetches a DLP entry by ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not entry_id: + raise ValueError(f"Expected a non-empty value for `entry_id` but received {entry_id!r}") + return cast( + Optional[PredefinedGetResponse], + await self._get( + f"/accounts/{account_id}/dlp/entries/{entry_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PredefinedGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[PredefinedGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class PredefinedResourceWithRawResponse: + def __init__(self, predefined: PredefinedResource) -> None: + self._predefined = predefined + + self.create = to_raw_response_wrapper( + predefined.create, + ) + self.update = to_raw_response_wrapper( + predefined.update, + ) + self.list = to_raw_response_wrapper( + predefined.list, + ) + self.delete = to_raw_response_wrapper( + predefined.delete, + ) + self.get = to_raw_response_wrapper( + predefined.get, + ) + + +class AsyncPredefinedResourceWithRawResponse: + def __init__(self, predefined: AsyncPredefinedResource) -> None: + self._predefined = predefined + + self.create = async_to_raw_response_wrapper( + predefined.create, + ) + self.update = async_to_raw_response_wrapper( + predefined.update, + ) + self.list = async_to_raw_response_wrapper( + predefined.list, + ) + self.delete = async_to_raw_response_wrapper( + predefined.delete, + ) + self.get = async_to_raw_response_wrapper( + predefined.get, + ) + + +class PredefinedResourceWithStreamingResponse: + def __init__(self, predefined: PredefinedResource) -> None: + self._predefined = predefined + + self.create = to_streamed_response_wrapper( + predefined.create, + ) + self.update = to_streamed_response_wrapper( + predefined.update, + ) + self.list = to_streamed_response_wrapper( + predefined.list, + ) + self.delete = to_streamed_response_wrapper( + predefined.delete, + ) + self.get = to_streamed_response_wrapper( + predefined.get, + ) + + +class AsyncPredefinedResourceWithStreamingResponse: + def __init__(self, predefined: AsyncPredefinedResource) -> None: + self._predefined = predefined + + self.create = async_to_streamed_response_wrapper( + predefined.create, + ) + self.update = async_to_streamed_response_wrapper( + predefined.update, + ) + self.list = async_to_streamed_response_wrapper( + predefined.list, + ) + self.delete = async_to_streamed_response_wrapper( + predefined.delete, + ) + self.get = async_to_streamed_response_wrapper( + predefined.get, + ) diff --git a/src/cloudflare/resources/zero_trust/dlp/limits.py b/src/cloudflare/resources/zero_trust/dlp/limits.py index ad07e0c670e..ea5843c492c 100755 --- a/src/cloudflare/resources/zero_trust/dlp/limits.py +++ b/src/cloudflare/resources/zero_trust/dlp/limits.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,7 +51,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LimitListResponse]: """ Fetch limits associated with DLP for account @@ -109,7 +109,7 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LimitListResponse]: """ Fetch limits associated with DLP for account diff --git a/src/cloudflare/resources/zero_trust/dlp/patterns.py b/src/cloudflare/resources/zero_trust/dlp/patterns.py index cadb00e40ce..445c21a725f 100644 --- a/src/cloudflare/resources/zero_trust/dlp/patterns.py +++ b/src/cloudflare/resources/zero_trust/dlp/patterns.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,13 +49,13 @@ def validate( *, account_id: str, regex: str, - max_match_bytes: Optional[int] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PatternValidateResponse]: """Validates whether this pattern is a valid regular expression. @@ -130,13 +130,13 @@ async def validate( *, account_id: str, regex: str, - max_match_bytes: Optional[int] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PatternValidateResponse]: """Validates whether this pattern is a valid regular expression. diff --git a/src/cloudflare/resources/zero_trust/dlp/payload_logs.py b/src/cloudflare/resources/zero_trust/dlp/payload_logs.py index a7d9508dc82..99dbbf7784c 100644 --- a/src/cloudflare/resources/zero_trust/dlp/payload_logs.py +++ b/src/cloudflare/resources/zero_trust/dlp/payload_logs.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,13 +49,13 @@ def update( self, *, account_id: str, - public_key: Optional[str] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PayloadLogUpdateResponse]: """ Set payload log settings @@ -93,7 +93,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PayloadLogGetResponse]: """ Get payload log settings @@ -146,13 +146,13 @@ async def update( self, *, account_id: str, - public_key: Optional[str] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PayloadLogUpdateResponse]: """ Set payload log settings @@ -192,7 +192,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PayloadLogGetResponse]: """ Get payload log settings diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py index 9f78c302803..586ccceee16 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,21 +49,21 @@ def create( self, *, account_id: str, - entries: Iterable[custom_create_params.Entry], name: str, - ai_context_enabled: bool | NotGiven = NOT_GIVEN, - allowed_match_count: int | NotGiven = NOT_GIVEN, - confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, - context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - ocr_enabled: bool | NotGiven = NOT_GIVEN, - shared_entries: Iterable[custom_create_params.SharedEntry] | NotGiven = NOT_GIVEN, + ai_context_enabled: bool | Omit = omit, + allowed_match_count: int | Omit = omit, + confidence_threshold: Optional[str] | Omit = omit, + context_awareness: ContextAwarenessParam | Omit = omit, + description: Optional[str] | Omit = omit, + entries: Iterable[custom_create_params.Entry] | Omit = omit, + ocr_enabled: bool | Omit = omit, + shared_entries: Iterable[custom_create_params.SharedEntry] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """ Creates a DLP custom profile. @@ -95,13 +95,13 @@ def create( f"/accounts/{account_id}/dlp/profiles/custom", body=maybe_transform( { - "entries": entries, "name": name, "ai_context_enabled": ai_context_enabled, "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, "description": description, + "entries": entries, "ocr_enabled": ocr_enabled, "shared_entries": shared_entries, }, @@ -126,20 +126,20 @@ def update( *, account_id: str, name: str, - ai_context_enabled: bool | NotGiven = NOT_GIVEN, - allowed_match_count: Optional[int] | NotGiven = NOT_GIVEN, - confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, - context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - entries: Optional[Iterable[custom_update_params.Entry]] | NotGiven = NOT_GIVEN, - ocr_enabled: bool | NotGiven = NOT_GIVEN, - shared_entries: Iterable[custom_update_params.SharedEntry] | NotGiven = NOT_GIVEN, + ai_context_enabled: bool | Omit = omit, + allowed_match_count: Optional[int] | Omit = omit, + confidence_threshold: Optional[str] | Omit = omit, + context_awareness: ContextAwarenessParam | Omit = omit, + description: Optional[str] | Omit = omit, + entries: Optional[Iterable[custom_update_params.Entry]] | Omit = omit, + ocr_enabled: bool | Omit = omit, + shared_entries: Iterable[custom_update_params.SharedEntry] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """ Updates a DLP custom profile. @@ -208,7 +208,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a DLP custom profile. @@ -248,7 +248,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """ Fetches a custom DLP profile by id. @@ -308,21 +308,21 @@ async def create( self, *, account_id: str, - entries: Iterable[custom_create_params.Entry], name: str, - ai_context_enabled: bool | NotGiven = NOT_GIVEN, - allowed_match_count: int | NotGiven = NOT_GIVEN, - confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, - context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - ocr_enabled: bool | NotGiven = NOT_GIVEN, - shared_entries: Iterable[custom_create_params.SharedEntry] | NotGiven = NOT_GIVEN, + ai_context_enabled: bool | Omit = omit, + allowed_match_count: int | Omit = omit, + confidence_threshold: Optional[str] | Omit = omit, + context_awareness: ContextAwarenessParam | Omit = omit, + description: Optional[str] | Omit = omit, + entries: Iterable[custom_create_params.Entry] | Omit = omit, + ocr_enabled: bool | Omit = omit, + shared_entries: Iterable[custom_create_params.SharedEntry] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """ Creates a DLP custom profile. @@ -354,13 +354,13 @@ async def create( f"/accounts/{account_id}/dlp/profiles/custom", body=await async_maybe_transform( { - "entries": entries, "name": name, "ai_context_enabled": ai_context_enabled, "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, "description": description, + "entries": entries, "ocr_enabled": ocr_enabled, "shared_entries": shared_entries, }, @@ -385,20 +385,20 @@ async def update( *, account_id: str, name: str, - ai_context_enabled: bool | NotGiven = NOT_GIVEN, - allowed_match_count: Optional[int] | NotGiven = NOT_GIVEN, - confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, - context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - entries: Optional[Iterable[custom_update_params.Entry]] | NotGiven = NOT_GIVEN, - ocr_enabled: bool | NotGiven = NOT_GIVEN, - shared_entries: Iterable[custom_update_params.SharedEntry] | NotGiven = NOT_GIVEN, + ai_context_enabled: bool | Omit = omit, + allowed_match_count: Optional[int] | Omit = omit, + confidence_threshold: Optional[str] | Omit = omit, + context_awareness: ContextAwarenessParam | Omit = omit, + description: Optional[str] | Omit = omit, + entries: Optional[Iterable[custom_update_params.Entry]] | Omit = omit, + ocr_enabled: bool | Omit = omit, + shared_entries: Iterable[custom_update_params.SharedEntry] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """ Updates a DLP custom profile. @@ -467,7 +467,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a DLP custom profile. @@ -507,7 +507,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """ Fetches a custom DLP profile by id. diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py index 9eafd67697f..0456dd1a6f3 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import Any, Iterable, Optional, cast +from typing import Any, Type, Iterable, Optional, cast import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -19,7 +19,7 @@ from ....._wrappers import ResultWrapper from ....._base_client import make_request_options from .....types.zero_trust.dlp.profile import Profile -from .....types.zero_trust.dlp.profiles import predefined_update_params +from .....types.zero_trust.dlp.profiles import predefined_create_params, predefined_update_params from .....types.zero_trust.dlp.context_awareness_param import ContextAwarenessParam __all__ = ["PredefinedResource", "AsyncPredefinedResource"] @@ -45,23 +45,88 @@ def with_streaming_response(self) -> PredefinedResourceWithStreamingResponse: """ return PredefinedResourceWithStreamingResponse(self) + def create( + self, + *, + account_id: str, + profile_id: str, + ai_context_enabled: bool | Omit = omit, + allowed_match_count: Optional[int] | Omit = omit, + confidence_threshold: Optional[str] | Omit = omit, + context_awareness: ContextAwarenessParam | Omit = omit, + entries: Iterable[predefined_create_params.Entry] | Omit = omit, + ocr_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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[Profile]: + """Creates a DLP predefined profile. + + Only supports enabling/disabling entries. + + Args: + context_awareness: Scan the context of predefined entries to only return matches surrounded by + keywords. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 cast( + Optional[Profile], + self._post( + f"/accounts/{account_id}/dlp/profiles/predefined", + body=maybe_transform( + { + "profile_id": profile_id, + "ai_context_enabled": ai_context_enabled, + "allowed_match_count": allowed_match_count, + "confidence_threshold": confidence_threshold, + "context_awareness": context_awareness, + "entries": entries, + "ocr_enabled": ocr_enabled, + }, + predefined_create_params.PredefinedCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[Profile] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + def update( self, profile_id: str, *, account_id: str, - ai_context_enabled: bool | NotGiven = NOT_GIVEN, - allowed_match_count: Optional[int] | NotGiven = NOT_GIVEN, - confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, - context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, - entries: Iterable[predefined_update_params.Entry] | NotGiven = NOT_GIVEN, - ocr_enabled: bool | NotGiven = NOT_GIVEN, + ai_context_enabled: bool | Omit = omit, + allowed_match_count: Optional[int] | Omit = omit, + confidence_threshold: Optional[str] | Omit = omit, + context_awareness: ContextAwarenessParam | Omit = omit, + entries: Iterable[predefined_update_params.Entry] | Omit = omit, + ocr_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """Updates a DLP predefined profile. @@ -111,6 +176,47 @@ def update( ), ) + def delete( + self, + profile_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, + ) -> object: + """ + This is a no-op as predefined profiles can't be deleted but is needed for our + generated terraform API + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not profile_id: + raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") + return self._delete( + f"/accounts/{account_id}/dlp/profiles/predefined/{profile_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + def get( self, profile_id: str, @@ -121,7 +227,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """ Fetches a predefined DLP profile by id. @@ -177,23 +283,88 @@ def with_streaming_response(self) -> AsyncPredefinedResourceWithStreamingRespons """ return AsyncPredefinedResourceWithStreamingResponse(self) + async def create( + self, + *, + account_id: str, + profile_id: str, + ai_context_enabled: bool | Omit = omit, + allowed_match_count: Optional[int] | Omit = omit, + confidence_threshold: Optional[str] | Omit = omit, + context_awareness: ContextAwarenessParam | Omit = omit, + entries: Iterable[predefined_create_params.Entry] | Omit = omit, + ocr_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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> Optional[Profile]: + """Creates a DLP predefined profile. + + Only supports enabling/disabling entries. + + Args: + context_awareness: Scan the context of predefined entries to only return matches surrounded by + keywords. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 cast( + Optional[Profile], + await self._post( + f"/accounts/{account_id}/dlp/profiles/predefined", + body=await async_maybe_transform( + { + "profile_id": profile_id, + "ai_context_enabled": ai_context_enabled, + "allowed_match_count": allowed_match_count, + "confidence_threshold": confidence_threshold, + "context_awareness": context_awareness, + "entries": entries, + "ocr_enabled": ocr_enabled, + }, + predefined_create_params.PredefinedCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[Profile] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + async def update( self, profile_id: str, *, account_id: str, - ai_context_enabled: bool | NotGiven = NOT_GIVEN, - allowed_match_count: Optional[int] | NotGiven = NOT_GIVEN, - confidence_threshold: Optional[str] | NotGiven = NOT_GIVEN, - context_awareness: ContextAwarenessParam | NotGiven = NOT_GIVEN, - entries: Iterable[predefined_update_params.Entry] | NotGiven = NOT_GIVEN, - ocr_enabled: bool | NotGiven = NOT_GIVEN, + ai_context_enabled: bool | Omit = omit, + allowed_match_count: Optional[int] | Omit = omit, + confidence_threshold: Optional[str] | Omit = omit, + context_awareness: ContextAwarenessParam | Omit = omit, + entries: Iterable[predefined_update_params.Entry] | Omit = omit, + ocr_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """Updates a DLP predefined profile. @@ -243,6 +414,47 @@ async def update( ), ) + async def delete( + self, + profile_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, + ) -> object: + """ + This is a no-op as predefined profiles can't be deleted but is needed for our + generated terraform API + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not profile_id: + raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") + return await self._delete( + f"/accounts/{account_id}/dlp/profiles/predefined/{profile_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + async def get( self, profile_id: str, @@ -253,7 +465,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """ Fetches a predefined DLP profile by id. @@ -293,9 +505,15 @@ class PredefinedResourceWithRawResponse: def __init__(self, predefined: PredefinedResource) -> None: self._predefined = predefined + self.create = to_raw_response_wrapper( + predefined.create, + ) self.update = to_raw_response_wrapper( predefined.update, ) + self.delete = to_raw_response_wrapper( + predefined.delete, + ) self.get = to_raw_response_wrapper( predefined.get, ) @@ -305,9 +523,15 @@ class AsyncPredefinedResourceWithRawResponse: def __init__(self, predefined: AsyncPredefinedResource) -> None: self._predefined = predefined + self.create = async_to_raw_response_wrapper( + predefined.create, + ) self.update = async_to_raw_response_wrapper( predefined.update, ) + self.delete = async_to_raw_response_wrapper( + predefined.delete, + ) self.get = async_to_raw_response_wrapper( predefined.get, ) @@ -317,9 +541,15 @@ class PredefinedResourceWithStreamingResponse: def __init__(self, predefined: PredefinedResource) -> None: self._predefined = predefined + self.create = to_streamed_response_wrapper( + predefined.create, + ) self.update = to_streamed_response_wrapper( predefined.update, ) + self.delete = to_streamed_response_wrapper( + predefined.delete, + ) self.get = to_streamed_response_wrapper( predefined.get, ) @@ -329,9 +559,15 @@ class AsyncPredefinedResourceWithStreamingResponse: def __init__(self, predefined: AsyncPredefinedResource) -> None: self._predefined = predefined + self.create = async_to_streamed_response_wrapper( + predefined.create, + ) self.update = async_to_streamed_response_wrapper( predefined.update, ) + self.delete = async_to_streamed_response_wrapper( + predefined.delete, + ) self.get = async_to_streamed_response_wrapper( predefined.get, ) diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py b/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py index 7aecf2823e9..cb224c7e480 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py @@ -14,7 +14,7 @@ CustomResourceWithStreamingResponse, AsyncCustomResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import maybe_transform from .predefined import ( PredefinedResource, @@ -73,13 +73,13 @@ def list( self, *, account_id: str, - all: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Profile]: """ Lists all DLP profiles in an account. @@ -121,7 +121,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """ Fetches a DLP profile by ID. @@ -189,13 +189,13 @@ def list( self, *, account_id: str, - all: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Profile, AsyncSinglePage[Profile]]: """ Lists all DLP profiles in an account. @@ -237,7 +237,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Profile]: """ Fetches a DLP profile by ID. diff --git a/src/cloudflare/resources/zero_trust/gateway/app_types.py b/src/cloudflare/resources/zero_trust/gateway/app_types.py index e3060f777db..231d4edb066 100644 --- a/src/cloudflare/resources/zero_trust/gateway/app_types.py +++ b/src/cloudflare/resources/zero_trust/gateway/app_types.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,13 +51,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[AppType]: """ - Fetches all application and application type mappings. + List all application and application type mappings. Args: - account_id: Identifier + account_id: Provide the identifier string. extra_headers: Send extra headers @@ -108,13 +108,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AppType, AsyncSinglePage[AppType]]: """ - Fetches all application and application type mappings. + List all application and application type mappings. Args: - account_id: Identifier + account_id: Provide the identifier string. extra_headers: Send extra headers 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 faebef74b67..9a726288e7c 100644 --- a/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py +++ b/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,15 +54,15 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewaySettings]: """ - Updates Zero Trust Audit SSH and SSH with Access for Infrastructure settings for + Update Zero Trust Audit SSH and SSH with Access for Infrastructure settings for an account. Args: - public_key: Base64 encoded HPKE public key used to encrypt all your ssh session logs. - https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#enable-ssh-command-logging + public_key: Provide the Base64-encoded HPKE public key that encrypts SSH session logs. See + https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#enable-ssh-command-logging. extra_headers: Send extra headers @@ -98,11 +98,11 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewaySettings]: """ - Gets all Zero Trust Audit SSH and SSH with Access for Infrastructure settings - for an account. + Retrieve all Zero Trust Audit SSH and SSH with Access for Infrastructure + settings for an account. Args: extra_headers: Send extra headers @@ -136,11 +136,11 @@ def rotate_seed( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewaySettings]: """ - Rotates the SSH account seed that is used for generating the host key identity - when connecting through the Cloudflare SSH Proxy. + Rotate the SSH account seed that generates the host key identity when connecting + through the Cloudflare SSH Proxy. Args: extra_headers: Send extra headers @@ -196,15 +196,15 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewaySettings]: """ - Updates Zero Trust Audit SSH and SSH with Access for Infrastructure settings for + Update Zero Trust Audit SSH and SSH with Access for Infrastructure settings for an account. Args: - public_key: Base64 encoded HPKE public key used to encrypt all your ssh session logs. - https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#enable-ssh-command-logging + public_key: Provide the Base64-encoded HPKE public key that encrypts SSH session logs. See + https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#enable-ssh-command-logging. extra_headers: Send extra headers @@ -240,11 +240,11 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewaySettings]: """ - Gets all Zero Trust Audit SSH and SSH with Access for Infrastructure settings - for an account. + Retrieve all Zero Trust Audit SSH and SSH with Access for Infrastructure + settings for an account. Args: extra_headers: Send extra headers @@ -278,11 +278,11 @@ async def rotate_seed( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewaySettings]: """ - Rotates the SSH account seed that is used for generating the host key identity - when connecting through the Cloudflare SSH Proxy. + Rotate the SSH account seed that generates the host key identity when connecting + through the Cloudflare SSH Proxy. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/categories.py b/src/cloudflare/resources/zero_trust/gateway/categories.py index ae356193e4b..4915deb1f2f 100644 --- a/src/cloudflare/resources/zero_trust/gateway/categories.py +++ b/src/cloudflare/resources/zero_trust/gateway/categories.py @@ -4,7 +4,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -49,13 +49,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Category]: """ - Fetches a list of all categories. + List all categories. Args: - account_id: Identifier + account_id: Provide the identifier string. extra_headers: Send extra headers @@ -106,13 +106,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Category, AsyncSinglePage[Category]]: """ - Fetches a list of all categories. + List all categories. Args: - account_id: Identifier + account_id: Provide the identifier string. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/certificates.py b/src/cloudflare/resources/zero_trust/gateway/certificates.py index fedd93add10..e89207aa93d 100644 --- a/src/cloudflare/resources/zero_trust/gateway/certificates.py +++ b/src/cloudflare/resources/zero_trust/gateway/certificates.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -58,22 +58,22 @@ def create( self, *, account_id: str, - validity_period_days: int | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateCreateResponse]: """ - Creates a new Zero Trust certificate. + Create a new Zero Trust certificate. Args: - validity_period_days: Number of days the generated certificate will be valid, minimum 1 day and - maximum 30 years. Defaults to 5 years. In terraform, validity_period_days can - only be used while creating a certificate, and this CAN NOT be used to extend - the validity of an already generated certificate. + validity_period_days: Sets the certificate validity period in days (range: 1-10,950 days / ~30 years). + Defaults to 1,825 days (5 years). **Important**: This field is only settable + during the certificate creation. Certificates becomes immutable after creation - + use the `/activate` and `/deactivate` endpoints to manage certificate lifecycle. extra_headers: Send extra headers @@ -109,10 +109,10 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CertificateListResponse]: """ - Fetches all Zero Trust certificates for an account. + List all Zero Trust certificates for an account. Args: extra_headers: Send extra headers @@ -144,15 +144,15 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateDeleteResponse]: - """Deletes a gateway-managed Zero Trust certificate. + """Delete a gateway-managed Zero Trust certificate. - A certificate must be - deactivated from the edge (inactive) before it is deleted. + You must deactivate the + certificate from the edge (inactive) before deleting it. Args: - certificate_id: Certificate UUID tag. + certificate_id: Identify the certificate with a UUID. extra_headers: Send extra headers @@ -189,13 +189,13 @@ def activate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateActivateResponse]: """ - Binds a single Zero Trust certificate to the edge. + Bind a single Zero Trust certificate to the edge. Args: - certificate_id: Certificate UUID tag. + certificate_id: Identify the certificate with a UUID. extra_headers: Send extra headers @@ -233,13 +233,13 @@ def deactivate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateDeactivateResponse]: """ - Unbinds a single Zero Trust certificate from the edge + Unbind a single Zero Trust certificate from the edge. Args: - certificate_id: Certificate UUID tag. + certificate_id: Identify the certificate with a UUID. extra_headers: Send extra headers @@ -276,13 +276,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateGetResponse]: """ - Fetches a single Zero Trust certificate. + Get a single Zero Trust certificate. Args: - certificate_id: Certificate UUID tag. + certificate_id: Identify the certificate with a UUID. extra_headers: Send extra headers @@ -333,22 +333,22 @@ async def create( self, *, account_id: str, - validity_period_days: int | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateCreateResponse]: """ - Creates a new Zero Trust certificate. + Create a new Zero Trust certificate. Args: - validity_period_days: Number of days the generated certificate will be valid, minimum 1 day and - maximum 30 years. Defaults to 5 years. In terraform, validity_period_days can - only be used while creating a certificate, and this CAN NOT be used to extend - the validity of an already generated certificate. + validity_period_days: Sets the certificate validity period in days (range: 1-10,950 days / ~30 years). + Defaults to 1,825 days (5 years). **Important**: This field is only settable + during the certificate creation. Certificates becomes immutable after creation - + use the `/activate` and `/deactivate` endpoints to manage certificate lifecycle. extra_headers: Send extra headers @@ -384,10 +384,10 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CertificateListResponse, AsyncSinglePage[CertificateListResponse]]: """ - Fetches all Zero Trust certificates for an account. + List all Zero Trust certificates for an account. Args: extra_headers: Send extra headers @@ -419,15 +419,15 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateDeleteResponse]: - """Deletes a gateway-managed Zero Trust certificate. + """Delete a gateway-managed Zero Trust certificate. - A certificate must be - deactivated from the edge (inactive) before it is deleted. + You must deactivate the + certificate from the edge (inactive) before deleting it. Args: - certificate_id: Certificate UUID tag. + certificate_id: Identify the certificate with a UUID. extra_headers: Send extra headers @@ -464,13 +464,13 @@ async def activate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateActivateResponse]: """ - Binds a single Zero Trust certificate to the edge. + Bind a single Zero Trust certificate to the edge. Args: - certificate_id: Certificate UUID tag. + certificate_id: Identify the certificate with a UUID. extra_headers: Send extra headers @@ -508,13 +508,13 @@ async def deactivate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateDeactivateResponse]: """ - Unbinds a single Zero Trust certificate from the edge + Unbind a single Zero Trust certificate from the edge. Args: - certificate_id: Certificate UUID tag. + certificate_id: Identify the certificate with a UUID. extra_headers: Send extra headers @@ -551,13 +551,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CertificateGetResponse]: """ - Fetches a single Zero Trust certificate. + Get a single Zero Trust certificate. Args: - certificate_id: Certificate UUID tag. + certificate_id: Identify the certificate with a UUID. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py index 6ede7f44e2c..1a19913db64 100755 --- a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py +++ b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -66,19 +66,19 @@ def update( self, *, account_id: str, - settings: GatewayConfigurationSettingsParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigurationUpdateResponse]: """ - Updates the current Zero Trust account configuration. + Update the current Zero Trust account configuration. Args: - settings: Account settings + settings: Specify account settings. extra_headers: Send extra headers @@ -107,24 +107,23 @@ def edit( self, *, account_id: str, - settings: GatewayConfigurationSettingsParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigurationEditResponse]: - """Patches the current Zero Trust account configuration. - - This endpoint can update a - single subcollection of settings such as `antivirus`, `tls_decrypt`, - `activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or - `certificate`, without updating the entire configuration object. Returns an - error if any collection of settings is not properly configured. + """ + Update (PATCH) a single subcollection of settings such as `antivirus`, + `tls_decrypt`, `activity_log`, `block_page`, `browser_isolation`, `fips`, + `body_scanning`, or `certificate` without updating the entire configuration + object. This endpoint returns an error if any settings collection lacks proper + configuration. Args: - settings: Account settings + settings: Specify account settings. extra_headers: Send extra headers @@ -158,10 +157,10 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigurationGetResponse]: """ - Fetches the current Zero Trust account configuration. + Retrieve the current Zero Trust account configuration. Args: extra_headers: Send extra headers @@ -215,19 +214,19 @@ async def update( self, *, account_id: str, - settings: GatewayConfigurationSettingsParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigurationUpdateResponse]: """ - Updates the current Zero Trust account configuration. + Update the current Zero Trust account configuration. Args: - settings: Account settings + settings: Specify account settings. extra_headers: Send extra headers @@ -258,24 +257,23 @@ async def edit( self, *, account_id: str, - settings: GatewayConfigurationSettingsParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigurationEditResponse]: - """Patches the current Zero Trust account configuration. - - This endpoint can update a - single subcollection of settings such as `antivirus`, `tls_decrypt`, - `activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or - `certificate`, without updating the entire configuration object. Returns an - error if any collection of settings is not properly configured. + """ + Update (PATCH) a single subcollection of settings such as `antivirus`, + `tls_decrypt`, `activity_log`, `block_page`, `browser_isolation`, `fips`, + `body_scanning`, or `certificate` without updating the entire configuration + object. This endpoint returns an error if any settings collection lacks proper + configuration. Args: - settings: Account settings + settings: Specify account settings. extra_headers: Send extra headers @@ -309,10 +307,10 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigurationGetResponse]: """ - Fetches the current Zero Trust account configuration. + Retrieve the current Zero Trust account configuration. Args: extra_headers: Send extra headers 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 1f4baf61b58..3107ec2510b 100644 --- a/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py +++ b/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py @@ -7,7 +7,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -52,10 +52,10 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificateSettings]: """ - Fetches the current Zero Trust certificate configuration. + Retrieve the current Zero Trust certificate configuration. Args: extra_headers: Send extra headers @@ -107,10 +107,10 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificateSettings]: """ - Fetches the current Zero Trust certificate configuration. + Retrieve the current Zero Trust certificate configuration. Args: extra_headers: Send extra headers @@ -138,7 +138,7 @@ def __init__(self, custom_certificate: CustomCertificateResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - custom_certificate.get # pyright: ignore[reportDeprecated], + custom_certificate.get, # pyright: ignore[reportDeprecated], ) ) @@ -149,7 +149,7 @@ def __init__(self, custom_certificate: AsyncCustomCertificateResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - custom_certificate.get # pyright: ignore[reportDeprecated], + custom_certificate.get, # pyright: ignore[reportDeprecated], ) ) @@ -160,7 +160,7 @@ def __init__(self, custom_certificate: CustomCertificateResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - custom_certificate.get # pyright: ignore[reportDeprecated], + custom_certificate.get, # pyright: ignore[reportDeprecated], ) ) @@ -171,6 +171,6 @@ def __init__(self, custom_certificate: AsyncCustomCertificateResource) -> None: self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - custom_certificate.get # pyright: ignore[reportDeprecated], + custom_certificate.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/zero_trust/gateway/gateway.py b/src/cloudflare/resources/zero_trust/gateway/gateway.py index f7be9368f36..c012dda9b45 100644 --- a/src/cloudflare/resources/zero_trust/gateway/gateway.py +++ b/src/cloudflare/resources/zero_trust/gateway/gateway.py @@ -22,7 +22,7 @@ LoggingResourceWithStreamingResponse, AsyncLoggingResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from .app_types import ( AppTypesResource, AsyncAppTypesResource, @@ -172,10 +172,10 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayCreateResponse]: """ - Creates a Zero Trust account with an existing Cloudflare account. + Create a Zero Trust account for an existing Cloudflare account. Args: extra_headers: Send extra headers @@ -209,10 +209,10 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayListResponse]: """ - Gets information about the current Zero Trust account. + Retrieve information about the current Zero Trust account. Args: extra_headers: Send extra headers @@ -307,10 +307,10 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayCreateResponse]: """ - Creates a Zero Trust account with an existing Cloudflare account. + Create a Zero Trust account for an existing Cloudflare account. Args: extra_headers: Send extra headers @@ -344,10 +344,10 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayListResponse]: """ - Gets information about the current Zero Trust account. + Retrieve information about the current Zero Trust account. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/lists/items.py b/src/cloudflare/resources/zero_trust/gateway/lists/items.py index 370ed31f789..8dcfa4d317d 100644 --- a/src/cloudflare/resources/zero_trust/gateway/lists/items.py +++ b/src/cloudflare/resources/zero_trust/gateway/lists/items.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -50,13 +50,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ItemListResponse]: """ - Fetches all items in a single Zero Trust list. + Fetch all items in a single Zero Trust list. Args: - list_id: API Resource UUID tag. + list_id: Identify the API resource with a UUID. extra_headers: Send extra headers @@ -110,13 +110,13 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ItemListResponse, AsyncSinglePage[ItemListResponse]]: """ - Fetches all items in a single Zero Trust list. + Fetch all items in a single Zero Trust list. Args: - list_id: API Resource UUID tag. + list_id: Identify the API resource with a UUID. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py index 62967f56cd0..cd7a1359471 100644 --- a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py +++ b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, Iterable, Optional, cast +from typing import Type, Iterable, Optional, cast from typing_extensions import Literal import httpx @@ -15,7 +15,7 @@ ItemsResourceWithStreamingResponse, AsyncItemsResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -30,7 +30,6 @@ from ....._base_client import AsyncPaginator, make_request_options from .....types.zero_trust.gateway import list_edit_params, list_list_params, list_create_params, list_update_params from .....types.zero_trust.gateway.gateway_list import GatewayList -from .....types.zero_trust.gateway.gateway_item_param import GatewayItemParam from .....types.zero_trust.gateway.list_create_response import ListCreateResponse __all__ = ["ListsResource", "AsyncListsResource"] @@ -66,26 +65,26 @@ def create( account_id: str, name: str, type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"], - description: str | NotGiven = NOT_GIVEN, - items: Iterable[GatewayItemParam] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ListCreateResponse]: """ Creates a new Zero Trust list. Args: - name: The name of the list. + name: Specify the list name. - type: The type of list. + type: Specify the list type. - description: The description of the list. + description: Provide the list description. - items: The items in the list. + items: Add items to the list. extra_headers: Send extra headers @@ -124,28 +123,28 @@ def update( *, account_id: str, name: str, - description: str | NotGiven = NOT_GIVEN, - items: Iterable[GatewayItemParam] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + items: Iterable[list_update_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayList]: """Updates a configured Zero Trust list. Skips updating list items if not included - in the payload. + in the payload. A non empty list items will overwrite the existing list. Args: - list_id: API Resource UUID tag. + list_id: Identify the API resource with a UUID. - name: The name of the list. + name: Specify the list name. - description: The description of the list. + description: Provide the list description. - items: The items in the list. + items: Add items to the list. extra_headers: Send extra headers @@ -183,19 +182,19 @@ def list( self, *, account_id: str, - type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"] | NotGiven = NOT_GIVEN, + type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[GatewayList]: """ - Fetches all Zero Trust lists for an account. + Fetch all Zero Trust lists for an account. Args: - type: The type of list. + type: Specify the list type. extra_headers: Send extra headers @@ -230,13 +229,13 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a Zero Trust list. Args: - list_id: API Resource UUID tag. + list_id: Identify the API resource with a UUID. extra_headers: Send extra headers @@ -267,24 +266,24 @@ def edit( list_id: str, *, account_id: str, - append: Iterable[list_edit_params.Append] | NotGiven = NOT_GIVEN, - remove: List[str] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayList]: """ Appends or removes an item from a configured Zero Trust list. Args: - list_id: API Resource UUID tag. + list_id: Identify the API resource with a UUID. - append: items to add to the list. + append: Add items to the list. - remove: A list of the item values you want to remove. + remove: Lists of item values you want to remove. extra_headers: Send extra headers @@ -327,13 +326,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayList]: """ - Fetches a single Zero Trust list. + Fetch a single Zero Trust list. Args: - list_id: API Resource UUID tag. + list_id: Identify the API resource with a UUID. extra_headers: Send extra headers @@ -390,26 +389,26 @@ async def create( account_id: str, name: str, type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"], - description: str | NotGiven = NOT_GIVEN, - items: Iterable[GatewayItemParam] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ListCreateResponse]: """ Creates a new Zero Trust list. Args: - name: The name of the list. + name: Specify the list name. - type: The type of list. + type: Specify the list type. - description: The description of the list. + description: Provide the list description. - items: The items in the list. + items: Add items to the list. extra_headers: Send extra headers @@ -448,28 +447,28 @@ async def update( *, account_id: str, name: str, - description: str | NotGiven = NOT_GIVEN, - items: Iterable[GatewayItemParam] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + items: Iterable[list_update_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayList]: """Updates a configured Zero Trust list. Skips updating list items if not included - in the payload. + in the payload. A non empty list items will overwrite the existing list. Args: - list_id: API Resource UUID tag. + list_id: Identify the API resource with a UUID. - name: The name of the list. + name: Specify the list name. - description: The description of the list. + description: Provide the list description. - items: The items in the list. + items: Add items to the list. extra_headers: Send extra headers @@ -507,19 +506,19 @@ def list( self, *, account_id: str, - type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"] | NotGiven = NOT_GIVEN, + type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[GatewayList, AsyncSinglePage[GatewayList]]: """ - Fetches all Zero Trust lists for an account. + Fetch all Zero Trust lists for an account. Args: - type: The type of list. + type: Specify the list type. extra_headers: Send extra headers @@ -554,13 +553,13 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Deletes a Zero Trust list. Args: - list_id: API Resource UUID tag. + list_id: Identify the API resource with a UUID. extra_headers: Send extra headers @@ -591,24 +590,24 @@ async def edit( list_id: str, *, account_id: str, - append: Iterable[list_edit_params.Append] | NotGiven = NOT_GIVEN, - remove: List[str] | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayList]: """ Appends or removes an item from a configured Zero Trust list. Args: - list_id: API Resource UUID tag. + list_id: Identify the API resource with a UUID. - append: items to add to the list. + append: Add items to the list. - remove: A list of the item values you want to remove. + remove: Lists of item values you want to remove. extra_headers: Send extra headers @@ -651,13 +650,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayList]: """ - Fetches a single Zero Trust list. + Fetch a single Zero Trust list. Args: - list_id: API Resource UUID tag. + list_id: Identify the API resource with a UUID. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/locations.py b/src/cloudflare/resources/zero_trust/gateway/locations.py index fcbcd6698e6..c3adeec7b63 100644 --- a/src/cloudflare/resources/zero_trust/gateway/locations.py +++ b/src/cloudflare/resources/zero_trust/gateway/locations.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -51,41 +51,39 @@ def create( *, account_id: str, name: str, - client_default: bool | NotGiven = NOT_GIVEN, - dns_destination_ips_id: str | NotGiven = NOT_GIVEN, - ecs_support: bool | NotGiven = NOT_GIVEN, - endpoints: EndpointParam | NotGiven = NOT_GIVEN, - networks: Iterable[location_create_params.Network] | NotGiven = NOT_GIVEN, + client_default: bool | Omit = omit, + dns_destination_ips_id: str | Omit = omit, + ecs_support: bool | Omit = omit, + endpoints: Optional[EndpointParam] | Omit = omit, + networks: Optional[Iterable[location_create_params.Network]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Location]: """ - Creates a new Zero Trust Gateway location. + Create a new Zero Trust Gateway location. Args: - name: The name of the location. + name: Specify the location name. - client_default: True if the location is the default location. + client_default: Indicate whether this location is the default location. - dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When - creating a location, if this field is absent or set with null, the pair of + dns_destination_ips_id: Specify the identifier of the pair of IPv4 addresses assigned to this location. + When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. - When updating a location, if the field is absent or set with null, the + When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged. - ecs_support: True if the location needs to resolve EDNS queries. + ecs_support: Indicate whether the location must resolve EDNS queries. - endpoints: The destination endpoints configured for this location. When updating a - location, if this field is absent or set with null, the endpoints configuration - remains unchanged. + endpoints: Configure the destination endpoints for this location. - networks: A list of network ranges that requests from this location would originate from. - A non-empty list is only effective if the ipv4 endpoint is enabled for this - location. + networks: Specify the list of network ranges from which requests at this location + originate. The list takes effect only if it is non-empty and the IPv4 endpoint + is enabled for this location. extra_headers: Send extra headers @@ -126,41 +124,39 @@ def update( *, account_id: str, name: str, - client_default: bool | NotGiven = NOT_GIVEN, - dns_destination_ips_id: str | NotGiven = NOT_GIVEN, - ecs_support: bool | NotGiven = NOT_GIVEN, - endpoints: EndpointParam | NotGiven = NOT_GIVEN, - networks: Iterable[location_update_params.Network] | NotGiven = NOT_GIVEN, + client_default: bool | Omit = omit, + dns_destination_ips_id: str | Omit = omit, + ecs_support: bool | Omit = omit, + endpoints: Optional[EndpointParam] | Omit = omit, + networks: Optional[Iterable[location_update_params.Network]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Location]: """ - Updates a configured Zero Trust Gateway location. + Update a configured Zero Trust Gateway location. Args: - name: The name of the location. + name: Specify the location name. - client_default: True if the location is the default location. + client_default: Indicate whether this location is the default location. - dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When - creating a location, if this field is absent or set with null, the pair of + dns_destination_ips_id: Specify the identifier of the pair of IPv4 addresses assigned to this location. + When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. - When updating a location, if the field is absent or set with null, the + When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged. - ecs_support: True if the location needs to resolve EDNS queries. + ecs_support: Indicate whether the location must resolve EDNS queries. - endpoints: The destination endpoints configured for this location. When updating a - location, if this field is absent or set with null, the endpoints configuration - remains unchanged. + endpoints: Configure the destination endpoints for this location. - networks: A list of network ranges that requests from this location would originate from. - A non-empty list is only effective if the ipv4 endpoint is enabled for this - location. + networks: Specify the list of network ranges from which requests at this location + originate. The list takes effect only if it is non-empty and the IPv4 endpoint + is enabled for this location. extra_headers: Send extra headers @@ -206,10 +202,10 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Location]: """ - Fetches Zero Trust Gateway locations for an account. + List Zero Trust Gateway locations for an account. Args: extra_headers: Send extra headers @@ -241,10 +237,10 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Deletes a configured Zero Trust Gateway location. + Delete a configured Zero Trust Gateway location. Args: extra_headers: Send extra headers @@ -281,10 +277,10 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Location]: """ - Fetches a single Zero Trust Gateway location. + Get a single Zero Trust Gateway location. Args: extra_headers: Send extra headers @@ -337,41 +333,39 @@ async def create( *, account_id: str, name: str, - client_default: bool | NotGiven = NOT_GIVEN, - dns_destination_ips_id: str | NotGiven = NOT_GIVEN, - ecs_support: bool | NotGiven = NOT_GIVEN, - endpoints: EndpointParam | NotGiven = NOT_GIVEN, - networks: Iterable[location_create_params.Network] | NotGiven = NOT_GIVEN, + client_default: bool | Omit = omit, + dns_destination_ips_id: str | Omit = omit, + ecs_support: bool | Omit = omit, + endpoints: Optional[EndpointParam] | Omit = omit, + networks: Optional[Iterable[location_create_params.Network]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Location]: """ - Creates a new Zero Trust Gateway location. + Create a new Zero Trust Gateway location. Args: - name: The name of the location. + name: Specify the location name. - client_default: True if the location is the default location. + client_default: Indicate whether this location is the default location. - dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When - creating a location, if this field is absent or set with null, the pair of + dns_destination_ips_id: Specify the identifier of the pair of IPv4 addresses assigned to this location. + When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. - When updating a location, if the field is absent or set with null, the + When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged. - ecs_support: True if the location needs to resolve EDNS queries. + ecs_support: Indicate whether the location must resolve EDNS queries. - endpoints: The destination endpoints configured for this location. When updating a - location, if this field is absent or set with null, the endpoints configuration - remains unchanged. + endpoints: Configure the destination endpoints for this location. - networks: A list of network ranges that requests from this location would originate from. - A non-empty list is only effective if the ipv4 endpoint is enabled for this - location. + networks: Specify the list of network ranges from which requests at this location + originate. The list takes effect only if it is non-empty and the IPv4 endpoint + is enabled for this location. extra_headers: Send extra headers @@ -412,41 +406,39 @@ async def update( *, account_id: str, name: str, - client_default: bool | NotGiven = NOT_GIVEN, - dns_destination_ips_id: str | NotGiven = NOT_GIVEN, - ecs_support: bool | NotGiven = NOT_GIVEN, - endpoints: EndpointParam | NotGiven = NOT_GIVEN, - networks: Iterable[location_update_params.Network] | NotGiven = NOT_GIVEN, + client_default: bool | Omit = omit, + dns_destination_ips_id: str | Omit = omit, + ecs_support: bool | Omit = omit, + endpoints: Optional[EndpointParam] | Omit = omit, + networks: Optional[Iterable[location_update_params.Network]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Location]: """ - Updates a configured Zero Trust Gateway location. + Update a configured Zero Trust Gateway location. Args: - name: The name of the location. + name: Specify the location name. - client_default: True if the location is the default location. + client_default: Indicate whether this location is the default location. - dns_destination_ips_id: The identifier of the pair of IPv4 addresses assigned to this location. When - creating a location, if this field is absent or set with null, the pair of + dns_destination_ips_id: Specify the identifier of the pair of IPv4 addresses assigned to this location. + When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. - When updating a location, if the field is absent or set with null, the + When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged. - ecs_support: True if the location needs to resolve EDNS queries. + ecs_support: Indicate whether the location must resolve EDNS queries. - endpoints: The destination endpoints configured for this location. When updating a - location, if this field is absent or set with null, the endpoints configuration - remains unchanged. + endpoints: Configure the destination endpoints for this location. - networks: A list of network ranges that requests from this location would originate from. - A non-empty list is only effective if the ipv4 endpoint is enabled for this - location. + networks: Specify the list of network ranges from which requests at this location + originate. The list takes effect only if it is non-empty and the IPv4 endpoint + is enabled for this location. extra_headers: Send extra headers @@ -492,10 +484,10 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Location, AsyncSinglePage[Location]]: """ - Fetches Zero Trust Gateway locations for an account. + List Zero Trust Gateway locations for an account. Args: extra_headers: Send extra headers @@ -527,10 +519,10 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Deletes a configured Zero Trust Gateway location. + Delete a configured Zero Trust Gateway location. Args: extra_headers: Send extra headers @@ -567,10 +559,10 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Location]: """ - Fetches a single Zero Trust Gateway location. + Get a single Zero Trust Gateway location. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/logging.py b/src/cloudflare/resources/zero_trust/gateway/logging.py index 6536b60271d..f18afc08f91 100644 --- a/src/cloudflare/resources/zero_trust/gateway/logging.py +++ b/src/cloudflare/resources/zero_trust/gateway/logging.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,23 +48,24 @@ def update( self, *, account_id: str, - redact_pii: bool | NotGiven = NOT_GIVEN, - settings_by_rule_type: logging_update_params.SettingsByRuleType | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LoggingSetting]: """ - Updates logging settings for the current Zero Trust account. + Update logging settings for the current Zero Trust account. Args: - redact_pii: Redact personally identifiable information from activity logging (PII fields - are: source IP, user email, user ID, device ID, URL, referrer, user agent). + redact_pii: Indicate whether to redact personally identifiable information from activity + logging (PII fields include source IP, user email, user ID, device ID, URL, + referrer, and user agent). - settings_by_rule_type: Logging settings by rule type. + settings_by_rule_type: Configure logging settings for each rule type. extra_headers: Send extra headers @@ -104,10 +105,10 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LoggingSetting]: """ - Fetches the current logging settings for Zero Trust account. + Retrieve the current logging settings for the Zero Trust account. Args: extra_headers: Send extra headers @@ -157,23 +158,24 @@ async def update( self, *, account_id: str, - redact_pii: bool | NotGiven = NOT_GIVEN, - settings_by_rule_type: logging_update_params.SettingsByRuleType | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LoggingSetting]: """ - Updates logging settings for the current Zero Trust account. + Update logging settings for the current Zero Trust account. Args: - redact_pii: Redact personally identifiable information from activity logging (PII fields - are: source IP, user email, user ID, device ID, URL, referrer, user agent). + redact_pii: Indicate whether to redact personally identifiable information from activity + logging (PII fields include source IP, user email, user ID, device ID, URL, + referrer, and user agent). - settings_by_rule_type: Logging settings by rule type. + settings_by_rule_type: Configure logging settings for each rule type. extra_headers: Send extra headers @@ -213,10 +215,10 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[LoggingSetting]: """ - Fetches the current logging settings for Zero Trust account. + Retrieve the current logging settings for the Zero Trust account. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py b/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py index 4cc08e69caf..c0d92a2e8b0 100644 --- a/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py +++ b/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import Type, Optional, cast import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,22 +50,22 @@ def create( self, *, account_id: str, - ips: List[GatewayIPs], + ips: SequenceNotStr[GatewayIPs], 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ProxyEndpoint]: """ - Creates a new Zero Trust Gateway proxy endpoint. + Create a new Zero Trust Gateway proxy endpoint. Args: - ips: A list of CIDRs to restrict ingress connections. + ips: Specify the list of CIDRs to restrict ingress connections. - name: The name of the proxy endpoint. + name: Specify the name of the proxy endpoint. extra_headers: Send extra headers @@ -105,10 +105,10 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ProxyEndpoint]: """ - Fetches all Zero Trust Gateway proxy endpoints for an account. + List all Zero Trust Gateway proxy endpoints for an account. Args: extra_headers: Send extra headers @@ -143,10 +143,10 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Deletes a configured Zero Trust Gateway proxy endpoint. + Delete a configured Zero Trust Gateway proxy endpoint. Args: extra_headers: Send extra headers @@ -178,22 +178,22 @@ def edit( proxy_endpoint_id: str, *, account_id: str, - ips: List[GatewayIPs] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ProxyEndpoint]: """ - Updates a configured Zero Trust Gateway proxy endpoint. + Update a configured Zero Trust Gateway proxy endpoint. Args: - ips: A list of CIDRs to restrict ingress connections. + ips: Specify the list of CIDRs to restrict ingress connections. - name: The name of the proxy endpoint. + name: Specify the name of the proxy endpoint. extra_headers: Send extra headers @@ -236,10 +236,10 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ProxyEndpoint]: """ - Fetches a single Zero Trust Gateway proxy endpoint. + Get a single Zero Trust Gateway proxy endpoint. Args: extra_headers: Send extra headers @@ -288,22 +288,22 @@ async def create( self, *, account_id: str, - ips: List[GatewayIPs], + ips: SequenceNotStr[GatewayIPs], 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ProxyEndpoint]: """ - Creates a new Zero Trust Gateway proxy endpoint. + Create a new Zero Trust Gateway proxy endpoint. Args: - ips: A list of CIDRs to restrict ingress connections. + ips: Specify the list of CIDRs to restrict ingress connections. - name: The name of the proxy endpoint. + name: Specify the name of the proxy endpoint. extra_headers: Send extra headers @@ -343,10 +343,10 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ProxyEndpoint]: """ - Fetches all Zero Trust Gateway proxy endpoints for an account. + List all Zero Trust Gateway proxy endpoints for an account. Args: extra_headers: Send extra headers @@ -381,10 +381,10 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Deletes a configured Zero Trust Gateway proxy endpoint. + Delete a configured Zero Trust Gateway proxy endpoint. Args: extra_headers: Send extra headers @@ -416,22 +416,22 @@ async def edit( proxy_endpoint_id: str, *, account_id: str, - ips: List[GatewayIPs] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ProxyEndpoint]: """ - Updates a configured Zero Trust Gateway proxy endpoint. + Update a configured Zero Trust Gateway proxy endpoint. Args: - ips: A list of CIDRs to restrict ingress connections. + ips: Specify the list of CIDRs to restrict ingress connections. - name: The name of the proxy endpoint. + name: Specify the name of the proxy endpoint. extra_headers: Send extra headers @@ -474,10 +474,10 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ProxyEndpoint, AsyncSinglePage[ProxyEndpoint]]: """ - Fetches a single Zero Trust Gateway proxy endpoint. + Get a single Zero Trust Gateway proxy endpoint. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/gateway/rules.py b/src/cloudflare/resources/zero_trust/gateway/rules.py index b08551a25b4..2ece837eae3 100644 --- a/src/cloudflare/resources/zero_trust/gateway/rules.py +++ b/src/cloudflare/resources/zero_trust/gateway/rules.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -72,60 +72,71 @@ def create( "redirect", ], name: str, - description: str | NotGiven = NOT_GIVEN, - device_posture: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - expiration: Optional[rule_create_params.Expiration] | NotGiven = NOT_GIVEN, - filters: List[GatewayFilter] | NotGiven = NOT_GIVEN, - identity: str | NotGiven = NOT_GIVEN, - precedence: int | NotGiven = NOT_GIVEN, - rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN, - schedule: Optional[ScheduleParam] | NotGiven = NOT_GIVEN, - traffic: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + device_posture: str | Omit = omit, + enabled: bool | Omit = omit, + expiration: Optional[rule_create_params.Expiration] | Omit = omit, + filters: List[GatewayFilter] | Omit = omit, + identity: str | Omit = omit, + precedence: int | Omit = omit, + rule_settings: RuleSettingParam | Omit = omit, + schedule: Optional[ScheduleParam] | Omit = omit, + traffic: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayRule]: """ - Creates a new Zero Trust Gateway rule. + Create a new Zero Trust Gateway rule. Args: - action: The action to preform when the associated traffic, identity, and device posture - expressions are either absent or evaluate to `true`. + action: Specify the action to perform when the associated traffic, identity, and device + posture expressions either absent or evaluate to `true`. - name: The name of the rule. + name: Specify the rule name. - description: The description of the rule. + description: Specify the rule description. - device_posture: The wirefilter expression used for device posture check matching. + device_posture: Specify the wirefilter expression used for device posture check. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. - enabled: True if the rule is enabled. + enabled: Specify whether the rule is enabled. - expiration: The expiration time stamp and default duration of a DNS policy. Takes precedence - over the policy's `schedule` configuration, if any. + expiration: Defines the expiration time stamp and default duration of a DNS policy. Takes + precedence over the policy's `schedule` configuration, if any. This does not + apply to HTTP or network policies. Settable only for `dns` rules. - This does not apply to HTTP or network policies. + filters: Specify the protocol or layer to evaluate the traffic, identity, and device + posture expressions. Can only contain a single value. - filters: The protocol or layer to evaluate the traffic, identity, and device posture - expressions. + identity: Specify the wirefilter expression used for identity matching. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. - identity: The wirefilter expression used for identity matching. - - precedence: Precedence sets the order of your rules. Lower values indicate higher - precedence. At each processing phase, applicable rules are evaluated in - ascending order of this value. Refer to + precedence: Set the order of your rules. Lower values indicate higher precedence. At each + processing phase, evaluate applicable rules in ascending order of this value. + Refer to [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) - docs on how to manage precedence via Terraform. + to manage precedence via Terraform. - rule_settings: Additional settings that modify the rule's action. + rule_settings: Defines settings for this rule. Settings apply only to specific rule types and + must use compatible selectors. If Terraform detects drift, confirm the setting + supports your rule type and check whether the API modifies the value. Use + API-returned values in your configuration to prevent drift. - schedule: The schedule for activating DNS policies. This does not apply to HTTP or network - policies. + schedule: Defines the schedule for activating DNS policies. Settable only for `dns` and + `dns_resolver` rules. - traffic: The wirefilter expression used for traffic matching. + traffic: Specify the wirefilter expression used for traffic matching. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. extra_headers: Send extra headers @@ -190,62 +201,73 @@ def update( "redirect", ], name: str, - description: str | NotGiven = NOT_GIVEN, - device_posture: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - expiration: Optional[rule_update_params.Expiration] | NotGiven = NOT_GIVEN, - filters: List[GatewayFilter] | NotGiven = NOT_GIVEN, - identity: str | NotGiven = NOT_GIVEN, - precedence: int | NotGiven = NOT_GIVEN, - rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN, - schedule: Optional[ScheduleParam] | NotGiven = NOT_GIVEN, - traffic: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + device_posture: str | Omit = omit, + enabled: bool | Omit = omit, + expiration: Optional[rule_update_params.Expiration] | Omit = omit, + filters: List[GatewayFilter] | Omit = omit, + identity: str | Omit = omit, + precedence: int | Omit = omit, + rule_settings: RuleSettingParam | Omit = omit, + schedule: Optional[ScheduleParam] | Omit = omit, + traffic: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayRule]: """ - Updates a configured Zero Trust Gateway rule. + Update a configured Zero Trust Gateway rule. Args: - rule_id: The API resource UUID. - - action: The action to preform when the associated traffic, identity, and device posture - expressions are either absent or evaluate to `true`. + rule_id: Identify the API resource with a UUID. - name: The name of the rule. + action: Specify the action to perform when the associated traffic, identity, and device + posture expressions either absent or evaluate to `true`. - description: The description of the rule. + name: Specify the rule name. - device_posture: The wirefilter expression used for device posture check matching. + description: Specify the rule description. - enabled: True if the rule is enabled. + device_posture: Specify the wirefilter expression used for device posture check. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. - expiration: The expiration time stamp and default duration of a DNS policy. Takes precedence - over the policy's `schedule` configuration, if any. + enabled: Specify whether the rule is enabled. - This does not apply to HTTP or network policies. + expiration: Defines the expiration time stamp and default duration of a DNS policy. Takes + precedence over the policy's `schedule` configuration, if any. This does not + apply to HTTP or network policies. Settable only for `dns` rules. - filters: The protocol or layer to evaluate the traffic, identity, and device posture - expressions. + filters: Specify the protocol or layer to evaluate the traffic, identity, and device + posture expressions. Can only contain a single value. - identity: The wirefilter expression used for identity matching. + identity: Specify the wirefilter expression used for identity matching. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. - precedence: Precedence sets the order of your rules. Lower values indicate higher - precedence. At each processing phase, applicable rules are evaluated in - ascending order of this value. Refer to + precedence: Set the order of your rules. Lower values indicate higher precedence. At each + processing phase, evaluate applicable rules in ascending order of this value. + Refer to [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) - docs on how to manage precedence via Terraform. + to manage precedence via Terraform. - rule_settings: Additional settings that modify the rule's action. + rule_settings: Defines settings for this rule. Settings apply only to specific rule types and + must use compatible selectors. If Terraform detects drift, confirm the setting + supports your rule type and check whether the API modifies the value. Use + API-returned values in your configuration to prevent drift. - schedule: The schedule for activating DNS policies. This does not apply to HTTP or network - policies. + schedule: Defines the schedule for activating DNS policies. Settable only for `dns` and + `dns_resolver` rules. - traffic: The wirefilter expression used for traffic matching. + traffic: Specify the wirefilter expression used for traffic matching. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. extra_headers: Send extra headers @@ -297,10 +319,10 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[GatewayRule]: """ - Fetches the Zero Trust Gateway rules for an account. + List Zero Trust Gateway rules for an account. Args: extra_headers: Send extra headers @@ -332,13 +354,13 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Deletes a Zero Trust Gateway rule. + Delete a Zero Trust Gateway rule. Args: - rule_id: The API resource UUID. + rule_id: Identify the API resource with a UUID. extra_headers: Send extra headers @@ -374,13 +396,13 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayRule]: """ - Fetches a single Zero Trust Gateway rule. + Get a single Zero Trust Gateway rule. Args: - rule_id: The API resource UUID. + rule_id: Identify the API resource with a UUID. extra_headers: Send extra headers @@ -406,6 +428,41 @@ def get( cast_to=cast(Type[Optional[GatewayRule]], ResultWrapper[GatewayRule]), ) + def list_tenant( + 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[GatewayRule]: + """ + List Zero Trust Gateway rules for the parent account of an account in the MSP + configuration. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if 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}/gateway/rules/tenant", + page=SyncSinglePage[GatewayRule], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=GatewayRule, + ) + def reset_expiration( self, rule_id: str, @@ -416,17 +473,15 @@ def reset_expiration( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayRule]: """ - Resets the expiration of a Zero Trust Gateway Rule if its duration has elapsed - and it has a default duration. - - The Zero Trust Gateway Rule must have values for both `expiration.expires_at` - and `expiration.duration`. + Resets the expiration of a Zero Trust Gateway Rule if its duration elapsed and + it has a default duration. The Zero Trust Gateway Rule must have values for both + `expiration.expires_at` and `expiration.duration`. Args: - rule_id: The API resource UUID. + rule_id: Identify the API resource with a UUID. extra_headers: Send extra headers @@ -496,60 +551,71 @@ async def create( "redirect", ], name: str, - description: str | NotGiven = NOT_GIVEN, - device_posture: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - expiration: Optional[rule_create_params.Expiration] | NotGiven = NOT_GIVEN, - filters: List[GatewayFilter] | NotGiven = NOT_GIVEN, - identity: str | NotGiven = NOT_GIVEN, - precedence: int | NotGiven = NOT_GIVEN, - rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN, - schedule: Optional[ScheduleParam] | NotGiven = NOT_GIVEN, - traffic: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + device_posture: str | Omit = omit, + enabled: bool | Omit = omit, + expiration: Optional[rule_create_params.Expiration] | Omit = omit, + filters: List[GatewayFilter] | Omit = omit, + identity: str | Omit = omit, + precedence: int | Omit = omit, + rule_settings: RuleSettingParam | Omit = omit, + schedule: Optional[ScheduleParam] | Omit = omit, + traffic: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayRule]: """ - Creates a new Zero Trust Gateway rule. + Create a new Zero Trust Gateway rule. Args: - action: The action to preform when the associated traffic, identity, and device posture - expressions are either absent or evaluate to `true`. + action: Specify the action to perform when the associated traffic, identity, and device + posture expressions either absent or evaluate to `true`. - name: The name of the rule. + name: Specify the rule name. - description: The description of the rule. + description: Specify the rule description. - device_posture: The wirefilter expression used for device posture check matching. + device_posture: Specify the wirefilter expression used for device posture check. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. - enabled: True if the rule is enabled. + enabled: Specify whether the rule is enabled. - expiration: The expiration time stamp and default duration of a DNS policy. Takes precedence - over the policy's `schedule` configuration, if any. + expiration: Defines the expiration time stamp and default duration of a DNS policy. Takes + precedence over the policy's `schedule` configuration, if any. This does not + apply to HTTP or network policies. Settable only for `dns` rules. - This does not apply to HTTP or network policies. + filters: Specify the protocol or layer to evaluate the traffic, identity, and device + posture expressions. Can only contain a single value. - filters: The protocol or layer to evaluate the traffic, identity, and device posture - expressions. + identity: Specify the wirefilter expression used for identity matching. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. - identity: The wirefilter expression used for identity matching. - - precedence: Precedence sets the order of your rules. Lower values indicate higher - precedence. At each processing phase, applicable rules are evaluated in - ascending order of this value. Refer to + precedence: Set the order of your rules. Lower values indicate higher precedence. At each + processing phase, evaluate applicable rules in ascending order of this value. + Refer to [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) - docs on how to manage precedence via Terraform. + to manage precedence via Terraform. - rule_settings: Additional settings that modify the rule's action. + rule_settings: Defines settings for this rule. Settings apply only to specific rule types and + must use compatible selectors. If Terraform detects drift, confirm the setting + supports your rule type and check whether the API modifies the value. Use + API-returned values in your configuration to prevent drift. - schedule: The schedule for activating DNS policies. This does not apply to HTTP or network - policies. + schedule: Defines the schedule for activating DNS policies. Settable only for `dns` and + `dns_resolver` rules. - traffic: The wirefilter expression used for traffic matching. + traffic: Specify the wirefilter expression used for traffic matching. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. extra_headers: Send extra headers @@ -614,62 +680,73 @@ async def update( "redirect", ], name: str, - description: str | NotGiven = NOT_GIVEN, - device_posture: str | NotGiven = NOT_GIVEN, - enabled: bool | NotGiven = NOT_GIVEN, - expiration: Optional[rule_update_params.Expiration] | NotGiven = NOT_GIVEN, - filters: List[GatewayFilter] | NotGiven = NOT_GIVEN, - identity: str | NotGiven = NOT_GIVEN, - precedence: int | NotGiven = NOT_GIVEN, - rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN, - schedule: Optional[ScheduleParam] | NotGiven = NOT_GIVEN, - traffic: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + device_posture: str | Omit = omit, + enabled: bool | Omit = omit, + expiration: Optional[rule_update_params.Expiration] | Omit = omit, + filters: List[GatewayFilter] | Omit = omit, + identity: str | Omit = omit, + precedence: int | Omit = omit, + rule_settings: RuleSettingParam | Omit = omit, + schedule: Optional[ScheduleParam] | Omit = omit, + traffic: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayRule]: """ - Updates a configured Zero Trust Gateway rule. + Update a configured Zero Trust Gateway rule. Args: - rule_id: The API resource UUID. - - action: The action to preform when the associated traffic, identity, and device posture - expressions are either absent or evaluate to `true`. + rule_id: Identify the API resource with a UUID. - name: The name of the rule. + action: Specify the action to perform when the associated traffic, identity, and device + posture expressions either absent or evaluate to `true`. - description: The description of the rule. + name: Specify the rule name. - device_posture: The wirefilter expression used for device posture check matching. + description: Specify the rule description. - enabled: True if the rule is enabled. + device_posture: Specify the wirefilter expression used for device posture check. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. - expiration: The expiration time stamp and default duration of a DNS policy. Takes precedence - over the policy's `schedule` configuration, if any. + enabled: Specify whether the rule is enabled. - This does not apply to HTTP or network policies. + expiration: Defines the expiration time stamp and default duration of a DNS policy. Takes + precedence over the policy's `schedule` configuration, if any. This does not + apply to HTTP or network policies. Settable only for `dns` rules. - filters: The protocol or layer to evaluate the traffic, identity, and device posture - expressions. + filters: Specify the protocol or layer to evaluate the traffic, identity, and device + posture expressions. Can only contain a single value. - identity: The wirefilter expression used for identity matching. + identity: Specify the wirefilter expression used for identity matching. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. - precedence: Precedence sets the order of your rules. Lower values indicate higher - precedence. At each processing phase, applicable rules are evaluated in - ascending order of this value. Refer to + precedence: Set the order of your rules. Lower values indicate higher precedence. At each + processing phase, evaluate applicable rules in ascending order of this value. + Refer to [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) - docs on how to manage precedence via Terraform. + to manage precedence via Terraform. - rule_settings: Additional settings that modify the rule's action. + rule_settings: Defines settings for this rule. Settings apply only to specific rule types and + must use compatible selectors. If Terraform detects drift, confirm the setting + supports your rule type and check whether the API modifies the value. Use + API-returned values in your configuration to prevent drift. - schedule: The schedule for activating DNS policies. This does not apply to HTTP or network - policies. + schedule: Defines the schedule for activating DNS policies. Settable only for `dns` and + `dns_resolver` rules. - traffic: The wirefilter expression used for traffic matching. + traffic: Specify the wirefilter expression used for traffic matching. The API + automatically formats and sanitizes expressions before storing them. To prevent + Terraform state drift, use the formatted expression returned in the API + response. extra_headers: Send extra headers @@ -721,10 +798,10 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[GatewayRule, AsyncSinglePage[GatewayRule]]: """ - Fetches the Zero Trust Gateway rules for an account. + List Zero Trust Gateway rules for an account. Args: extra_headers: Send extra headers @@ -756,13 +833,13 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Deletes a Zero Trust Gateway rule. + Delete a Zero Trust Gateway rule. Args: - rule_id: The API resource UUID. + rule_id: Identify the API resource with a UUID. extra_headers: Send extra headers @@ -798,13 +875,13 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayRule]: """ - Fetches a single Zero Trust Gateway rule. + Get a single Zero Trust Gateway rule. Args: - rule_id: The API resource UUID. + rule_id: Identify the API resource with a UUID. extra_headers: Send extra headers @@ -830,6 +907,41 @@ async def get( cast_to=cast(Type[Optional[GatewayRule]], ResultWrapper[GatewayRule]), ) + def list_tenant( + 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[GatewayRule, AsyncSinglePage[GatewayRule]]: + """ + List Zero Trust Gateway rules for the parent account of an account in the MSP + configuration. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if 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}/gateway/rules/tenant", + page=AsyncSinglePage[GatewayRule], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=GatewayRule, + ) + async def reset_expiration( self, rule_id: str, @@ -840,17 +952,15 @@ async def reset_expiration( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[GatewayRule]: """ - Resets the expiration of a Zero Trust Gateway Rule if its duration has elapsed - and it has a default duration. - - The Zero Trust Gateway Rule must have values for both `expiration.expires_at` - and `expiration.duration`. + Resets the expiration of a Zero Trust Gateway Rule if its duration elapsed and + it has a default duration. The Zero Trust Gateway Rule must have values for both + `expiration.expires_at` and `expiration.duration`. Args: - rule_id: The API resource UUID. + rule_id: Identify the API resource with a UUID. extra_headers: Send extra headers @@ -896,6 +1006,9 @@ def __init__(self, rules: RulesResource) -> None: self.get = to_raw_response_wrapper( rules.get, ) + self.list_tenant = to_raw_response_wrapper( + rules.list_tenant, + ) self.reset_expiration = to_raw_response_wrapper( rules.reset_expiration, ) @@ -920,6 +1033,9 @@ def __init__(self, rules: AsyncRulesResource) -> None: self.get = async_to_raw_response_wrapper( rules.get, ) + self.list_tenant = async_to_raw_response_wrapper( + rules.list_tenant, + ) self.reset_expiration = async_to_raw_response_wrapper( rules.reset_expiration, ) @@ -944,6 +1060,9 @@ def __init__(self, rules: RulesResource) -> None: self.get = to_streamed_response_wrapper( rules.get, ) + self.list_tenant = to_streamed_response_wrapper( + rules.list_tenant, + ) self.reset_expiration = to_streamed_response_wrapper( rules.reset_expiration, ) @@ -968,6 +1087,9 @@ def __init__(self, rules: AsyncRulesResource) -> None: self.get = async_to_streamed_response_wrapper( rules.get, ) + self.list_tenant = async_to_streamed_response_wrapper( + rules.list_tenant, + ) self.reset_expiration = async_to_streamed_response_wrapper( rules.reset_expiration, ) 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 f3e4c29eb38..ca7fdc64a04 100644 --- a/src/cloudflare/resources/zero_trust/identity_providers/identity_providers.py +++ b/src/cloudflare/resources/zero_trust/identity_providers/identity_providers.py @@ -7,7 +7,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import required_args, maybe_transform, async_maybe_transform from .scim.scim import ( SCIMResource, @@ -26,7 +26,7 @@ async_to_streamed_response_wrapper, ) from ...._wrappers import ResultWrapper -from ....pagination import SyncSinglePage, AsyncSinglePage +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options from ....types.zero_trust import ( IdentityProviderType, @@ -75,15 +75,15 @@ def create( config: identity_provider_create_params.AzureADConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -123,15 +123,15 @@ def create( config: identity_provider_create_params.AccessCentrifyConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -171,15 +171,15 @@ def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -219,15 +219,15 @@ def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -267,15 +267,15 @@ def create( config: identity_provider_create_params.AccessGoogleConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -315,15 +315,15 @@ def create( config: identity_provider_create_params.AccessGoogleAppsConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -363,15 +363,15 @@ def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -411,15 +411,15 @@ def create( config: identity_provider_create_params.AccessOIDCConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -459,15 +459,15 @@ def create( config: identity_provider_create_params.AccessOktaConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -507,15 +507,15 @@ def create( config: identity_provider_create_params.AccessOneloginConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -555,15 +555,15 @@ def create( config: identity_provider_create_params.AccessPingoneConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -603,15 +603,15 @@ def create( config: identity_provider_create_params.AccessSAMLConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -651,15 +651,15 @@ def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -699,15 +699,15 @@ def create( config: identity_provider_create_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -757,15 +757,15 @@ def create( | identity_provider_create_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -813,15 +813,15 @@ def update( config: identity_provider_update_params.AzureADConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -864,15 +864,15 @@ def update( config: identity_provider_update_params.AccessCentrifyConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -915,15 +915,15 @@ def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -966,15 +966,15 @@ def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1017,15 +1017,15 @@ def update( config: identity_provider_update_params.AccessGoogleConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1068,15 +1068,15 @@ def update( config: identity_provider_update_params.AccessGoogleAppsConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1119,15 +1119,15 @@ def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1170,15 +1170,15 @@ def update( config: identity_provider_update_params.AccessOIDCConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1221,15 +1221,15 @@ def update( config: identity_provider_update_params.AccessOktaConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1272,15 +1272,15 @@ def update( config: identity_provider_update_params.AccessOneloginConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1323,15 +1323,15 @@ def update( config: identity_provider_update_params.AccessPingoneConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1374,15 +1374,15 @@ def update( config: identity_provider_update_params.AccessSAMLConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1425,15 +1425,15 @@ def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1476,15 +1476,15 @@ def update( config: identity_provider_update_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -1537,15 +1537,15 @@ def update( | identity_provider_update_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: if not identity_provider_id: raise ValueError( @@ -1592,16 +1592,18 @@ def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_enabled: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + scim_enabled: 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, - ) -> SyncSinglePage[IdentityProviderListResponse]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[IdentityProviderListResponse]: """ Lists all configured identity providers. @@ -1610,6 +1612,10 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + page: Page number of results. + + per_page: Number of results per page. + scim_enabled: Indicates to Access to only retrieve identity providers that have the System for Cross-Domain Identity Management (SCIM) enabled. @@ -1635,14 +1641,19 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers", - page=SyncSinglePage[IdentityProviderListResponse], + page=SyncV4PagePaginationArray[IdentityProviderListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( - {"scim_enabled": scim_enabled}, identity_provider_list_params.IdentityProviderListParams + { + "page": page, + "per_page": per_page, + "scim_enabled": scim_enabled, + }, + identity_provider_list_params.IdentityProviderListParams, ), ), model=cast( @@ -1654,14 +1665,14 @@ def delete( self, identity_provider_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProviderDeleteResponse]: """ Deletes an identity provider from Access. @@ -1713,14 +1724,14 @@ def get( self, identity_provider_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Fetches a configured identity provider. @@ -1805,15 +1816,15 @@ async def create( config: identity_provider_create_params.AzureADConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -1853,15 +1864,15 @@ async def create( config: identity_provider_create_params.AccessCentrifyConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -1901,15 +1912,15 @@ async def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -1949,15 +1960,15 @@ async def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -1997,15 +2008,15 @@ async def create( config: identity_provider_create_params.AccessGoogleConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -2045,15 +2056,15 @@ async def create( config: identity_provider_create_params.AccessGoogleAppsConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -2093,15 +2104,15 @@ async def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -2141,15 +2152,15 @@ async def create( config: identity_provider_create_params.AccessOIDCConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -2189,15 +2200,15 @@ async def create( config: identity_provider_create_params.AccessOktaConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -2237,15 +2248,15 @@ async def create( config: identity_provider_create_params.AccessOneloginConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -2285,15 +2296,15 @@ async def create( config: identity_provider_create_params.AccessPingoneConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -2333,15 +2344,15 @@ async def create( config: identity_provider_create_params.AccessSAMLConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -2381,15 +2392,15 @@ async def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -2429,15 +2440,15 @@ async def create( config: identity_provider_create_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Adds a new identity provider to Access. @@ -2487,15 +2498,15 @@ async def create( | identity_provider_create_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -2543,15 +2554,15 @@ async def update( config: identity_provider_update_params.AzureADConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -2594,15 +2605,15 @@ async def update( config: identity_provider_update_params.AccessCentrifyConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -2645,15 +2656,15 @@ async def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -2696,15 +2707,15 @@ async def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -2747,15 +2758,15 @@ async def update( config: identity_provider_update_params.AccessGoogleConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -2798,15 +2809,15 @@ async def update( config: identity_provider_update_params.AccessGoogleAppsConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -2849,15 +2860,15 @@ async def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -2900,15 +2911,15 @@ async def update( config: identity_provider_update_params.AccessOIDCConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -2951,15 +2962,15 @@ async def update( config: identity_provider_update_params.AccessOktaConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -3002,15 +3013,15 @@ async def update( config: identity_provider_update_params.AccessOneloginConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -3053,15 +3064,15 @@ async def update( config: identity_provider_update_params.AccessPingoneConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -3104,15 +3115,15 @@ async def update( config: identity_provider_update_params.AccessSAMLConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -3155,15 +3166,15 @@ async def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -3206,15 +3217,15 @@ async def update( config: identity_provider_update_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Updates a configured identity provider. @@ -3267,15 +3278,15 @@ async def update( | identity_provider_update_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_config: IdentityProviderSCIMConfigParam | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: if not identity_provider_id: raise ValueError( @@ -3322,16 +3333,18 @@ async def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - scim_enabled: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + scim_enabled: 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[IdentityProviderListResponse, AsyncSinglePage[IdentityProviderListResponse]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[IdentityProviderListResponse, AsyncV4PagePaginationArray[IdentityProviderListResponse]]: """ Lists all configured identity providers. @@ -3340,6 +3353,10 @@ def list( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + page: Page number of results. + + per_page: Number of results per page. + scim_enabled: Indicates to Access to only retrieve identity providers that have the System for Cross-Domain Identity Management (SCIM) enabled. @@ -3365,14 +3382,19 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers", - page=AsyncSinglePage[IdentityProviderListResponse], + page=AsyncV4PagePaginationArray[IdentityProviderListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( - {"scim_enabled": scim_enabled}, identity_provider_list_params.IdentityProviderListParams + { + "page": page, + "per_page": per_page, + "scim_enabled": scim_enabled, + }, + identity_provider_list_params.IdentityProviderListParams, ), ), model=cast( @@ -3384,14 +3406,14 @@ async def delete( self, identity_provider_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProviderDeleteResponse]: """ Deletes an identity provider from Access. @@ -3443,14 +3465,14 @@ async def get( self, identity_provider_id: str, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: """ Fetches a configured identity provider. 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 5330268ca9e..306e7a45343 100644 --- a/src/cloudflare/resources/zero_trust/identity_providers/scim/groups.py +++ b/src/cloudflare/resources/zero_trust/identity_providers/scim/groups.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -14,7 +14,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .....pagination import SyncSinglePage, AsyncSinglePage +from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ....._base_client import AsyncPaginator, make_request_options from .....types.zero_trust.access.zero_trust_group import ZeroTrustGroup from .....types.zero_trust.identity_providers.scim import group_list_params @@ -47,16 +47,18 @@ def list( identity_provider_id: str, *, account_id: str, - cf_resource_id: str | NotGiven = NOT_GIVEN, - idp_resource_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + cf_resource_id: str | Omit = omit, + idp_resource_id: str | Omit = omit, + name: 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. # The extra values given here take precedence over values defined on the client or passed to this 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[ZeroTrustGroup]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[ZeroTrustGroup]: """ Lists SCIM Group resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM). @@ -74,6 +76,10 @@ def list( name: The display name of the SCIM Group resource. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -90,7 +96,7 @@ def list( ) return self._get_api_list( f"/accounts/{account_id}/access/identity_providers/{identity_provider_id}/scim/groups", - page=SyncSinglePage[ZeroTrustGroup], + page=SyncV4PagePaginationArray[ZeroTrustGroup], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -101,6 +107,8 @@ def list( "cf_resource_id": cf_resource_id, "idp_resource_id": idp_resource_id, "name": name, + "page": page, + "per_page": per_page, }, group_list_params.GroupListParams, ), @@ -134,16 +142,18 @@ def list( identity_provider_id: str, *, account_id: str, - cf_resource_id: str | NotGiven = NOT_GIVEN, - idp_resource_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + cf_resource_id: str | Omit = omit, + idp_resource_id: str | Omit = omit, + name: 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. # The extra values given here take precedence over values defined on the client or passed to this 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[ZeroTrustGroup, AsyncSinglePage[ZeroTrustGroup]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ZeroTrustGroup, AsyncV4PagePaginationArray[ZeroTrustGroup]]: """ Lists SCIM Group resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM). @@ -161,6 +171,10 @@ def list( name: The display name of the SCIM Group resource. + page: Page number of results. + + per_page: Number of results per page. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -177,7 +191,7 @@ def list( ) return self._get_api_list( f"/accounts/{account_id}/access/identity_providers/{identity_provider_id}/scim/groups", - page=AsyncSinglePage[ZeroTrustGroup], + page=AsyncV4PagePaginationArray[ZeroTrustGroup], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -188,6 +202,8 @@ def list( "cf_resource_id": cf_resource_id, "idp_resource_id": idp_resource_id, "name": name, + "page": page, + "per_page": per_page, }, group_list_params.GroupListParams, ), 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 9267ddf409d..3f1736acb2a 100644 --- a/src/cloudflare/resources/zero_trust/identity_providers/scim/users.py +++ b/src/cloudflare/resources/zero_trust/identity_providers/scim/users.py @@ -4,7 +4,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -14,7 +14,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .....pagination import SyncSinglePage, AsyncSinglePage +from .....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ....._base_client import AsyncPaginator, make_request_options from .....types.zero_trust.access.access_user import AccessUser from .....types.zero_trust.identity_providers.scim import user_list_params @@ -47,18 +47,20 @@ def list( identity_provider_id: str, *, account_id: str, - cf_resource_id: str | NotGiven = NOT_GIVEN, - email: str | NotGiven = NOT_GIVEN, - idp_resource_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - username: str | NotGiven = NOT_GIVEN, + cf_resource_id: str | Omit = omit, + email: str | Omit = omit, + idp_resource_id: str | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | 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. # The extra values given here take precedence over values defined on the client or passed to this 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[AccessUser]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[AccessUser]: """ Lists SCIM User resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM). @@ -77,6 +79,10 @@ def list( name: The name of the SCIM User resource. + page: Page number of results. + + per_page: Number of results per page. + username: The username of the SCIM User resource. extra_headers: Send extra headers @@ -95,7 +101,7 @@ def list( ) return self._get_api_list( f"/accounts/{account_id}/access/identity_providers/{identity_provider_id}/scim/users", - page=SyncSinglePage[AccessUser], + page=SyncV4PagePaginationArray[AccessUser], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -107,6 +113,8 @@ def list( "email": email, "idp_resource_id": idp_resource_id, "name": name, + "page": page, + "per_page": per_page, "username": username, }, user_list_params.UserListParams, @@ -141,18 +149,20 @@ def list( identity_provider_id: str, *, account_id: str, - cf_resource_id: str | NotGiven = NOT_GIVEN, - email: str | NotGiven = NOT_GIVEN, - idp_resource_id: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - username: str | NotGiven = NOT_GIVEN, + cf_resource_id: str | Omit = omit, + email: str | Omit = omit, + idp_resource_id: str | Omit = omit, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | 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. # The extra values given here take precedence over values defined on the client or passed to this 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[AccessUser, AsyncSinglePage[AccessUser]]: + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[AccessUser, AsyncV4PagePaginationArray[AccessUser]]: """ Lists SCIM User resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM). @@ -171,6 +181,10 @@ def list( name: The name of the SCIM User resource. + page: Page number of results. + + per_page: Number of results per page. + username: The username of the SCIM User resource. extra_headers: Send extra headers @@ -189,7 +203,7 @@ def list( ) return self._get_api_list( f"/accounts/{account_id}/access/identity_providers/{identity_provider_id}/scim/users", - page=AsyncSinglePage[AccessUser], + page=AsyncV4PagePaginationArray[AccessUser], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -201,6 +215,8 @@ def list( "email": email, "idp_resource_id": idp_resource_id, "name": name, + "page": page, + "per_page": per_page, "username": username, }, user_list_params.UserListParams, diff --git a/src/cloudflare/resources/zero_trust/networks/__init__.py b/src/cloudflare/resources/zero_trust/networks/__init__.py index fb7c82eee63..a1c303de4f7 100644 --- a/src/cloudflare/resources/zero_trust/networks/__init__.py +++ b/src/cloudflare/resources/zero_trust/networks/__init__.py @@ -24,6 +24,14 @@ NetworksResourceWithStreamingResponse, AsyncNetworksResourceWithStreamingResponse, ) +from .hostname_routes import ( + HostnameRoutesResource, + AsyncHostnameRoutesResource, + HostnameRoutesResourceWithRawResponse, + AsyncHostnameRoutesResourceWithRawResponse, + HostnameRoutesResourceWithStreamingResponse, + AsyncHostnameRoutesResourceWithStreamingResponse, +) from .virtual_networks import ( VirtualNetworksResource, AsyncVirtualNetworksResource, @@ -52,6 +60,12 @@ "AsyncSubnetsResourceWithRawResponse", "SubnetsResourceWithStreamingResponse", "AsyncSubnetsResourceWithStreamingResponse", + "HostnameRoutesResource", + "AsyncHostnameRoutesResource", + "HostnameRoutesResourceWithRawResponse", + "AsyncHostnameRoutesResourceWithRawResponse", + "HostnameRoutesResourceWithStreamingResponse", + "AsyncHostnameRoutesResourceWithStreamingResponse", "NetworksResource", "AsyncNetworksResource", "NetworksResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/networks/hostname_routes.py b/src/cloudflare/resources/zero_trust/networks/hostname_routes.py new file mode 100644 index 00000000000..db22dd6bdf2 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/networks/hostname_routes.py @@ -0,0 +1,723 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +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.zero_trust.networks import ( + hostname_route_edit_params, + hostname_route_list_params, + hostname_route_create_params, +) +from ....types.zero_trust.networks.hostname_route import HostnameRoute + +__all__ = ["HostnameRoutesResource", "AsyncHostnameRoutesResource"] + + +class HostnameRoutesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> HostnameRoutesResourceWithRawResponse: + """ + 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 HostnameRoutesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> HostnameRoutesResourceWithStreamingResponse: + """ + 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 HostnameRoutesResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + comment: str | Omit = omit, + hostname: str | Omit = omit, + tunnel_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> HostnameRoute: + """ + Create a hostname route. + + Args: + account_id: Cloudflare account ID + + comment: An optional description of the hostname route. + + hostname: The hostname of the route. + + tunnel_id: UUID of the 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 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}/zerotrust/routes/hostname", + body=maybe_transform( + { + "comment": comment, + "hostname": hostname, + "tunnel_id": tunnel_id, + }, + hostname_route_create_params.HostnameRouteCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[HostnameRoute]._unwrapper, + ), + cast_to=cast(Type[HostnameRoute], ResultWrapper[HostnameRoute]), + ) + + def list( + self, + *, + account_id: str, + id: str | Omit = omit, + comment: str | Omit = omit, + existed_at: str | Omit = omit, + hostname: str | Omit = omit, + is_deleted: bool | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + tunnel_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncV4PagePaginationArray[HostnameRoute]: + """ + Lists and filters hostname routes in an account. + + Args: + account_id: Cloudflare account ID + + id: The hostname route ID. + + comment: If set, only list hostname routes with the given comment. + + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. + + hostname: If set, only list hostname routes that contain a substring of the given value, + the filter is case-insensitive. + + is_deleted: If `true`, only return deleted hostname routes. If `false`, exclude deleted + hostname routes. + + page: Page number of paginated results. + + per_page: Number of results to display. + + tunnel_id: If set, only list hostname routes that point to a specific 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 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}/zerotrust/routes/hostname", + page=SyncV4PagePaginationArray[HostnameRoute], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "comment": comment, + "existed_at": existed_at, + "hostname": hostname, + "is_deleted": is_deleted, + "page": page, + "per_page": per_page, + "tunnel_id": tunnel_id, + }, + hostname_route_list_params.HostnameRouteListParams, + ), + ), + model=HostnameRoute, + ) + + def delete( + self, + hostname_route_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, + ) -> HostnameRoute: + """ + Delete a hostname route. + + Args: + account_id: Cloudflare account ID + + hostname_route_id: The hostname route ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not hostname_route_id: + raise ValueError(f"Expected a non-empty value for `hostname_route_id` but received {hostname_route_id!r}") + return self._delete( + f"/accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[HostnameRoute]._unwrapper, + ), + cast_to=cast(Type[HostnameRoute], ResultWrapper[HostnameRoute]), + ) + + def edit( + self, + hostname_route_id: str, + *, + account_id: str, + comment: str | Omit = omit, + hostname: str | Omit = omit, + tunnel_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> HostnameRoute: + """ + Updates a hostname route. + + Args: + account_id: Cloudflare account ID + + hostname_route_id: The hostname route ID. + + comment: An optional description of the hostname route. + + hostname: The hostname of the route. + + tunnel_id: UUID of the 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not hostname_route_id: + raise ValueError(f"Expected a non-empty value for `hostname_route_id` but received {hostname_route_id!r}") + return self._patch( + f"/accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}", + body=maybe_transform( + { + "comment": comment, + "hostname": hostname, + "tunnel_id": tunnel_id, + }, + hostname_route_edit_params.HostnameRouteEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[HostnameRoute]._unwrapper, + ), + cast_to=cast(Type[HostnameRoute], ResultWrapper[HostnameRoute]), + ) + + def get( + self, + hostname_route_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, + ) -> HostnameRoute: + """ + Get a hostname route. + + Args: + account_id: Cloudflare account ID + + hostname_route_id: The hostname route ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not hostname_route_id: + raise ValueError(f"Expected a non-empty value for `hostname_route_id` but received {hostname_route_id!r}") + return self._get( + f"/accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[HostnameRoute]._unwrapper, + ), + cast_to=cast(Type[HostnameRoute], ResultWrapper[HostnameRoute]), + ) + + +class AsyncHostnameRoutesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncHostnameRoutesResourceWithRawResponse: + """ + 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 AsyncHostnameRoutesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncHostnameRoutesResourceWithStreamingResponse: + """ + 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 AsyncHostnameRoutesResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + comment: str | Omit = omit, + hostname: str | Omit = omit, + tunnel_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> HostnameRoute: + """ + Create a hostname route. + + Args: + account_id: Cloudflare account ID + + comment: An optional description of the hostname route. + + hostname: The hostname of the route. + + tunnel_id: UUID of the 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 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}/zerotrust/routes/hostname", + body=await async_maybe_transform( + { + "comment": comment, + "hostname": hostname, + "tunnel_id": tunnel_id, + }, + hostname_route_create_params.HostnameRouteCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[HostnameRoute]._unwrapper, + ), + cast_to=cast(Type[HostnameRoute], ResultWrapper[HostnameRoute]), + ) + + def list( + self, + *, + account_id: str, + id: str | Omit = omit, + comment: str | Omit = omit, + existed_at: str | Omit = omit, + hostname: str | Omit = omit, + is_deleted: bool | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + tunnel_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[HostnameRoute, AsyncV4PagePaginationArray[HostnameRoute]]: + """ + Lists and filters hostname routes in an account. + + Args: + account_id: Cloudflare account ID + + id: The hostname route ID. + + comment: If set, only list hostname routes with the given comment. + + existed_at: If provided, include only resources that were created (and not deleted) before + this time. URL encoded. + + hostname: If set, only list hostname routes that contain a substring of the given value, + the filter is case-insensitive. + + is_deleted: If `true`, only return deleted hostname routes. If `false`, exclude deleted + hostname routes. + + page: Page number of paginated results. + + per_page: Number of results to display. + + tunnel_id: If set, only list hostname routes that point to a specific 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 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}/zerotrust/routes/hostname", + page=AsyncV4PagePaginationArray[HostnameRoute], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "comment": comment, + "existed_at": existed_at, + "hostname": hostname, + "is_deleted": is_deleted, + "page": page, + "per_page": per_page, + "tunnel_id": tunnel_id, + }, + hostname_route_list_params.HostnameRouteListParams, + ), + ), + model=HostnameRoute, + ) + + async def delete( + self, + hostname_route_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, + ) -> HostnameRoute: + """ + Delete a hostname route. + + Args: + account_id: Cloudflare account ID + + hostname_route_id: The hostname route ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not hostname_route_id: + raise ValueError(f"Expected a non-empty value for `hostname_route_id` but received {hostname_route_id!r}") + return await self._delete( + f"/accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[HostnameRoute]._unwrapper, + ), + cast_to=cast(Type[HostnameRoute], ResultWrapper[HostnameRoute]), + ) + + async def edit( + self, + hostname_route_id: str, + *, + account_id: str, + comment: str | Omit = omit, + hostname: str | Omit = omit, + tunnel_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> HostnameRoute: + """ + Updates a hostname route. + + Args: + account_id: Cloudflare account ID + + hostname_route_id: The hostname route ID. + + comment: An optional description of the hostname route. + + hostname: The hostname of the route. + + tunnel_id: UUID of the 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 account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not hostname_route_id: + raise ValueError(f"Expected a non-empty value for `hostname_route_id` but received {hostname_route_id!r}") + return await self._patch( + f"/accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}", + body=await async_maybe_transform( + { + "comment": comment, + "hostname": hostname, + "tunnel_id": tunnel_id, + }, + hostname_route_edit_params.HostnameRouteEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[HostnameRoute]._unwrapper, + ), + cast_to=cast(Type[HostnameRoute], ResultWrapper[HostnameRoute]), + ) + + async def get( + self, + hostname_route_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, + ) -> HostnameRoute: + """ + Get a hostname route. + + Args: + account_id: Cloudflare account ID + + hostname_route_id: The hostname route ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not hostname_route_id: + raise ValueError(f"Expected a non-empty value for `hostname_route_id` but received {hostname_route_id!r}") + return await self._get( + f"/accounts/{account_id}/zerotrust/routes/hostname/{hostname_route_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[HostnameRoute]._unwrapper, + ), + cast_to=cast(Type[HostnameRoute], ResultWrapper[HostnameRoute]), + ) + + +class HostnameRoutesResourceWithRawResponse: + def __init__(self, hostname_routes: HostnameRoutesResource) -> None: + self._hostname_routes = hostname_routes + + self.create = to_raw_response_wrapper( + hostname_routes.create, + ) + self.list = to_raw_response_wrapper( + hostname_routes.list, + ) + self.delete = to_raw_response_wrapper( + hostname_routes.delete, + ) + self.edit = to_raw_response_wrapper( + hostname_routes.edit, + ) + self.get = to_raw_response_wrapper( + hostname_routes.get, + ) + + +class AsyncHostnameRoutesResourceWithRawResponse: + def __init__(self, hostname_routes: AsyncHostnameRoutesResource) -> None: + self._hostname_routes = hostname_routes + + self.create = async_to_raw_response_wrapper( + hostname_routes.create, + ) + self.list = async_to_raw_response_wrapper( + hostname_routes.list, + ) + self.delete = async_to_raw_response_wrapper( + hostname_routes.delete, + ) + self.edit = async_to_raw_response_wrapper( + hostname_routes.edit, + ) + self.get = async_to_raw_response_wrapper( + hostname_routes.get, + ) + + +class HostnameRoutesResourceWithStreamingResponse: + def __init__(self, hostname_routes: HostnameRoutesResource) -> None: + self._hostname_routes = hostname_routes + + self.create = to_streamed_response_wrapper( + hostname_routes.create, + ) + self.list = to_streamed_response_wrapper( + hostname_routes.list, + ) + self.delete = to_streamed_response_wrapper( + hostname_routes.delete, + ) + self.edit = to_streamed_response_wrapper( + hostname_routes.edit, + ) + self.get = to_streamed_response_wrapper( + hostname_routes.get, + ) + + +class AsyncHostnameRoutesResourceWithStreamingResponse: + def __init__(self, hostname_routes: AsyncHostnameRoutesResource) -> None: + self._hostname_routes = hostname_routes + + self.create = async_to_streamed_response_wrapper( + hostname_routes.create, + ) + self.list = async_to_streamed_response_wrapper( + hostname_routes.list, + ) + self.delete = async_to_streamed_response_wrapper( + hostname_routes.delete, + ) + self.edit = async_to_streamed_response_wrapper( + hostname_routes.edit, + ) + self.get = async_to_streamed_response_wrapper( + hostname_routes.get, + ) diff --git a/src/cloudflare/resources/zero_trust/networks/networks.py b/src/cloudflare/resources/zero_trust/networks/networks.py index 62a188d9b05..1ca2ffb5b3d 100644 --- a/src/cloudflare/resources/zero_trust/networks/networks.py +++ b/src/cloudflare/resources/zero_trust/networks/networks.py @@ -12,6 +12,14 @@ RoutesResourceWithStreamingResponse, AsyncRoutesResourceWithStreamingResponse, ) +from .hostname_routes import ( + HostnameRoutesResource, + AsyncHostnameRoutesResource, + HostnameRoutesResourceWithRawResponse, + AsyncHostnameRoutesResourceWithRawResponse, + HostnameRoutesResourceWithStreamingResponse, + AsyncHostnameRoutesResourceWithStreamingResponse, +) from .subnets.subnets import ( SubnetsResource, AsyncSubnetsResource, @@ -45,6 +53,10 @@ def virtual_networks(self) -> VirtualNetworksResource: def subnets(self) -> SubnetsResource: return SubnetsResource(self._client) + @cached_property + def hostname_routes(self) -> HostnameRoutesResource: + return HostnameRoutesResource(self._client) + @cached_property def with_raw_response(self) -> NetworksResourceWithRawResponse: """ @@ -78,6 +90,10 @@ def virtual_networks(self) -> AsyncVirtualNetworksResource: def subnets(self) -> AsyncSubnetsResource: return AsyncSubnetsResource(self._client) + @cached_property + def hostname_routes(self) -> AsyncHostnameRoutesResource: + return AsyncHostnameRoutesResource(self._client) + @cached_property def with_raw_response(self) -> AsyncNetworksResourceWithRawResponse: """ @@ -114,6 +130,10 @@ def virtual_networks(self) -> VirtualNetworksResourceWithRawResponse: def subnets(self) -> SubnetsResourceWithRawResponse: return SubnetsResourceWithRawResponse(self._networks.subnets) + @cached_property + def hostname_routes(self) -> HostnameRoutesResourceWithRawResponse: + return HostnameRoutesResourceWithRawResponse(self._networks.hostname_routes) + class AsyncNetworksResourceWithRawResponse: def __init__(self, networks: AsyncNetworksResource) -> None: @@ -131,6 +151,10 @@ def virtual_networks(self) -> AsyncVirtualNetworksResourceWithRawResponse: def subnets(self) -> AsyncSubnetsResourceWithRawResponse: return AsyncSubnetsResourceWithRawResponse(self._networks.subnets) + @cached_property + def hostname_routes(self) -> AsyncHostnameRoutesResourceWithRawResponse: + return AsyncHostnameRoutesResourceWithRawResponse(self._networks.hostname_routes) + class NetworksResourceWithStreamingResponse: def __init__(self, networks: NetworksResource) -> None: @@ -148,6 +172,10 @@ def virtual_networks(self) -> VirtualNetworksResourceWithStreamingResponse: def subnets(self) -> SubnetsResourceWithStreamingResponse: return SubnetsResourceWithStreamingResponse(self._networks.subnets) + @cached_property + def hostname_routes(self) -> HostnameRoutesResourceWithStreamingResponse: + return HostnameRoutesResourceWithStreamingResponse(self._networks.hostname_routes) + class AsyncNetworksResourceWithStreamingResponse: def __init__(self, networks: AsyncNetworksResource) -> None: @@ -164,3 +192,7 @@ def virtual_networks(self) -> AsyncVirtualNetworksResourceWithStreamingResponse: @cached_property def subnets(self) -> AsyncSubnetsResourceWithStreamingResponse: return AsyncSubnetsResourceWithStreamingResponse(self._networks.subnets) + + @cached_property + def hostname_routes(self) -> AsyncHostnameRoutesResourceWithStreamingResponse: + return AsyncHostnameRoutesResourceWithStreamingResponse(self._networks.hostname_routes) diff --git a/src/cloudflare/resources/zero_trust/networks/routes/ips.py b/src/cloudflare/resources/zero_trust/networks/routes/ips.py index 93b2fb2a152..9641d3eda30 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/ips.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/ips.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,14 +49,14 @@ def get( ip: str, *, account_id: str, - default_virtual_network_fallback: bool | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Teamnet: """ Fetches routes that contain the given IP address. @@ -128,14 +128,14 @@ async def get( ip: str, *, account_id: str, - default_virtual_network_fallback: bool | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Teamnet: """ Fetches routes that contain the given IP address. diff --git a/src/cloudflare/resources/zero_trust/networks/routes/networks.py b/src/cloudflare/resources/zero_trust/networks/routes/networks.py index a535df03399..3b9f9249a10 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/networks.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/networks.py @@ -8,7 +8,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,14 +55,14 @@ def create( *, account_id: str, tunnel_id: str, - comment: str | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + comment: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """Routes a private network through a Cloudflare Tunnel. @@ -120,16 +120,15 @@ def delete( ip_network_encoded: str, *, account_id: str, - tun_type: Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"] - | NotGiven = NOT_GIVEN, - tunnel_id: str | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """Deletes a private network route from an account. @@ -197,7 +196,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """Updates an existing private network route in an account. @@ -263,14 +262,14 @@ async def create( *, account_id: str, tunnel_id: str, - comment: str | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + comment: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """Routes a private network through a Cloudflare Tunnel. @@ -328,16 +327,15 @@ async def delete( ip_network_encoded: str, *, account_id: str, - tun_type: Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"] - | NotGiven = NOT_GIVEN, - tunnel_id: str | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + 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, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """Deletes a private network route from an account. @@ -405,7 +403,7 @@ async def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """Updates an existing private network route in an account. @@ -448,17 +446,17 @@ def __init__(self, networks: NetworksResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - networks.create # pyright: ignore[reportDeprecated], + networks.create, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - networks.delete # pyright: ignore[reportDeprecated], + networks.delete, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - networks.edit # pyright: ignore[reportDeprecated], + networks.edit, # pyright: ignore[reportDeprecated], ) ) @@ -469,17 +467,17 @@ def __init__(self, networks: AsyncNetworksResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - networks.create # pyright: ignore[reportDeprecated], + networks.create, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - networks.delete # pyright: ignore[reportDeprecated], + networks.delete, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - networks.edit # pyright: ignore[reportDeprecated], + networks.edit, # pyright: ignore[reportDeprecated], ) ) @@ -490,17 +488,17 @@ def __init__(self, networks: NetworksResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - networks.create # pyright: ignore[reportDeprecated], + networks.create, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - networks.delete # pyright: ignore[reportDeprecated], + networks.delete, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - networks.edit # pyright: ignore[reportDeprecated], + networks.edit, # pyright: ignore[reportDeprecated], ) ) @@ -511,16 +509,16 @@ def __init__(self, networks: AsyncNetworksResource) -> None: self.create = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - networks.create # pyright: ignore[reportDeprecated], + networks.create, # pyright: ignore[reportDeprecated], ) ) self.delete = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - networks.delete # pyright: ignore[reportDeprecated], + networks.delete, # pyright: ignore[reportDeprecated], ) ) self.edit = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - networks.edit # pyright: ignore[reportDeprecated], + networks.edit, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/zero_trust/networks/routes/routes.py b/src/cloudflare/resources/zero_trust/networks/routes/routes.py index 11b97a8cafc..e185d23080e 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/routes.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/routes.py @@ -23,7 +23,7 @@ NetworksResourceWithStreamingResponse, AsyncNetworksResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -77,14 +77,14 @@ def create( account_id: str, network: str, tunnel_id: str, - comment: str | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + comment: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """ Routes a private network through a Cloudflare Tunnel. @@ -135,24 +135,23 @@ def list( self, *, account_id: str, - comment: str | NotGiven = NOT_GIVEN, - existed_at: str | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - network_subset: str | NotGiven = NOT_GIVEN, - network_superset: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - route_id: str | NotGiven = NOT_GIVEN, - tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] - | NotGiven = NOT_GIVEN, - tunnel_id: str | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + existed_at: str | Omit = omit, + is_deleted: bool | Omit = omit, + network_subset: str | Omit = omit, + network_superset: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + route_id: str | Omit = omit, + tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] | Omit = omit, + tunnel_id: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Teamnet]: """ Lists and filters private network routes in an account. @@ -232,7 +231,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """ Deletes a private network route from an account. @@ -271,16 +270,16 @@ def edit( route_id: str, *, account_id: str, - comment: str | NotGiven = NOT_GIVEN, - network: str | NotGiven = NOT_GIVEN, - tunnel_id: str | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + network: str | Omit = omit, + tunnel_id: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """Updates an existing private network route in an account. @@ -343,7 +342,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """ Get a private network route in an account. @@ -412,14 +411,14 @@ async def create( account_id: str, network: str, tunnel_id: str, - comment: str | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + comment: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """ Routes a private network through a Cloudflare Tunnel. @@ -470,24 +469,23 @@ def list( self, *, account_id: str, - comment: str | NotGiven = NOT_GIVEN, - existed_at: str | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - network_subset: str | NotGiven = NOT_GIVEN, - network_superset: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - route_id: str | NotGiven = NOT_GIVEN, - tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] - | NotGiven = NOT_GIVEN, - tunnel_id: str | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + existed_at: str | Omit = omit, + is_deleted: bool | Omit = omit, + network_subset: str | Omit = omit, + network_superset: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + route_id: str | Omit = omit, + tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] | Omit = omit, + tunnel_id: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Teamnet, AsyncV4PagePaginationArray[Teamnet]]: """ Lists and filters private network routes in an account. @@ -567,7 +565,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """ Deletes a private network route from an account. @@ -606,16 +604,16 @@ async def edit( route_id: str, *, account_id: str, - comment: str | NotGiven = NOT_GIVEN, - network: str | NotGiven = NOT_GIVEN, - tunnel_id: str | NotGiven = NOT_GIVEN, - virtual_network_id: str | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + network: str | Omit = omit, + tunnel_id: str | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """Updates an existing private network route in an account. @@ -678,7 +676,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Route: """ Get a private network route in an account. 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 c9b294d07ca..9245c6df3f9 100644 --- a/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py +++ b/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py @@ -7,7 +7,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,15 +50,15 @@ def update( address_family: Literal["v4", "v6"], *, account_id: str, - comment: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: str | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + name: str | Omit = omit, + network: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudflareSourceUpdateResponse: """ Updates the Cloudflare Source subnet of the given address family @@ -132,15 +132,15 @@ async def update( address_family: Literal["v4", "v6"], *, account_id: str, - comment: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: str | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + name: str | Omit = omit, + network: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudflareSourceUpdateResponse: """ Updates the Cloudflare Source subnet of the given 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 463353d3dd7..c7d545c3809 100644 --- a/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py +++ b/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -60,23 +60,23 @@ def list( self, *, account_id: str, - address_family: Literal["v4", "v6"] | NotGiven = NOT_GIVEN, - comment: str | NotGiven = NOT_GIVEN, - existed_at: str | NotGiven = NOT_GIVEN, - is_default_network: bool | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - subnet_types: Literal["cloudflare_source", "warp"] | NotGiven = NOT_GIVEN, + address_family: Literal["v4", "v6"] | Omit = omit, + comment: str | Omit = omit, + existed_at: str | Omit = omit, + is_default_network: bool | Omit = omit, + is_deleted: bool | Omit = omit, + name: str | Omit = omit, + network: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, + subnet_types: Literal["cloudflare_source", "warp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[SubnetListResponse]: """ Lists and filters subnets in an account. @@ -177,23 +177,23 @@ def list( self, *, account_id: str, - address_family: Literal["v4", "v6"] | NotGiven = NOT_GIVEN, - comment: str | NotGiven = NOT_GIVEN, - existed_at: str | NotGiven = NOT_GIVEN, - is_default_network: bool | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - subnet_types: Literal["cloudflare_source", "warp"] | NotGiven = NOT_GIVEN, + address_family: Literal["v4", "v6"] | Omit = omit, + comment: str | Omit = omit, + existed_at: str | Omit = omit, + is_default_network: bool | Omit = omit, + is_deleted: bool | Omit = omit, + name: str | Omit = omit, + network: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + sort_order: Literal["asc", "desc"] | Omit = omit, + subnet_types: Literal["cloudflare_source", "warp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[SubnetListResponse, AsyncV4PagePaginationArray[SubnetListResponse]]: """ Lists and filters subnets in an account. diff --git a/src/cloudflare/resources/zero_trust/networks/virtual_networks.py b/src/cloudflare/resources/zero_trust/networks/virtual_networks.py index c05f27103f1..f89bf422286 100644 --- a/src/cloudflare/resources/zero_trust/networks/virtual_networks.py +++ b/src/cloudflare/resources/zero_trust/networks/virtual_networks.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -54,15 +54,15 @@ def create( *, account_id: str, name: str, - comment: str | NotGiven = NOT_GIVEN, - is_default: bool | NotGiven = NOT_GIVEN, - is_default_network: bool | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + is_default: bool | Omit = omit, + is_default_network: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VirtualNetwork: """ Adds a new virtual network to an account. @@ -113,16 +113,17 @@ def list( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - is_default: bool | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + is_default: bool | Omit = omit, + is_default_network: bool | Omit = omit, + is_deleted: bool | 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[VirtualNetwork]: """ Lists and filters virtual networks in an account. @@ -135,6 +136,9 @@ def list( is_default: If `true`, only include the default virtual network. If `false`, exclude the default virtual network. If empty, all virtual networks will be included. + is_default_network: If `true`, only include the default virtual network. If `false`, exclude the + default virtual network. If empty, all virtual networks will be included. + is_deleted: If `true`, only include deleted virtual networks. If `false`, exclude deleted virtual networks. If empty, all virtual networks will be included. @@ -162,6 +166,7 @@ def list( { "id": id, "is_default": is_default, + "is_default_network": is_default_network, "is_deleted": is_deleted, "name": name, }, @@ -181,7 +186,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VirtualNetwork: """ Deletes an existing virtual network. @@ -220,15 +225,15 @@ def edit( virtual_network_id: str, *, account_id: str, - comment: str | NotGiven = NOT_GIVEN, - is_default_network: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + is_default_network: bool | 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VirtualNetwork: """ Updates an existing virtual network. @@ -286,7 +291,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VirtualNetwork: """ Get a virtual network. @@ -346,15 +351,15 @@ async def create( *, account_id: str, name: str, - comment: str | NotGiven = NOT_GIVEN, - is_default: bool | NotGiven = NOT_GIVEN, - is_default_network: bool | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + is_default: bool | Omit = omit, + is_default_network: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VirtualNetwork: """ Adds a new virtual network to an account. @@ -405,16 +410,17 @@ def list( self, *, account_id: str, - id: str | NotGiven = NOT_GIVEN, - is_default: bool | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + id: str | Omit = omit, + is_default: bool | Omit = omit, + is_default_network: bool | Omit = omit, + is_deleted: bool | 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[VirtualNetwork, AsyncSinglePage[VirtualNetwork]]: """ Lists and filters virtual networks in an account. @@ -427,6 +433,9 @@ def list( is_default: If `true`, only include the default virtual network. If `false`, exclude the default virtual network. If empty, all virtual networks will be included. + is_default_network: If `true`, only include the default virtual network. If `false`, exclude the + default virtual network. If empty, all virtual networks will be included. + is_deleted: If `true`, only include deleted virtual networks. If `false`, exclude deleted virtual networks. If empty, all virtual networks will be included. @@ -454,6 +463,7 @@ def list( { "id": id, "is_default": is_default, + "is_default_network": is_default_network, "is_deleted": is_deleted, "name": name, }, @@ -473,7 +483,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VirtualNetwork: """ Deletes an existing virtual network. @@ -512,15 +522,15 @@ async def edit( virtual_network_id: str, *, account_id: str, - comment: str | NotGiven = NOT_GIVEN, - is_default_network: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + comment: str | Omit = omit, + is_default_network: bool | 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VirtualNetwork: """ Updates an existing virtual network. @@ -578,7 +588,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VirtualNetwork: """ Get a virtual network. diff --git a/src/cloudflare/resources/zero_trust/organizations/doh.py b/src/cloudflare/resources/zero_trust/organizations/doh.py index 1602c7cd027..61e2ccdb031 100644 --- a/src/cloudflare/resources/zero_trust/organizations/doh.py +++ b/src/cloudflare/resources/zero_trust/organizations/doh.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -49,14 +49,14 @@ def update( self, *, account_id: str, - doh_jwt_duration: str | NotGiven = NOT_GIVEN, - service_token_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DOHUpdateResponse]: """ Updates the DoH settings for your Zero Trust organization. @@ -109,7 +109,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DOHGetResponse]: """ Returns the DoH settings for your Zero Trust organization. @@ -164,14 +164,14 @@ async def update( self, *, account_id: str, - doh_jwt_duration: str | NotGiven = NOT_GIVEN, - service_token_id: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DOHUpdateResponse]: """ Updates the DoH settings for your Zero Trust organization. @@ -224,7 +224,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[DOHGetResponse]: """ Returns the DoH settings for your Zero Trust organization. diff --git a/src/cloudflare/resources/zero_trust/organizations/organizations.py b/src/cloudflare/resources/zero_trust/organizations/organizations.py index 8ab81a14c8a..7ee3f4dd3c4 100644 --- a/src/cloudflare/resources/zero_trust/organizations/organizations.py +++ b/src/cloudflare/resources/zero_trust/organizations/organizations.py @@ -14,7 +14,7 @@ DOHResourceWithStreamingResponse, AsyncDOHResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -67,22 +67,22 @@ def create( *, auth_domain: str, name: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - is_ui_read_only: bool | NotGiven = NOT_GIVEN, - login_design: LoginDesignParam | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - ui_read_only_toggle_reason: str | NotGiven = NOT_GIVEN, - user_seat_expiration_inactive_time: str | NotGiven = NOT_GIVEN, - warp_auth_session_duration: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + allow_authenticate_via_warp: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + is_ui_read_only: bool | Omit = omit, + login_design: LoginDesignParam | Omit = omit, + session_duration: str | Omit = omit, + ui_read_only_toggle_reason: str | Omit = omit, + user_seat_expiration_inactive_time: str | Omit = omit, + warp_auth_session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Organization]: """ Sets up a Zero Trust organization for your account or zone. @@ -170,25 +170,25 @@ def create( def update( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - auth_domain: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - custom_pages: organization_update_params.CustomPages | NotGiven = NOT_GIVEN, - is_ui_read_only: bool | NotGiven = NOT_GIVEN, - login_design: LoginDesignParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - ui_read_only_toggle_reason: str | NotGiven = NOT_GIVEN, - user_seat_expiration_inactive_time: str | NotGiven = NOT_GIVEN, - warp_auth_session_duration: str | NotGiven = NOT_GIVEN, + 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, + custom_pages: organization_update_params.CustomPages | Omit = omit, + is_ui_read_only: bool | Omit = omit, + login_design: LoginDesignParam | Omit = omit, + name: str | Omit = omit, + session_duration: str | Omit = omit, + ui_read_only_toggle_reason: str | Omit = omit, + user_seat_expiration_inactive_time: str | Omit = omit, + warp_auth_session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Organization]: """ Updates the configuration for your Zero Trust organization. @@ -277,14 +277,14 @@ def update( def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Organization]: """ Returns the configuration for your Zero Trust organization. @@ -330,18 +330,18 @@ def revoke_users( self, *, email: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - query_devices: bool | NotGiven = NOT_GIVEN, - body_devices: bool | NotGiven = NOT_GIVEN, - user_uid: str | NotGiven = NOT_GIVEN, - warp_session_reauth: bool | NotGiven = NOT_GIVEN, + 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, + warp_session_reauth: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OrganizationRevokeUsersResponse]: """ Revokes a user's access across all applications. @@ -439,22 +439,22 @@ async def create( *, auth_domain: str, name: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - is_ui_read_only: bool | NotGiven = NOT_GIVEN, - login_design: LoginDesignParam | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - ui_read_only_toggle_reason: str | NotGiven = NOT_GIVEN, - user_seat_expiration_inactive_time: str | NotGiven = NOT_GIVEN, - warp_auth_session_duration: str | NotGiven = NOT_GIVEN, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + allow_authenticate_via_warp: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + is_ui_read_only: bool | Omit = omit, + login_design: LoginDesignParam | Omit = omit, + session_duration: str | Omit = omit, + ui_read_only_toggle_reason: str | Omit = omit, + user_seat_expiration_inactive_time: str | Omit = omit, + warp_auth_session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Organization]: """ Sets up a Zero Trust organization for your account or zone. @@ -542,25 +542,25 @@ async def create( async def update( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, - auth_domain: str | NotGiven = NOT_GIVEN, - auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - custom_pages: organization_update_params.CustomPages | NotGiven = NOT_GIVEN, - is_ui_read_only: bool | NotGiven = NOT_GIVEN, - login_design: LoginDesignParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - session_duration: str | NotGiven = NOT_GIVEN, - ui_read_only_toggle_reason: str | NotGiven = NOT_GIVEN, - user_seat_expiration_inactive_time: str | NotGiven = NOT_GIVEN, - warp_auth_session_duration: str | NotGiven = NOT_GIVEN, + 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, + custom_pages: organization_update_params.CustomPages | Omit = omit, + is_ui_read_only: bool | Omit = omit, + login_design: LoginDesignParam | Omit = omit, + name: str | Omit = omit, + session_duration: str | Omit = omit, + ui_read_only_toggle_reason: str | Omit = omit, + user_seat_expiration_inactive_time: str | Omit = omit, + warp_auth_session_duration: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Organization]: """ Updates the configuration for your Zero Trust organization. @@ -649,14 +649,14 @@ async def update( async def list( self, *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, + 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, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Organization]: """ Returns the configuration for your Zero Trust organization. @@ -702,18 +702,18 @@ async def revoke_users( self, *, email: str, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - query_devices: bool | NotGiven = NOT_GIVEN, - body_devices: bool | NotGiven = NOT_GIVEN, - user_uid: str | NotGiven = NOT_GIVEN, - warp_session_reauth: bool | NotGiven = NOT_GIVEN, + 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, + warp_session_reauth: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OrganizationRevokeUsersResponse]: """ Revokes a user's access across all applications. diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py b/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py index ef217acb2fd..eadc2e70206 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -55,7 +55,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BehaviourUpdateResponse]: """ Update configuration for risk behaviors @@ -93,7 +93,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BehaviourGetResponse]: """ Get all behaviors and associated configuration @@ -152,7 +152,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BehaviourUpdateResponse]: """ Update configuration for risk behaviors @@ -190,7 +190,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BehaviourGetResponse]: """ Get all behaviors and associated configuration 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 0493d3fb19f..3b29a5b4835 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/integrations/integrations.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/integrations/integrations.py @@ -7,7 +7,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from .references import ( ReferencesResource, @@ -67,13 +67,13 @@ def create( account_id: str, integration_type: Literal["Okta"], tenant_url: str, - reference_id: Optional[str] | NotGiven = NOT_GIVEN, + reference_id: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IntegrationCreateResponse]: """ Create new risk score integration. @@ -122,13 +122,13 @@ def update( account_id: str, active: bool, tenant_url: str, - reference_id: Optional[str] | NotGiven = NOT_GIVEN, + reference_id: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IntegrationUpdateResponse]: """ Overwrite the reference_id, tenant_url, and active values with the ones @@ -185,7 +185,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[IntegrationListResponse]: """ List all risk score integrations for the account. @@ -220,7 +220,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a risk score integration. @@ -260,7 +260,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IntegrationGetResponse]: """ Get risk score integration by id. @@ -321,13 +321,13 @@ async def create( account_id: str, integration_type: Literal["Okta"], tenant_url: str, - reference_id: Optional[str] | NotGiven = NOT_GIVEN, + reference_id: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IntegrationCreateResponse]: """ Create new risk score integration. @@ -376,13 +376,13 @@ async def update( account_id: str, active: bool, tenant_url: str, - reference_id: Optional[str] | NotGiven = NOT_GIVEN, + reference_id: 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IntegrationUpdateResponse]: """ Overwrite the reference_id, tenant_url, and active values with the ones @@ -439,7 +439,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[IntegrationListResponse, AsyncSinglePage[IntegrationListResponse]]: """ List all risk score integrations for the account. @@ -474,7 +474,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Delete a risk score integration. @@ -514,7 +514,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IntegrationGetResponse]: """ Get risk score integration by 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 faf1e16c8f3..f3587823371 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/integrations/references.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/integrations/references.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ReferenceGetResponse]: """ Get risk score integration by reference id. @@ -113,7 +113,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ReferenceGetResponse]: """ Get risk score integration by 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 1addfc08b30..48ddc41779b 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py @@ -14,7 +14,7 @@ SummaryResourceWithStreamingResponse, AsyncSummaryResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from .behaviours import ( BehavioursResource, @@ -88,7 +88,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RiskScoringGetResponse]: """ Get risk event/score information for a specific user @@ -128,7 +128,7 @@ def reset( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Clear the risk score for a particular user @@ -201,7 +201,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RiskScoringGetResponse]: """ Get risk event/score information for a specific user @@ -241,7 +241,7 @@ async def reset( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Clear the risk score for a particular user diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/summary.py b/src/cloudflare/resources/zero_trust/risk_scoring/summary.py index ad8ad405994..0a43b204780 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/summary.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/summary.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import Body, Query, Headers, NotGiven, not_given from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,7 +51,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SummaryGetResponse]: """ Get risk score info for all users in the account @@ -109,7 +109,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SummaryGetResponse]: """ Get risk score info for all users in the account diff --git a/src/cloudflare/resources/zero_trust/seats.py b/src/cloudflare/resources/zero_trust/seats.py index e2abb4ab7d8..33b23e1567c 100644 --- a/src/cloudflare/resources/zero_trust/seats.py +++ b/src/cloudflare/resources/zero_trust/seats.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,7 +54,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Seat]: """ Removes a user from a Zero Trust seat when both `access_seat` and `gateway_seat` @@ -115,7 +115,7 @@ def edit( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Seat, AsyncSinglePage[Seat]]: """ Removes a user from a Zero Trust seat when both `access_seat` and `gateway_seat` diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py index 6678978e046..58b049dacbd 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py @@ -16,7 +16,7 @@ TokenResourceWithStreamingResponse, AsyncTokenResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from .connectors import ( ConnectorsResource, @@ -116,14 +116,14 @@ def create( *, account_id: str, name: str, - config_src: Literal["local", "cloudflare"] | NotGiven = NOT_GIVEN, - tunnel_secret: str | NotGiven = NOT_GIVEN, + config_src: Literal["local", "cloudflare"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudflaredCreateResponse: """ Creates a new Cloudflare Tunnel in an account. @@ -179,23 +179,23 @@ def list( self, *, account_id: str, - exclude_prefix: str | NotGiven = NOT_GIVEN, - existed_at: str | NotGiven = NOT_GIVEN, - include_prefix: str | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, - uuid: str | NotGiven = NOT_GIVEN, - was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + exclude_prefix: str | Omit = omit, + existed_at: str | Omit = omit, + include_prefix: str | Omit = omit, + is_deleted: bool | Omit = omit, + name: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["inactive", "degraded", "healthy", "down"] | Omit = omit, + uuid: str | Omit = omit, + was_active_at: Union[str, datetime] | Omit = omit, + was_inactive_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[CloudflaredListResponse]: """ Lists and filters Cloudflare Tunnels in an account. @@ -270,7 +270,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudflaredDeleteResponse: """ Deletes a Cloudflare Tunnel from an account. @@ -314,14 +314,14 @@ def edit( tunnel_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - tunnel_secret: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudflaredEditResponse: """ Updates an existing Cloudflare Tunnel. @@ -382,7 +382,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudflaredGetResponse: """ Fetches a single Cloudflare Tunnel. @@ -467,14 +467,14 @@ async def create( *, account_id: str, name: str, - config_src: Literal["local", "cloudflare"] | NotGiven = NOT_GIVEN, - tunnel_secret: str | NotGiven = NOT_GIVEN, + config_src: Literal["local", "cloudflare"] | 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudflaredCreateResponse: """ Creates a new Cloudflare Tunnel in an account. @@ -530,23 +530,23 @@ def list( self, *, account_id: str, - exclude_prefix: str | NotGiven = NOT_GIVEN, - existed_at: str | NotGiven = NOT_GIVEN, - include_prefix: str | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, - uuid: str | NotGiven = NOT_GIVEN, - was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + exclude_prefix: str | Omit = omit, + existed_at: str | Omit = omit, + include_prefix: str | Omit = omit, + is_deleted: bool | Omit = omit, + name: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["inactive", "degraded", "healthy", "down"] | Omit = omit, + uuid: str | Omit = omit, + was_active_at: Union[str, datetime] | Omit = omit, + was_inactive_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CloudflaredListResponse, AsyncV4PagePaginationArray[CloudflaredListResponse]]: """ Lists and filters Cloudflare Tunnels in an account. @@ -621,7 +621,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudflaredDeleteResponse: """ Deletes a Cloudflare Tunnel from an account. @@ -665,14 +665,14 @@ async def edit( tunnel_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - tunnel_secret: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudflaredEditResponse: """ Updates an existing Cloudflare Tunnel. @@ -733,7 +733,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CloudflaredGetResponse: """ Fetches a single Cloudflare Tunnel. diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py index 7bf08a59e99..b70cdd5caf2 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,13 +50,13 @@ def update( tunnel_id: str, *, account_id: str, - config: configuration_update_params.Config | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigurationUpdateResponse]: """ Adds or updates the configuration for a remotely-managed tunnel. @@ -103,7 +103,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigurationGetResponse]: """ Gets the configuration for a remotely-managed tunnel @@ -163,13 +163,13 @@ async def update( tunnel_id: str, *, account_id: str, - config: configuration_update_params.Config | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigurationUpdateResponse]: """ Adds or updates the configuration for a remotely-managed tunnel. @@ -216,7 +216,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConfigurationGetResponse]: """ Gets the configuration for a remotely-managed tunnel diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py index ea81089025a..478f3deaaa4 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,13 +50,13 @@ def delete( tunnel_id: str, *, account_id: str, - client_id: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes a connection (aka Cloudflare Tunnel Connector) from a Cloudflare Tunnel @@ -106,7 +106,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[Client]: """ Fetches connection details for a Cloudflare Tunnel. @@ -163,13 +163,13 @@ async def delete( tunnel_id: str, *, account_id: str, - client_id: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ Removes a connection (aka Cloudflare Tunnel Connector) from a Cloudflare Tunnel @@ -221,7 +221,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Client, AsyncSinglePage[Client]]: """ Fetches connection details for a Cloudflare Tunnel. diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py index ca3f2df3469..4bb21057683 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -53,7 +53,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Client: """ Fetches connector and connection details for a Cloudflare Tunnel. @@ -123,7 +123,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Client: """ Fetches connector and connection details for a Cloudflare Tunnel. diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py index f123a45dc0b..f6c7015dfef 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py @@ -7,7 +7,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -56,7 +56,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Gets a management token used to access the management resources (i.e. @@ -125,7 +125,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """Gets a management token used to access the management resources (i.e. diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py index b232723a816..d16411c5002 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Gets the token used to associate cloudflared with a specific tunnel. @@ -117,7 +117,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Gets the token used to associate cloudflared with a specific tunnel. diff --git a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py index 072d8a41208..7f0cc04bdfa 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py +++ b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py @@ -8,7 +8,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -74,25 +74,24 @@ def list( self, *, account_id: str, - exclude_prefix: str | NotGiven = NOT_GIVEN, - existed_at: str | NotGiven = NOT_GIVEN, - include_prefix: str | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, - tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] - | NotGiven = NOT_GIVEN, - uuid: str | NotGiven = NOT_GIVEN, - was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + exclude_prefix: str | Omit = omit, + existed_at: str | Omit = omit, + include_prefix: str | Omit = omit, + is_deleted: bool | Omit = omit, + name: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["inactive", "degraded", "healthy", "down"] | Omit = omit, + tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] | Omit = omit, + uuid: str | Omit = omit, + was_active_at: Union[str, datetime] | Omit = omit, + was_inactive_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[TunnelListResponse]: """ Lists and filters all types of Tunnels in an account. @@ -193,25 +192,24 @@ def list( self, *, account_id: str, - exclude_prefix: str | NotGiven = NOT_GIVEN, - existed_at: str | NotGiven = NOT_GIVEN, - include_prefix: str | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, - tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] - | NotGiven = NOT_GIVEN, - uuid: str | NotGiven = NOT_GIVEN, - was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + exclude_prefix: str | Omit = omit, + existed_at: str | Omit = omit, + include_prefix: str | Omit = omit, + is_deleted: bool | Omit = omit, + name: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["inactive", "degraded", "healthy", "down"] | Omit = omit, + tun_types: List[Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"]] | Omit = omit, + uuid: str | Omit = omit, + was_active_at: Union[str, datetime] | Omit = omit, + was_inactive_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[TunnelListResponse, AsyncV4PagePaginationArray[TunnelListResponse]]: """ Lists and filters all types of Tunnels in an account. 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 e20e979d728..aeb96269e07 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/token.py +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/token.py @@ -6,7 +6,7 @@ import httpx -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._types import Body, Query, Headers, NotGiven, not_given from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -52,7 +52,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Gets the token used to associate warp device with a specific Warp Connector @@ -118,7 +118,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ Gets the token used to associate warp device with a specific Warp Connector 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 9e95d60c3cd..e8ec0d4ae3d 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 @@ -16,7 +16,7 @@ TokenResourceWithStreamingResponse, AsyncTokenResourceWithStreamingResponse, ) -from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -77,7 +77,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WARPConnectorCreateResponse: """ Creates a new Warp Connector Tunnel in an account. @@ -119,23 +119,23 @@ def list( self, *, account_id: str, - exclude_prefix: str | NotGiven = NOT_GIVEN, - existed_at: str | NotGiven = NOT_GIVEN, - include_prefix: str | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, - uuid: str | NotGiven = NOT_GIVEN, - was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + exclude_prefix: str | Omit = omit, + existed_at: str | Omit = omit, + include_prefix: str | Omit = omit, + is_deleted: bool | Omit = omit, + name: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["inactive", "degraded", "healthy", "down"] | Omit = omit, + uuid: str | Omit = omit, + was_active_at: Union[str, datetime] | Omit = omit, + was_inactive_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[WARPConnectorListResponse]: """ Lists and filters Warp Connector Tunnels in an account. @@ -212,7 +212,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WARPConnectorDeleteResponse: """ Deletes a Warp Connector Tunnel from an account. @@ -256,14 +256,14 @@ def edit( tunnel_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - tunnel_secret: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WARPConnectorEditResponse: """ Updates an existing Warp Connector Tunnel. @@ -324,7 +324,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WARPConnectorGetResponse: """ Fetches a single Warp Connector Tunnel. @@ -398,7 +398,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WARPConnectorCreateResponse: """ Creates a new Warp Connector Tunnel in an account. @@ -442,23 +442,23 @@ def list( self, *, account_id: str, - exclude_prefix: str | NotGiven = NOT_GIVEN, - existed_at: str | NotGiven = NOT_GIVEN, - include_prefix: str | NotGiven = NOT_GIVEN, - is_deleted: bool | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["inactive", "degraded", "healthy", "down"] | NotGiven = NOT_GIVEN, - uuid: str | NotGiven = NOT_GIVEN, - was_active_at: Union[str, datetime] | NotGiven = NOT_GIVEN, - was_inactive_at: Union[str, datetime] | NotGiven = NOT_GIVEN, + exclude_prefix: str | Omit = omit, + existed_at: str | Omit = omit, + include_prefix: str | Omit = omit, + is_deleted: bool | Omit = omit, + name: str | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["inactive", "degraded", "healthy", "down"] | Omit = omit, + uuid: str | Omit = omit, + was_active_at: Union[str, datetime] | Omit = omit, + was_inactive_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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WARPConnectorListResponse, AsyncV4PagePaginationArray[WARPConnectorListResponse]]: """ Lists and filters Warp Connector Tunnels in an account. @@ -535,7 +535,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WARPConnectorDeleteResponse: """ Deletes a Warp Connector Tunnel from an account. @@ -579,14 +579,14 @@ async def edit( tunnel_id: str, *, account_id: str, - name: str | NotGiven = NOT_GIVEN, - tunnel_secret: str | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WARPConnectorEditResponse: """ Updates an existing Warp Connector Tunnel. @@ -647,7 +647,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WARPConnectorGetResponse: """ Fetches a single Warp Connector Tunnel. diff --git a/src/cloudflare/resources/zero_trust/zero_trust.py b/src/cloudflare/resources/zero_trust/zero_trust.py index a8de3d6cb8b..a027271c22e 100644 --- a/src/cloudflare/resources/zero_trust/zero_trust.py +++ b/src/cloudflare/resources/zero_trust/zero_trust.py @@ -76,6 +76,14 @@ ConnectivitySettingsResourceWithStreamingResponse, AsyncConnectivitySettingsResourceWithStreamingResponse, ) +from .connectivity.connectivity import ( + ConnectivityResource, + AsyncConnectivityResource, + ConnectivityResourceWithRawResponse, + AsyncConnectivityResourceWithRawResponse, + ConnectivityResourceWithStreamingResponse, + AsyncConnectivityResourceWithStreamingResponse, +) from .risk_scoring.risk_scoring import ( RiskScoringResource, AsyncRiskScoringResource, @@ -137,6 +145,10 @@ def tunnels(self) -> TunnelsResource: def connectivity_settings(self) -> ConnectivitySettingsResource: return ConnectivitySettingsResource(self._client) + @cached_property + def connectivity(self) -> ConnectivityResource: + return ConnectivityResource(self._client) + @cached_property def dlp(self) -> DLPResource: return DLPResource(self._client) @@ -206,6 +218,10 @@ def tunnels(self) -> AsyncTunnelsResource: def connectivity_settings(self) -> AsyncConnectivitySettingsResource: return AsyncConnectivitySettingsResource(self._client) + @cached_property + def connectivity(self) -> AsyncConnectivityResource: + return AsyncConnectivityResource(self._client) + @cached_property def dlp(self) -> AsyncDLPResource: return AsyncDLPResource(self._client) @@ -278,6 +294,10 @@ def tunnels(self) -> TunnelsResourceWithRawResponse: def connectivity_settings(self) -> ConnectivitySettingsResourceWithRawResponse: return ConnectivitySettingsResourceWithRawResponse(self._zero_trust.connectivity_settings) + @cached_property + def connectivity(self) -> ConnectivityResourceWithRawResponse: + return ConnectivityResourceWithRawResponse(self._zero_trust.connectivity) + @cached_property def dlp(self) -> DLPResourceWithRawResponse: return DLPResourceWithRawResponse(self._zero_trust.dlp) @@ -331,6 +351,10 @@ def tunnels(self) -> AsyncTunnelsResourceWithRawResponse: def connectivity_settings(self) -> AsyncConnectivitySettingsResourceWithRawResponse: return AsyncConnectivitySettingsResourceWithRawResponse(self._zero_trust.connectivity_settings) + @cached_property + def connectivity(self) -> AsyncConnectivityResourceWithRawResponse: + return AsyncConnectivityResourceWithRawResponse(self._zero_trust.connectivity) + @cached_property def dlp(self) -> AsyncDLPResourceWithRawResponse: return AsyncDLPResourceWithRawResponse(self._zero_trust.dlp) @@ -384,6 +408,10 @@ def tunnels(self) -> TunnelsResourceWithStreamingResponse: def connectivity_settings(self) -> ConnectivitySettingsResourceWithStreamingResponse: return ConnectivitySettingsResourceWithStreamingResponse(self._zero_trust.connectivity_settings) + @cached_property + def connectivity(self) -> ConnectivityResourceWithStreamingResponse: + return ConnectivityResourceWithStreamingResponse(self._zero_trust.connectivity) + @cached_property def dlp(self) -> DLPResourceWithStreamingResponse: return DLPResourceWithStreamingResponse(self._zero_trust.dlp) @@ -437,6 +465,10 @@ def tunnels(self) -> AsyncTunnelsResourceWithStreamingResponse: def connectivity_settings(self) -> AsyncConnectivitySettingsResourceWithStreamingResponse: return AsyncConnectivitySettingsResourceWithStreamingResponse(self._zero_trust.connectivity_settings) + @cached_property + def connectivity(self) -> AsyncConnectivityResourceWithStreamingResponse: + return AsyncConnectivityResourceWithStreamingResponse(self._zero_trust.connectivity) + @cached_property def dlp(self) -> AsyncDLPResourceWithStreamingResponse: return AsyncDLPResourceWithStreamingResponse(self._zero_trust.dlp) diff --git a/src/cloudflare/resources/zones/activation_check.py b/src/cloudflare/resources/zones/activation_check.py index cdfb29bb29e..8d829f2f272 100644 --- a/src/cloudflare/resources/zones/activation_check.py +++ b/src/cloudflare/resources/zones/activation_check.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -51,7 +51,7 @@ def trigger( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ActivationCheckTriggerResponse]: """Triggeres a new activation check for a PENDING Zone. @@ -113,7 +113,7 @@ async def trigger( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ActivationCheckTriggerResponse]: """Triggeres a new activation check for a PENDING Zone. diff --git a/src/cloudflare/resources/zones/custom_nameservers.py b/src/cloudflare/resources/zones/custom_nameservers.py index 149cbe50aa3..b4632a7aaf3 100644 --- a/src/cloudflare/resources/zones/custom_nameservers.py +++ b/src/cloudflare/resources/zones/custom_nameservers.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,14 +52,14 @@ def update( self, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, - ns_set: float | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[CustomNameserverUpdateResponse]: """ Set metadata for account-level custom nameservers on a zone. @@ -72,7 +72,7 @@ def update( [Update DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-a-zone-update-dns-settings). Args: - zone_id: Identifier + zone_id: Identifier. enabled: Whether zone uses account-level custom nameservers. @@ -117,7 +117,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomNameserverGetResponse: """ Get metadata for account-level custom nameservers on a zone. @@ -126,7 +126,7 @@ def get( [Show DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-a-zone-list-dns-settings). Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -174,14 +174,14 @@ def update( self, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, - ns_set: float | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[CustomNameserverUpdateResponse, AsyncSinglePage[CustomNameserverUpdateResponse]]: """ Set metadata for account-level custom nameservers on a zone. @@ -194,7 +194,7 @@ def update( [Update DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-a-zone-update-dns-settings). Args: - zone_id: Identifier + zone_id: Identifier. enabled: Whether zone uses account-level custom nameservers. @@ -239,7 +239,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomNameserverGetResponse: """ Get metadata for account-level custom nameservers on a zone. @@ -248,7 +248,7 @@ async def get( [Show DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-a-zone-list-dns-settings). Args: - zone_id: Identifier + zone_id: Identifier. extra_headers: Send extra headers @@ -275,12 +275,12 @@ def __init__(self, custom_nameservers: CustomNameserversResource) -> None: self.update = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - custom_nameservers.update # pyright: ignore[reportDeprecated], + custom_nameservers.update, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_raw_response_wrapper( - custom_nameservers.get # pyright: ignore[reportDeprecated], + custom_nameservers.get, # pyright: ignore[reportDeprecated], ) ) @@ -291,12 +291,12 @@ def __init__(self, custom_nameservers: AsyncCustomNameserversResource) -> None: self.update = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - custom_nameservers.update # pyright: ignore[reportDeprecated], + custom_nameservers.update, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_raw_response_wrapper( - custom_nameservers.get # pyright: ignore[reportDeprecated], + custom_nameservers.get, # pyright: ignore[reportDeprecated], ) ) @@ -307,12 +307,12 @@ def __init__(self, custom_nameservers: CustomNameserversResource) -> None: self.update = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - custom_nameservers.update # pyright: ignore[reportDeprecated], + custom_nameservers.update, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] to_streamed_response_wrapper( - custom_nameservers.get # pyright: ignore[reportDeprecated], + custom_nameservers.get, # pyright: ignore[reportDeprecated], ) ) @@ -323,11 +323,11 @@ def __init__(self, custom_nameservers: AsyncCustomNameserversResource) -> None: self.update = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - custom_nameservers.update # pyright: ignore[reportDeprecated], + custom_nameservers.update, # pyright: ignore[reportDeprecated], ) ) self.get = ( # pyright: ignore[reportDeprecated] async_to_streamed_response_wrapper( - custom_nameservers.get # pyright: ignore[reportDeprecated], + custom_nameservers.get, # pyright: ignore[reportDeprecated], ) ) diff --git a/src/cloudflare/resources/zones/holds.py b/src/cloudflare/resources/zones/holds.py index 431bf969ae0..788b8bf77d2 100644 --- a/src/cloudflare/resources/zones/holds.py +++ b/src/cloudflare/resources/zones/holds.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -48,13 +48,13 @@ def create( self, *, zone_id: str, - include_subdomains: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneHold: """ Enforce a zone hold on the zone, blocking the creation and activation of zones @@ -95,13 +95,13 @@ def delete( self, *, zone_id: str, - hold_after: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneHold: """ Stop enforcement of a zone hold on the zone, permanently or temporarily, @@ -141,14 +141,14 @@ def edit( self, *, zone_id: str, - hold_after: str | NotGiven = NOT_GIVEN, - include_subdomains: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneHold: """ Update the `hold_after` and/or `include_subdomains` values on an existing zone @@ -206,7 +206,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneHold: """ Retrieve whether the zone is subject to a zone hold, and metadata about the @@ -262,13 +262,13 @@ async def create( self, *, zone_id: str, - include_subdomains: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneHold: """ Enforce a zone hold on the zone, blocking the creation and activation of zones @@ -311,13 +311,13 @@ async def delete( self, *, zone_id: str, - hold_after: str | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneHold: """ Stop enforcement of a zone hold on the zone, permanently or temporarily, @@ -357,14 +357,14 @@ async def edit( self, *, zone_id: str, - hold_after: str | NotGiven = NOT_GIVEN, - include_subdomains: bool | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneHold: """ Update the `hold_after` and/or `include_subdomains` values on an existing zone @@ -422,7 +422,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ZoneHold: """ Retrieve whether the zone is subject to a zone hold, and metadata about the diff --git a/src/cloudflare/resources/zones/plans.py b/src/cloudflare/resources/zones/plans.py index 26cfd4738c0..907f8eb216d 100644 --- a/src/cloudflare/resources/zones/plans.py +++ b/src/cloudflare/resources/zones/plans.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -52,7 +52,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[AvailableRatePlan]: """ Lists available plans the zone can subscribe to. @@ -89,7 +89,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AvailableRatePlan: """ Details of the available plan that the zone can subscribe to. @@ -153,7 +153,7 @@ def list( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AvailableRatePlan, AsyncSinglePage[AvailableRatePlan]]: """ Lists available plans the zone can subscribe to. @@ -190,7 +190,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AvailableRatePlan: """ Details of the available plan that the zone can subscribe to. diff --git a/src/cloudflare/resources/zones/rate_plans.py b/src/cloudflare/resources/zones/rate_plans.py index daff981d93f..0cf59d0d07a 100644 --- a/src/cloudflare/resources/zones/rate_plans.py +++ b/src/cloudflare/resources/zones/rate_plans.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Query, Headers, NotGiven, not_given from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -49,7 +49,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[RatePlanGetResponse]: """ Lists all rate plans the zone can subscribe to. @@ -106,7 +106,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RatePlanGetResponse, AsyncSinglePage[RatePlanGetResponse]]: """ Lists all rate plans the zone can subscribe to. diff --git a/src/cloudflare/resources/zones/settings.py b/src/cloudflare/resources/zones/settings.py index 7067d6715ad..0c7fc85891b 100644 --- a/src/cloudflare/resources/zones/settings.py +++ b/src/cloudflare/resources/zones/settings.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -52,13 +52,13 @@ def edit( setting_id: str, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: """ Updates a single zone setting by the identifier @@ -86,13 +86,13 @@ def edit( setting_id: str, *, zone_id: str, - value: setting_edit_params.Variant1Value | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: """ Updates a single zone setting by the identifier @@ -120,14 +120,14 @@ def edit( setting_id: str, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, - value: setting_edit_params.Variant1Value | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -167,7 +167,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingGetResponse]: """ Fetch a single zone setting by name @@ -233,13 +233,13 @@ async def edit( setting_id: str, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: """ Updates a single zone setting by the identifier @@ -267,13 +267,13 @@ async def edit( setting_id: str, *, zone_id: str, - value: setting_edit_params.Variant1Value | NotGiven = NOT_GIVEN, + 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. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: """ Updates a single zone setting by the identifier @@ -301,14 +301,14 @@ async def edit( setting_id: str, *, zone_id: str, - enabled: bool | NotGiven = NOT_GIVEN, - value: setting_edit_params.Variant1Value | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") @@ -348,7 +348,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingGetResponse]: """ Fetch a single zone setting by name diff --git a/src/cloudflare/resources/zones/subscriptions.py b/src/cloudflare/resources/zones/subscriptions.py index d03a486b207..a2a2ac54732 100644 --- a/src/cloudflare/resources/zones/subscriptions.py +++ b/src/cloudflare/resources/zones/subscriptions.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -50,14 +50,14 @@ def create( self, *, zone_id: str, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Subscription: """ Create a zone subscription, either plan or add-ons. @@ -102,14 +102,14 @@ def update( self, *, zone_id: str, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Subscription: """ Updates zone subscriptions, either plan or add-ons. @@ -159,7 +159,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Subscription: """ Lists zone subscription details. @@ -214,14 +214,14 @@ async def create( self, *, zone_id: str, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Subscription: """ Create a zone subscription, either plan or add-ons. @@ -266,14 +266,14 @@ async def update( self, *, zone_id: str, - frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | NotGiven = NOT_GIVEN, - rate_plan: RatePlan | NotGiven = NOT_GIVEN, + 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. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Subscription: """ Updates zone subscriptions, either plan or add-ons. @@ -323,7 +323,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Subscription: """ Lists zone subscription details. diff --git a/src/cloudflare/resources/zones/zones.py b/src/cloudflare/resources/zones/zones.py index d89a8773961..ea3f6779233 100644 --- a/src/cloudflare/resources/zones/zones.py +++ b/src/cloudflare/resources/zones/zones.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type as TypingType, Optional, cast +from typing import Type as TypingType, Optional, cast from typing_extensions import Literal import httpx @@ -23,7 +23,7 @@ PlansResourceWithStreamingResponse, AsyncPlansResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from .settings import ( SettingsResource, @@ -137,13 +137,13 @@ def create( *, account: zone_create_params.Account, name: str, - type: ZonesType | NotGiven = NOT_GIVEN, + type: ZonesType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Zone]: """ Create Zone @@ -185,20 +185,20 @@ def create( def list( self, *, - account: zone_list_params.Account | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["name", "status", "account.id", "account.name", "plan.id"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["initializing", "pending", "active", "moved"] | NotGiven = NOT_GIVEN, + account: zone_list_params.Account | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + name: str | Omit = omit, + order: Literal["name", "status", "account.id", "account.name", "plan.id"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["initializing", "pending", "active", "moved"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[Zone]: """Lists, searches, sorts, and filters your zones. @@ -272,7 +272,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneDeleteResponse]: """ Deletes an existing zone. @@ -306,15 +306,15 @@ def edit( self, *, zone_id: str, - paused: bool | NotGiven = NOT_GIVEN, - type: Literal["full", "partial", "secondary", "internal"] | NotGiven = NOT_GIVEN, - vanity_name_servers: List[str] | NotGiven = NOT_GIVEN, + paused: bool | Omit = omit, + type: Literal["full", "partial", "secondary", "internal"] | Omit = omit, + vanity_name_servers: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Zone]: """Edits a zone. @@ -373,7 +373,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Zone]: """ Zone Details @@ -457,13 +457,13 @@ async def create( *, account: zone_create_params.Account, name: str, - type: ZonesType | NotGiven = NOT_GIVEN, + type: ZonesType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Zone]: """ Create Zone @@ -505,20 +505,20 @@ async def create( def list( self, *, - account: zone_list_params.Account | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["name", "status", "account.id", "account.name", "plan.id"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - status: Literal["initializing", "pending", "active", "moved"] | NotGiven = NOT_GIVEN, + account: zone_list_params.Account | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, + match: Literal["any", "all"] | Omit = omit, + name: str | Omit = omit, + order: Literal["name", "status", "account.id", "account.name", "plan.id"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + status: Literal["initializing", "pending", "active", "moved"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[Zone, AsyncV4PagePaginationArray[Zone]]: """Lists, searches, sorts, and filters your zones. @@ -592,7 +592,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneDeleteResponse]: """ Deletes an existing zone. @@ -626,15 +626,15 @@ async def edit( self, *, zone_id: str, - paused: bool | NotGiven = NOT_GIVEN, - type: Literal["full", "partial", "secondary", "internal"] | NotGiven = NOT_GIVEN, - vanity_name_servers: List[str] | NotGiven = NOT_GIVEN, + paused: bool | Omit = omit, + type: Literal["full", "partial", "secondary", "internal"] | Omit = omit, + vanity_name_servers: 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, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Zone]: """Edits a zone. @@ -693,7 +693,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Zone]: """ Zone Details 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 f80f35d4b9e..9d6ae29ffc0 100644 --- a/src/cloudflare/types/abuse_reports/abuse_report_create_params.py +++ b/src/cloudflare/types/abuse_reports/abuse_report_create_params.py @@ -11,7 +11,7 @@ "AbuseReportsTrademarkReport", "AbuseReportsGeneralReport", "AbuseReportsPhishingReport", - "AbuseReportsChildrenAbuseReport", + "AbuseReportsCsamReport", "AbuseReportsThreatReport", "AbuseReportsRegistrarWhoisReport", "AbuseReportsNcseiReport", @@ -21,163 +21,114 @@ class AbuseReportsDmcaReport(TypedDict, total=False): account_id: Required[str] - act: Required[ - Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ] - ] - """The abuse report type""" + act: Required[Literal["abuse_dmca"]] + """The report type for submitted reports.""" - email: Required[str] - """A valid email of the abuse reporter. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - email2: Required[str] - """Should match the value provided in `email`""" - - name: Required[str] - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - urls: Required[str] - """A list of valid URLs separated by ‘ ’ (new line character). - - The list of the URLs should not exceed 250 URLs. All URLs should have the same - hostname. Each URL should be unique. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - """ - - address1: str + address1: Required[str] """Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - agent_name: str + agent_name: Required[str] """The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - agree: Literal[0, 1] + agree: Required[Literal[1]] """Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports""" - city: str + city: Required[str] """Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - comments: str - """Any additional comments about the infringement not exceeding 2000 characters""" - - company: str - """Text not exceeding 100 characters. + country: Required[str] + """Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - country: str - """Text not exceeding 255 characters. + email: Required[str] + """A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - destination_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of destination IPs should not exceed 30 IP addresses. Each one of the - IP addresses ought to be unique - """ + email2: Required[str] + """Should match the value provided in `email`""" - host_notification: Literal["send", "send-anon", "none"] + host_notification: Required[Literal["send"]] """Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - justification: str - """ - A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - """ - - ncmec_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. + name: Required[str] + """Text not exceeding 255 characters. - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). """ - ncsei_subject_representation: bool - """If the submitter is the target of NCSEI in the URLs of the abuse report.""" - - original_work: str + original_work: Required[str] """Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - owner_notification: Literal["send", "send-anon", "none"] + owner_notification: Required[Literal["send"]] """Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - ports_protocols: str - """A comma separated list of ports and protocols e.g. - - 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. - Each individual port/protocol should not exceed 100 characters. The list should - not have more than 30 unique ports and protocols. - """ - - reported_country: str - """Text containing 2 characters""" - - reported_user_agent: str - """Text not exceeding 255 characters""" - - signature: str + signature: Required[str] """Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports """ - source_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). + state: Required[str] + """Text not exceeding 255 characters. - The list of source IPs should not exceed 30 IP addresses. Each one of the IP - addresses ought to be unique + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). """ - state: str - """Text not exceeding 255 characters. + urls: Required[str] + """A list of valid URLs separated by ‘\n’ (new line character). + + The list of the URLs should not exceed 250 URLs. All URLs should have the same + hostname. Each URL should be unique. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). + """ + + comments: str + """Any additional comments about the infringement not exceeding 2000 characters""" + + company: str + """Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ + reported_country: str + """Text containing 2 characters""" + + reported_user_agent: str + """Text not exceeding 255 characters""" + tele: str """Text not exceeding 20 characters. @@ -188,32 +139,12 @@ class AbuseReportsDmcaReport(TypedDict, total=False): title: str """Text not exceeding 255 characters""" - trademark_number: str - """Text not exceeding 1000 characters""" - - trademark_office: str - """Text not exceeding 1000 characters""" - - trademark_symbol: str - """Text not exceeding 1000 characters""" - class AbuseReportsTrademarkReport(TypedDict, total=False): account_id: Required[str] - act: Required[ - Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ] - ] - """The abuse report type""" + act: Required[Literal["abuse_trademark"]] + """The report type for submitted reports.""" email: Required[str] """A valid email of the abuse reporter. @@ -225,6 +156,19 @@ class AbuseReportsTrademarkReport(TypedDict, total=False): email2: Required[str] """Should match the value provided in `email`""" + host_notification: Required[Literal["send"]] + """Notification type based on the abuse type. + + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. + """ + + justification: Required[str] + """ + A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters. + """ + name: Required[str] """Text not exceeding 255 characters. @@ -232,95 +176,121 @@ class AbuseReportsTrademarkReport(TypedDict, total=False): Database (https://lumendatabase.org/). """ + owner_notification: Required[Literal["send"]] + """Notification type based on the abuse type. + + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. + """ + + trademark_number: Required[str] + """Text not exceeding 1000 characters""" + + trademark_office: Required[str] + """Text not exceeding 1000 characters""" + + trademark_symbol: Required[str] + """Text not exceeding 1000 characters""" + urls: Required[str] - """A list of valid URLs separated by ‘ ’ (new line character). + """A list of valid URLs separated by ‘\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - address1: str + comments: str + """Any additional comments about the infringement not exceeding 2000 characters""" + + company: str """Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - agent_name: str - """The name of the copyright holder. - - Text not exceeding 60 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - """ + reported_country: str + """Text containing 2 characters""" - agree: Literal[0, 1] - """Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports""" + reported_user_agent: str + """Text not exceeding 255 characters""" - city: str - """Text not exceeding 255 characters. + tele: str + """Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - comments: str - """Any additional comments about the infringement not exceeding 2000 characters""" + title: str + """Text not exceeding 255 characters""" - company: str - """Text not exceeding 100 characters. - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ +class AbuseReportsGeneralReport(TypedDict, total=False): + account_id: Required[str] - country: str - """Text not exceeding 255 characters. + act: Required[Literal["abuse_general"]] + """The report type for submitted reports.""" + + email: Required[str] + """A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - destination_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of destination IPs should not exceed 30 IP addresses. Each one of the - IP addresses ought to be unique - """ + email2: Required[str] + """Should match the value provided in `email`""" - host_notification: Literal["send", "send-anon", "none"] + host_notification: Required[Literal["send", "send-anon"]] """Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - justification: str + justification: Required[str] """ A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 - characters + characters. + """ + + name: Required[str] + """Text not exceeding 255 characters. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). """ - ncmec_notification: Literal["send", "send-anon", "none"] + owner_notification: Required[Literal["send", "send-anon", "none"]] """Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - ncsei_subject_representation: bool - """If the submitter is the target of NCSEI in the URLs of the abuse report.""" + urls: Required[str] + """A list of valid URLs separated by ‘\n’ (new line character). - original_work: str - """Text not exceeding 255 characters. + The list of the URLs should not exceed 250 URLs. All URLs should have the same + hostname. Each URL should be unique. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). + """ + + comments: str + """Any additional comments about the infringement not exceeding 2000 characters""" + + company: str + """Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - owner_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. + destination_ips: str + """A list of IP addresses separated by ‘\n’ (new line character). - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. + The list of destination IPs should not exceed 30 IP addresses. Each one of the + IP addresses ought to be unique. """ ports_protocols: str @@ -337,25 +307,11 @@ class AbuseReportsTrademarkReport(TypedDict, total=False): reported_user_agent: str """Text not exceeding 255 characters""" - signature: str - """Required for DMCA reports, should be same as Name. - - An affirmation that all information in the report is true and accurate while - agreeing to the policies of Cloudflare's abuse reports - """ - source_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). + """A list of IP addresses separated by ‘\n’ (new line character). The list of source IPs should not exceed 30 IP addresses. Each one of the IP - addresses ought to be unique - """ - - state: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). + addresses ought to be unique. """ tele: str @@ -368,32 +324,12 @@ class AbuseReportsTrademarkReport(TypedDict, total=False): title: str """Text not exceeding 255 characters""" - trademark_number: str - """Text not exceeding 1000 characters""" - - trademark_office: str - """Text not exceeding 1000 characters""" - - trademark_symbol: str - """Text not exceeding 1000 characters""" - -class AbuseReportsGeneralReport(TypedDict, total=False): +class AbuseReportsPhishingReport(TypedDict, total=False): account_id: Required[str] - act: Required[ - Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ] - ] - """The abuse report type""" + act: Required[Literal["abuse_phishing"]] + """The report type for submitted reports.""" email: Required[str] """A valid email of the abuse reporter. @@ -405,43 +341,38 @@ class AbuseReportsGeneralReport(TypedDict, total=False): email2: Required[str] """Should match the value provided in `email`""" - name: Required[str] - """Text not exceeding 255 characters. + host_notification: Required[Literal["send", "send-anon"]] + """Notification type based on the abuse type. - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - urls: Required[str] - """A list of valid URLs separated by ‘ ’ (new line character). - - The list of the URLs should not exceed 250 URLs. All URLs should have the same - hostname. Each URL should be unique. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + justification: Required[str] + """ + A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters. """ - address1: str - """Text not exceeding 100 characters. + name: Required[str] + """Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - agent_name: str - """The name of the copyright holder. + owner_notification: Required[Literal["send", "send-anon"]] + """Notification type based on the abuse type. - Text not exceeding 60 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - agree: Literal[0, 1] - """Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports""" - - city: str - """Text not exceeding 255 characters. + urls: Required[str] + """A list of valid URLs separated by ‘\n’ (new line character). - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). + The list of the URLs should not exceed 250 URLs. All URLs should have the same + hostname. Each URL should be unique. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). """ comments: str @@ -454,486 +385,35 @@ class AbuseReportsGeneralReport(TypedDict, total=False): Database (https://lumendatabase.org/). """ - country: str + original_work: str """Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - destination_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). + reported_country: str + """Text containing 2 characters""" - The list of destination IPs should not exceed 30 IP addresses. Each one of the - IP addresses ought to be unique - """ + reported_user_agent: str + """Text not exceeding 255 characters""" - host_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. + tele: str + """Text not exceeding 20 characters. - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). """ - justification: str - """ - A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - """ + title: str + """Text not exceeding 255 characters""" - ncmec_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - ncsei_subject_representation: bool - """If the submitter is the target of NCSEI in the URLs of the abuse report.""" - - original_work: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - owner_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - ports_protocols: str - """A comma separated list of ports and protocols e.g. - - 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. - Each individual port/protocol should not exceed 100 characters. The list should - not have more than 30 unique ports and protocols. - """ - - reported_country: str - """Text containing 2 characters""" - - reported_user_agent: str - """Text not exceeding 255 characters""" - - signature: str - """Required for DMCA reports, should be same as Name. - - An affirmation that all information in the report is true and accurate while - agreeing to the policies of Cloudflare's abuse reports - """ - - source_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of source IPs should not exceed 30 IP addresses. Each one of the IP - addresses ought to be unique - """ - - state: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - tele: str - """Text not exceeding 20 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - title: str - """Text not exceeding 255 characters""" - - trademark_number: str - """Text not exceeding 1000 characters""" - - trademark_office: str - """Text not exceeding 1000 characters""" - - trademark_symbol: str - """Text not exceeding 1000 characters""" - - -class AbuseReportsPhishingReport(TypedDict, total=False): - account_id: Required[str] - - act: Required[ - Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ] - ] - """The abuse report type""" - - email: Required[str] - """A valid email of the abuse reporter. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - email2: Required[str] - """Should match the value provided in `email`""" - - name: Required[str] - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - urls: Required[str] - """A list of valid URLs separated by ‘ ’ (new line character). - - The list of the URLs should not exceed 250 URLs. All URLs should have the same - hostname. Each URL should be unique. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - """ - - address1: str - """Text not exceeding 100 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - agent_name: str - """The name of the copyright holder. - - Text not exceeding 60 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - """ - - agree: Literal[0, 1] - """Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports""" - - city: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - comments: str - """Any additional comments about the infringement not exceeding 2000 characters""" - - company: str - """Text not exceeding 100 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - country: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - destination_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of destination IPs should not exceed 30 IP addresses. Each one of the - IP addresses ought to be unique - """ - - host_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - justification: str - """ - A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - """ - - ncmec_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - ncsei_subject_representation: bool - """If the submitter is the target of NCSEI in the URLs of the abuse report.""" - - original_work: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - owner_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - ports_protocols: str - """A comma separated list of ports and protocols e.g. - - 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. - Each individual port/protocol should not exceed 100 characters. The list should - not have more than 30 unique ports and protocols. - """ - - reported_country: str - """Text containing 2 characters""" - - reported_user_agent: str - """Text not exceeding 255 characters""" - - signature: str - """Required for DMCA reports, should be same as Name. - - An affirmation that all information in the report is true and accurate while - agreeing to the policies of Cloudflare's abuse reports - """ - - source_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of source IPs should not exceed 30 IP addresses. Each one of the IP - addresses ought to be unique - """ - - state: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - tele: str - """Text not exceeding 20 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - title: str - """Text not exceeding 255 characters""" - - trademark_number: str - """Text not exceeding 1000 characters""" - - trademark_office: str - """Text not exceeding 1000 characters""" - - trademark_symbol: str - """Text not exceeding 1000 characters""" - - -class AbuseReportsChildrenAbuseReport(TypedDict, total=False): - account_id: Required[str] - - act: Required[ - Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ] - ] - """The abuse report type""" - - email: Required[str] - """A valid email of the abuse reporter. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - email2: Required[str] - """Should match the value provided in `email`""" - - name: Required[str] - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - urls: Required[str] - """A list of valid URLs separated by ‘ ’ (new line character). - - The list of the URLs should not exceed 250 URLs. All URLs should have the same - hostname. Each URL should be unique. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - """ - - address1: str - """Text not exceeding 100 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - agent_name: str - """The name of the copyright holder. - - Text not exceeding 60 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - """ - - agree: Literal[0, 1] - """Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports""" - - city: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - comments: str - """Any additional comments about the infringement not exceeding 2000 characters""" - - company: str - """Text not exceeding 100 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - country: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - destination_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of destination IPs should not exceed 30 IP addresses. Each one of the - IP addresses ought to be unique - """ - - host_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - justification: str - """ - A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - """ - - ncmec_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - ncsei_subject_representation: bool - """If the submitter is the target of NCSEI in the URLs of the abuse report.""" - - original_work: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - owner_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - ports_protocols: str - """A comma separated list of ports and protocols e.g. - - 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. - Each individual port/protocol should not exceed 100 characters. The list should - not have more than 30 unique ports and protocols. - """ - - reported_country: str - """Text containing 2 characters""" - - reported_user_agent: str - """Text not exceeding 255 characters""" - - signature: str - """Required for DMCA reports, should be same as Name. - - An affirmation that all information in the report is true and accurate while - agreeing to the policies of Cloudflare's abuse reports - """ - - source_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of source IPs should not exceed 30 IP addresses. Each one of the IP - addresses ought to be unique - """ - - state: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - tele: str - """Text not exceeding 20 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - title: str - """Text not exceeding 255 characters""" - - trademark_number: str - """Text not exceeding 1000 characters""" - - trademark_office: str - """Text not exceeding 1000 characters""" - - trademark_symbol: str - """Text not exceeding 1000 characters""" - - -class AbuseReportsThreatReport(TypedDict, total=False): +class AbuseReportsCsamReport(TypedDict, total=False): account_id: Required[str] - act: Required[ - Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ] - ] - """The abuse report type""" + act: Required[Literal["abuse_children"]] + """The report type for submitted reports.""" email: Required[str] """A valid email of the abuse reporter. @@ -943,141 +423,71 @@ class AbuseReportsThreatReport(TypedDict, total=False): """ email2: Required[str] - """Should match the value provided in `email`""" - - name: Required[str] - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - urls: Required[str] - """A list of valid URLs separated by ‘ ’ (new line character). - - The list of the URLs should not exceed 250 URLs. All URLs should have the same - hostname. Each URL should be unique. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - """ - - address1: str - """Text not exceeding 100 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - agent_name: str - """The name of the copyright holder. - - Text not exceeding 60 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - """ - - agree: Literal[0, 1] - """Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports""" - - city: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - comments: str - """Any additional comments about the infringement not exceeding 2000 characters""" - - company: str - """Text not exceeding 100 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - country: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - destination_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of destination IPs should not exceed 30 IP addresses. Each one of the - IP addresses ought to be unique - """ - - host_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - justification: str - """ - A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - """ + """Should match the value provided in `email`""" - ncmec_notification: Literal["send", "send-anon", "none"] + host_notification: Required[Literal["send", "send-anon"]] """Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - ncsei_subject_representation: bool - """If the submitter is the target of NCSEI in the URLs of the abuse report.""" + justification: Required[str] + """ + A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters. + """ - original_work: str + name: Required[str] """Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - owner_notification: Literal["send", "send-anon", "none"] + ncmec_notification: Required[Literal["send", "send-anon"]] """Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - ports_protocols: str - """A comma separated list of ports and protocols e.g. + owner_notification: Required[Literal["send", "send-anon", "none"]] + """Notification type based on the abuse type. - 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. - Each individual port/protocol should not exceed 100 characters. The list should - not have more than 30 unique ports and protocols. + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - reported_country: str - """Text containing 2 characters""" - - reported_user_agent: str - """Text not exceeding 255 characters""" - - signature: str - """Required for DMCA reports, should be same as Name. + urls: Required[str] + """A list of valid URLs separated by ‘\n’ (new line character). - An affirmation that all information in the report is true and accurate while - agreeing to the policies of Cloudflare's abuse reports + The list of the URLs should not exceed 250 URLs. All URLs should have the same + hostname. Each URL should be unique. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). """ - source_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). + comments: str + """Any additional comments about the infringement not exceeding 2000 characters""" - The list of source IPs should not exceed 30 IP addresses. Each one of the IP - addresses ought to be unique + company: str + """Text not exceeding 100 characters. + + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). """ - state: str + country: str """Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ + reported_country: str + """Text containing 2 characters""" + + reported_user_agent: str + """Text not exceeding 255 characters""" + tele: str """Text not exceeding 20 characters. @@ -1088,32 +498,12 @@ class AbuseReportsThreatReport(TypedDict, total=False): title: str """Text not exceeding 255 characters""" - trademark_number: str - """Text not exceeding 1000 characters""" - - trademark_office: str - """Text not exceeding 1000 characters""" - - trademark_symbol: str - """Text not exceeding 1000 characters""" - -class AbuseReportsRegistrarWhoisReport(TypedDict, total=False): +class AbuseReportsThreatReport(TypedDict, total=False): account_id: Required[str] - act: Required[ - Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ] - ] - """The abuse report type""" + act: Required[Literal["abuse_threat"]] + """The report type for submitted reports.""" email: Required[str] """A valid email of the abuse reporter. @@ -1125,43 +515,38 @@ class AbuseReportsRegistrarWhoisReport(TypedDict, total=False): email2: Required[str] """Should match the value provided in `email`""" - name: Required[str] - """Text not exceeding 255 characters. + host_notification: Required[Literal["send", "send-anon"]] + """Notification type based on the abuse type. - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - urls: Required[str] - """A list of valid URLs separated by ‘ ’ (new line character). - - The list of the URLs should not exceed 250 URLs. All URLs should have the same - hostname. Each URL should be unique. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + justification: Required[str] + """ + A detailed description of the infringement, including any necessary access + details and the exact steps needed to view the content, not exceeding 5000 + characters. """ - address1: str - """Text not exceeding 100 characters. + name: Required[str] + """Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - agent_name: str - """The name of the copyright holder. + owner_notification: Required[Literal["send", "send-anon"]] + """Notification type based on the abuse type. - Text not exceeding 60 characters. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - agree: Literal[0, 1] - """Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports""" - - city: str - """Text not exceeding 255 characters. + urls: Required[str] + """A list of valid URLs separated by ‘\n’ (new line character). - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). + The list of the URLs should not exceed 250 URLs. All URLs should have the same + hostname. Each URL should be unique. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). """ comments: str @@ -1174,90 +559,76 @@ class AbuseReportsRegistrarWhoisReport(TypedDict, total=False): Database (https://lumendatabase.org/). """ - country: str - """Text not exceeding 255 characters. + reported_country: str + """Text containing 2 characters""" + + reported_user_agent: str + """Text not exceeding 255 characters""" + + tele: str + """Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - destination_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of destination IPs should not exceed 30 IP addresses. Each one of the - IP addresses ought to be unique - """ + title: str + """Text not exceeding 255 characters""" - host_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ +class AbuseReportsRegistrarWhoisReport(TypedDict, total=False): + account_id: Required[str] - justification: str - """ - A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - """ + act: Required[Literal["abuse_registrar_whois"]] + """The report type for submitted reports.""" - ncmec_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. + email: Required[str] + """A valid email of the abuse reporter. - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. + This field may be released by Cloudflare to third parties such as the Lumen + Database (https://lumendatabase.org/). """ - ncsei_subject_representation: bool - """If the submitter is the target of NCSEI in the URLs of the abuse report.""" + email2: Required[str] + """Should match the value provided in `email`""" - original_work: str + name: Required[str] """Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - owner_notification: Literal["send", "send-anon", "none"] + owner_notification: Required[Literal["send", "send-anon", "none"]] """Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - ports_protocols: str - """A comma separated list of ports and protocols e.g. - - 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. - Each individual port/protocol should not exceed 100 characters. The list should - not have more than 30 unique ports and protocols. - """ - - reported_country: str - """Text containing 2 characters""" - - reported_user_agent: str - """Text not exceeding 255 characters""" - - signature: str - """Required for DMCA reports, should be same as Name. + urls: Required[str] + """A list of valid URLs separated by ‘\n’ (new line character). - An affirmation that all information in the report is true and accurate while - agreeing to the policies of Cloudflare's abuse reports + The list of the URLs should not exceed 250 URLs. All URLs should have the same + hostname. Each URL should be unique. This field may be released by Cloudflare to + third parties such as the Lumen Database (https://lumendatabase.org/). """ - source_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of source IPs should not exceed 30 IP addresses. Each one of the IP - addresses ought to be unique - """ + comments: str + """Any additional comments about the infringement not exceeding 2000 characters""" - state: str - """Text not exceeding 255 characters. + company: str + """Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ + reported_country: str + """Text containing 2 characters""" + + reported_user_agent: str + """Text not exceeding 255 characters""" + tele: str """Text not exceeding 20 characters. @@ -1268,32 +639,12 @@ class AbuseReportsRegistrarWhoisReport(TypedDict, total=False): title: str """Text not exceeding 255 characters""" - trademark_number: str - """Text not exceeding 1000 characters""" - - trademark_office: str - """Text not exceeding 1000 characters""" - - trademark_symbol: str - """Text not exceeding 1000 characters""" - class AbuseReportsNcseiReport(TypedDict, total=False): account_id: Required[str] - act: Required[ - Literal[ - "abuse_dmca", - "abuse_trademark", - "abuse_general", - "abuse_phishing", - "abuse_children", - "abuse_threat", - "abuse_registrar_whois", - "abuse_ncsei", - ] - ] - """The abuse report type""" + act: Required[Literal["abuse_ncsei"]] + """The report type for submitted reports.""" email: Required[str] """A valid email of the abuse reporter. @@ -1305,6 +656,12 @@ class AbuseReportsNcseiReport(TypedDict, total=False): email2: Required[str] """Should match the value provided in `email`""" + host_notification: Required[Literal["send", "send-anon"]] + """Notification type based on the abuse type. + + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. + """ + name: Required[str] """Text not exceeding 255 characters. @@ -1312,38 +669,23 @@ class AbuseReportsNcseiReport(TypedDict, total=False): Database (https://lumendatabase.org/). """ - urls: Required[str] - """A list of valid URLs separated by ‘ ’ (new line character). - - The list of the URLs should not exceed 250 URLs. All URLs should have the same - hostname. Each URL should be unique. This field may be released by Cloudflare to - third parties such as the Lumen Database (https://lumendatabase.org/). - """ + ncsei_subject_representation: Required[bool] + """If the submitter is the target of NCSEI in the URLs of the abuse report.""" - address1: str - """Text not exceeding 100 characters. + owner_notification: Required[Literal["send", "send-anon", "none"]] + """Notification type based on the abuse type. - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). + NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. """ - agent_name: str - """The name of the copyright holder. + urls: Required[str] + """A list of valid URLs separated by ‘\n’ (new line character). - Text not exceeding 60 characters. This field may be released by Cloudflare to + The list of the URLs should not exceed 250 URLs. All URLs should have the same + hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). """ - agree: Literal[0, 1] - """Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports""" - - city: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - comments: str """Any additional comments about the infringement not exceeding 2000 characters""" @@ -1361,83 +703,12 @@ class AbuseReportsNcseiReport(TypedDict, total=False): Database (https://lumendatabase.org/). """ - destination_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of destination IPs should not exceed 30 IP addresses. Each one of the - IP addresses ought to be unique - """ - - host_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - justification: str - """ - A detailed description of the infringement, including any necessary access - details and the exact steps needed to view the content, not exceeding 5000 - characters - """ - - ncmec_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - ncsei_subject_representation: bool - """If the submitter is the target of NCSEI in the URLs of the abuse report.""" - - original_work: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - - owner_notification: Literal["send", "send-anon", "none"] - """Notification type based on the abuse type. - - NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. - """ - - ports_protocols: str - """A comma separated list of ports and protocols e.g. - - 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. - Each individual port/protocol should not exceed 100 characters. The list should - not have more than 30 unique ports and protocols. - """ - reported_country: str """Text containing 2 characters""" reported_user_agent: str """Text not exceeding 255 characters""" - signature: str - """Required for DMCA reports, should be same as Name. - - An affirmation that all information in the report is true and accurate while - agreeing to the policies of Cloudflare's abuse reports - """ - - source_ips: str - """A list of IP addresses separated by ‘ ’ (new line character). - - The list of source IPs should not exceed 30 IP addresses. Each one of the IP - addresses ought to be unique - """ - - state: str - """Text not exceeding 255 characters. - - This field may be released by Cloudflare to third parties such as the Lumen - Database (https://lumendatabase.org/). - """ - tele: str """Text not exceeding 20 characters. @@ -1448,22 +719,13 @@ class AbuseReportsNcseiReport(TypedDict, total=False): title: str """Text not exceeding 255 characters""" - trademark_number: str - """Text not exceeding 1000 characters""" - - trademark_office: str - """Text not exceeding 1000 characters""" - - trademark_symbol: str - """Text not exceeding 1000 characters""" - AbuseReportCreateParams: TypeAlias = Union[ AbuseReportsDmcaReport, AbuseReportsTrademarkReport, AbuseReportsGeneralReport, AbuseReportsPhishingReport, - AbuseReportsChildrenAbuseReport, + AbuseReportsCsamReport, AbuseReportsThreatReport, AbuseReportsRegistrarWhoisReport, AbuseReportsNcseiReport, diff --git a/src/cloudflare/types/accounts/account.py b/src/cloudflare/types/accounts/account.py index d67b6537f33..af01c098a4b 100644 --- a/src/cloudflare/types/accounts/account.py +++ b/src/cloudflare/types/accounts/account.py @@ -2,10 +2,19 @@ from typing import Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["Account", "Settings"] +__all__ = ["Account", "ManagedBy", "Settings"] + + +class ManagedBy(BaseModel): + parent_org_id: Optional[str] = None + """ID of the parent Organization, if one exists""" + + parent_org_name: Optional[str] = None + """Name of the parent Organization, if one exists""" class Settings(BaseModel): @@ -26,8 +35,13 @@ class Account(BaseModel): name: str """Account name""" + type: Literal["standard", "enterprise"] + created_on: Optional[datetime] = None """Timestamp for the creation of the account""" + managed_by: Optional[ManagedBy] = None + """Parent container details""" + settings: Optional[Settings] = None """Account settings""" diff --git a/src/cloudflare/types/accounts/account_create_params.py b/src/cloudflare/types/accounts/account_create_params.py index 5829ccda550..1dd690a1012 100755 --- a/src/cloudflare/types/accounts/account_create_params.py +++ b/src/cloudflare/types/accounts/account_create_params.py @@ -11,12 +11,7 @@ class AccountCreateParams(TypedDict, total=False): name: Required[str] """Account name""" - type: Required[Literal["standard", "enterprise"]] - """the type of account being created. - - For self-serve customers, use standard. for enterprise customers, use - enterprise. - """ + type: Literal["standard", "enterprise"] unit: Unit """ diff --git a/src/cloudflare/types/accounts/account_update_params.py b/src/cloudflare/types/accounts/account_update_params.py index a5432fe7d70..86171d551c5 100644 --- a/src/cloudflare/types/accounts/account_update_params.py +++ b/src/cloudflare/types/accounts/account_update_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict -__all__ = ["AccountUpdateParams", "Settings"] +__all__ = ["AccountUpdateParams", "ManagedBy", "Settings"] class AccountUpdateParams(TypedDict, total=False): @@ -17,10 +17,19 @@ class AccountUpdateParams(TypedDict, total=False): name: Required[str] """Account name""" + type: Required[Literal["standard", "enterprise"]] + + managed_by: ManagedBy + """Parent container details""" + settings: Settings """Account settings""" +class ManagedBy(TypedDict, total=False): + pass + + class Settings(TypedDict, total=False): abuse_contact_email: str """Sets an abuse contact email to notify for abuse reports.""" diff --git a/src/cloudflare/types/accounts/logs/audit_list_params.py b/src/cloudflare/types/accounts/logs/audit_list_params.py index f5189cf45f4..1e5d7d15d09 100644 --- a/src/cloudflare/types/accounts/logs/audit_list_params.py +++ b/src/cloudflare/types/accounts/logs/audit_list_params.py @@ -6,6 +6,7 @@ from datetime import date from typing_extensions import Literal, Required, Annotated, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo __all__ = [ @@ -116,7 +117,7 @@ class AuditListParams(TypedDict, total=False): _AccountNameReservedKeywords = TypedDict( "_AccountNameReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -168,7 +169,7 @@ class ActorContext(_ActorContextReservedKeywords, total=False): _ActorEmailReservedKeywords = TypedDict( "_ActorEmailReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -181,7 +182,7 @@ class ActorEmail(_ActorEmailReservedKeywords, total=False): _ActorIDReservedKeywords = TypedDict( "_ActorIDReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -194,7 +195,7 @@ class ActorID(_ActorIDReservedKeywords, total=False): _ActorIPAddressReservedKeywords = TypedDict( "_ActorIPAddressReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -207,7 +208,7 @@ class ActorIPAddress(_ActorIPAddressReservedKeywords, total=False): _ActorTokenIDReservedKeywords = TypedDict( "_ActorTokenIDReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -220,7 +221,7 @@ class ActorTokenID(_ActorTokenIDReservedKeywords, total=False): _ActorTokenNameReservedKeywords = TypedDict( "_ActorTokenNameReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -246,7 +247,7 @@ class ActorType(_ActorTypeReservedKeywords, total=False): _AuditLogIDReservedKeywords = TypedDict( "_AuditLogIDReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -259,7 +260,7 @@ class AuditLogID(_AuditLogIDReservedKeywords, total=False): _RawCfRayIDReservedKeywords = TypedDict( "_RawCfRayIDReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -272,7 +273,7 @@ class RawCfRayID(_RawCfRayIDReservedKeywords, total=False): _RawMethodReservedKeywords = TypedDict( "_RawMethodReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -298,7 +299,7 @@ class RawStatusCode(_RawStatusCodeReservedKeywords, total=False): _RawURIReservedKeywords = TypedDict( "_RawURIReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -311,7 +312,7 @@ class RawURI(_RawURIReservedKeywords, total=False): _ResourceIDReservedKeywords = TypedDict( "_ResourceIDReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -324,7 +325,7 @@ class ResourceID(_ResourceIDReservedKeywords, total=False): _ResourceProductReservedKeywords = TypedDict( "_ResourceProductReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -350,7 +351,7 @@ class ResourceScope(_ResourceScopeReservedKeywords, total=False): _ResourceTypeReservedKeywords = TypedDict( "_ResourceTypeReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -363,7 +364,7 @@ class ResourceType(_ResourceTypeReservedKeywords, total=False): _ZoneIDReservedKeywords = TypedDict( "_ZoneIDReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) @@ -376,7 +377,7 @@ class ZoneID(_ZoneIDReservedKeywords, total=False): _ZoneNameReservedKeywords = TypedDict( "_ZoneNameReservedKeywords", { - "not": List[str], + "not": SequenceNotStr[str], }, total=False, ) diff --git a/src/cloudflare/types/accounts/member_create_params.py b/src/cloudflare/types/accounts/member_create_params.py index 2dc2d30e0ce..682b1358647 100644 --- a/src/cloudflare/types/accounts/member_create_params.py +++ b/src/cloudflare/types/accounts/member_create_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict +from ..._types import SequenceNotStr + __all__ = [ "MemberCreateParams", "IAMCreateMemberWithRoles", @@ -22,7 +24,7 @@ class IAMCreateMemberWithRoles(TypedDict, total=False): email: Required[str] """The contact email address of the user.""" - roles: Required[List[str]] + roles: Required[SequenceNotStr[str]] """Array of roles associated with this member.""" status: Literal["accepted", "pending"] diff --git a/src/cloudflare/types/accounts/token_create_params.py b/src/cloudflare/types/accounts/token_create_params.py index e94512a93f9..d7c334b6736 100644 --- a/src/cloudflare/types/accounts/token_create_params.py +++ b/src/cloudflare/types/accounts/token_create_params.py @@ -2,10 +2,11 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Union, Iterable from datetime import datetime from typing_extensions import Required, Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo from ..shared_params.token_policy import TokenPolicy from ..shared.token_condition_cidr_list import TokenConditionCIDRList @@ -38,14 +39,14 @@ class TokenCreateParams(TypedDict, total=False): _ConditionRequestIPReservedKeywords = TypedDict( "_ConditionRequestIPReservedKeywords", { - "in": List[TokenConditionCIDRList], + "in": SequenceNotStr[TokenConditionCIDRList], }, total=False, ) class ConditionRequestIP(_ConditionRequestIPReservedKeywords, total=False): - not_in: List[TokenConditionCIDRList] + not_in: SequenceNotStr[TokenConditionCIDRList] """List of IPv4/IPv6 CIDR addresses.""" diff --git a/src/cloudflare/types/accounts/token_update_params.py b/src/cloudflare/types/accounts/token_update_params.py index fe7ed0cf440..669b0b0fd69 100644 --- a/src/cloudflare/types/accounts/token_update_params.py +++ b/src/cloudflare/types/accounts/token_update_params.py @@ -2,10 +2,11 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Union, Iterable from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo from ..shared_params.token_policy import TokenPolicy from ..shared.token_condition_cidr_list import TokenConditionCIDRList @@ -23,9 +24,6 @@ class TokenUpdateParams(TypedDict, total=False): policies: Required[Iterable[TokenPolicy]] """List of access policies assigned to the token.""" - status: Required[Literal["active", "disabled", "expired"]] - """Status of the token.""" - condition: Condition expires_on: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] @@ -37,18 +35,21 @@ class TokenUpdateParams(TypedDict, total=False): not_before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """The time before which the token MUST NOT be accepted for processing.""" + status: Literal["active", "disabled", "expired"] + """Status of the token.""" + _ConditionRequestIPReservedKeywords = TypedDict( "_ConditionRequestIPReservedKeywords", { - "in": List[TokenConditionCIDRList], + "in": SequenceNotStr[TokenConditionCIDRList], }, total=False, ) class ConditionRequestIP(_ConditionRequestIPReservedKeywords, total=False): - not_in: List[TokenConditionCIDRList] + not_in: SequenceNotStr[TokenConditionCIDRList] """List of IPv4/IPv6 CIDR addresses.""" diff --git a/src/cloudflare/types/accounts/tokens/__init__.py b/src/cloudflare/types/accounts/tokens/__init__.py index bc8d7e3d210..249ef18bc57 100644 --- a/src/cloudflare/types/accounts/tokens/__init__.py +++ b/src/cloudflare/types/accounts/tokens/__init__.py @@ -3,5 +3,7 @@ from __future__ import annotations from .value_update_params import ValueUpdateParams as ValueUpdateParams +from .permission_group_get_params import PermissionGroupGetParams as PermissionGroupGetParams +from .permission_group_list_params import PermissionGroupListParams as PermissionGroupListParams from .permission_group_get_response import PermissionGroupGetResponse as PermissionGroupGetResponse from .permission_group_list_response import PermissionGroupListResponse as PermissionGroupListResponse diff --git a/src/cloudflare/types/accounts/tokens/permission_group_get_params.py b/src/cloudflare/types/accounts/tokens/permission_group_get_params.py new file mode 100644 index 00000000000..c91ca4db066 --- /dev/null +++ b/src/cloudflare/types/accounts/tokens/permission_group_get_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["PermissionGroupGetParams"] + + +class PermissionGroupGetParams(TypedDict, total=False): + account_id: Required[str] + """Account identifier tag.""" + + name: str + """Filter by the name of the permission group. The value must be URL-encoded.""" + + scope: str + """Filter by the scope of the permission group. The value must be URL-encoded.""" diff --git a/src/cloudflare/types/accounts/tokens/permission_group_get_response.py b/src/cloudflare/types/accounts/tokens/permission_group_get_response.py index f7b20d1bcfb..81d6a1d88ba 100644 --- a/src/cloudflare/types/accounts/tokens/permission_group_get_response.py +++ b/src/cloudflare/types/accounts/tokens/permission_group_get_response.py @@ -1,14 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from ...._models import BaseModel -__all__ = ["PermissionGroupGetResponse"] +__all__ = ["PermissionGroupGetResponse", "PermissionGroupGetResponseItem"] -class PermissionGroupGetResponse(BaseModel): +class PermissionGroupGetResponseItem(BaseModel): id: Optional[str] = None """Public ID.""" @@ -26,3 +26,6 @@ class PermissionGroupGetResponse(BaseModel): ] ] = None """Resources to which the Permission Group is scoped""" + + +PermissionGroupGetResponse: TypeAlias = List[PermissionGroupGetResponseItem] diff --git a/src/cloudflare/types/accounts/tokens/permission_group_list_params.py b/src/cloudflare/types/accounts/tokens/permission_group_list_params.py new file mode 100644 index 00000000000..3a3000cb8a6 --- /dev/null +++ b/src/cloudflare/types/accounts/tokens/permission_group_list_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["PermissionGroupListParams"] + + +class PermissionGroupListParams(TypedDict, total=False): + account_id: Required[str] + """Account identifier tag.""" + + name: str + """Filter by the name of the permission group. The value must be URL-encoded.""" + + scope: str + """Filter by the scope of the permission group. The value must be URL-encoded.""" diff --git a/src/cloudflare/types/addressing/address_map_create_params.py b/src/cloudflare/types/addressing/address_map_create_params.py index bef1dcc72a9..7437032d536 100644 --- a/src/cloudflare/types/addressing/address_map_create_params.py +++ b/src/cloudflare/types/addressing/address_map_create_params.py @@ -2,10 +2,11 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Required, TypedDict from .kind import Kind +from ..._types import SequenceNotStr __all__ = ["AddressMapCreateParams", "Membership"] @@ -27,7 +28,7 @@ class AddressMapCreateParams(TypedDict, total=False): map is enabled. """ - ips: List[str] + ips: SequenceNotStr[str] memberships: Iterable[Membership] """Zones and Accounts which will be assigned IPs on this Address Map. diff --git a/src/cloudflare/types/addressing/prefixes/bgp_prefix.py b/src/cloudflare/types/addressing/prefixes/bgp_prefix.py index 8260aa32d68..24bd9ef9d4a 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix.py +++ b/src/cloudflare/types/addressing/prefixes/bgp_prefix.py @@ -58,6 +58,14 @@ class BGPPrefix(BaseModel): asn_prepend_count: Optional[int] = None """Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute""" + auto_advertise_withdraw: Optional[bool] = None + """ + Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no + matching BGP prefix in the Magic routing table. When true, Cloudflare will + automatically withdraw the BGP prefix when there are no matching BGP routes, and + will resume advertising when there is at least one matching BGP route. + """ + bgp_signal_opts: Optional[BGPSignalOpts] = None cidr: Optional[str] = None @@ -68,10 +76,3 @@ class BGPPrefix(BaseModel): modified_at: Optional[datetime] = None on_demand: Optional[OnDemand] = None - - withdraw_if_no_route: Optional[bool] = None - """ - Controls whether the BGP prefix is automatically withdrawn when prefix is - withdrawn from Magic routing table (for Magic Transit customers using Direct - CNI) - """ 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 e7bba9bc9ef..f610ee9434f 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py +++ b/src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py @@ -17,15 +17,16 @@ class BGPPrefixEditParams(TypedDict, total=False): asn_prepend_count: int """Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute""" - on_demand: OnDemand - - withdraw_if_no_route: bool + auto_advertise_withdraw: bool """ - Controls whether the BGP prefix is automatically withdrawn when prefix is - withdrawn from Magic routing table (for Magic Transit customers using Direct - CNI) + Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no + matching BGP prefix in the Magic routing table. When true, Cloudflare will + automatically withdraw the BGP prefix when there are no matching BGP routes, and + will resume advertising when there is at least one matching BGP route. """ + on_demand: OnDemand + class OnDemand(TypedDict, total=False): advertised: bool diff --git a/src/cloudflare/types/ai/__init__.py b/src/cloudflare/types/ai/__init__.py index 4f495e50871..a3f839bac59 100644 --- a/src/cloudflare/types/ai/__init__.py +++ b/src/cloudflare/types/ai/__init__.py @@ -8,3 +8,5 @@ from .finetune_create_params import FinetuneCreateParams as FinetuneCreateParams from .finetune_list_response import FinetuneListResponse as FinetuneListResponse from .finetune_create_response import FinetuneCreateResponse as FinetuneCreateResponse +from .to_markdown_transform_params import ToMarkdownTransformParams as ToMarkdownTransformParams +from .to_markdown_transform_response import ToMarkdownTransformResponse as ToMarkdownTransformResponse diff --git a/src/cloudflare/types/ai/ai_run_params.py b/src/cloudflare/types/ai/ai_run_params.py index 098c0dc717e..ab8de67906c 100644 --- a/src/cloudflare/types/ai/ai_run_params.py +++ b/src/cloudflare/types/ai/ai_run_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable +from typing import Dict, Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict +from ..._types import SequenceNotStr + __all__ = [ "AIRunParams", "TextClassification", @@ -34,6 +36,7 @@ "Variant12", "Variant13", "Variant13Message", + "MultimodalEmbeddings", ] @@ -112,7 +115,7 @@ class TextToSpeech(TypedDict, total=False): class TextEmbeddings(TypedDict, total=False): account_id: Required[str] - text: Required[Union[str, List[str]]] + text: Required[Union[str, SequenceNotStr[str]]] """The text to embed""" @@ -316,7 +319,7 @@ class MessagesToolUnionMember0Parameters(TypedDict, total=False): type: Required[str] """The type of the parameters object (usually 'object').""" - required: List[str] + required: SequenceNotStr[str] """List of required parameter names.""" @@ -346,7 +349,7 @@ class MessagesToolFunctionFunctionParameters(TypedDict, total=False): type: Required[str] """The type of the parameters object (usually 'object').""" - required: List[str] + required: SequenceNotStr[str] """List of required parameter names.""" @@ -562,6 +565,15 @@ class Variant13Message(TypedDict, total=False): """The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').""" +class MultimodalEmbeddings(TypedDict, total=False): + account_id: Required[str] + + image: str + """Image in base64 encoded format.""" + + text: SequenceNotStr[str] + + AIRunParams: TypeAlias = Union[ TextClassification, TextToImage, @@ -577,4 +589,5 @@ class Variant13Message(TypedDict, total=False): ImageToText, Variant12, Variant13, + MultimodalEmbeddings, ] diff --git a/src/cloudflare/types/ai/ai_run_response.py b/src/cloudflare/types/ai/ai_run_response.py index 186727c5cdc..d9f7438d4c6 100644 --- a/src/cloudflare/types/ai/ai_run_response.py +++ b/src/cloudflare/types/ai/ai_run_response.py @@ -22,6 +22,7 @@ "Summarization", "ImageToText", "ImageTextToText", + "MultimodalEmbeddings", ] @@ -153,6 +154,12 @@ class ImageTextToText(BaseModel): description: Optional[str] = None +class MultimodalEmbeddings(BaseModel): + data: Optional[List[List[float]]] = None + + shape: Optional[List[float]] = None + + AIRunResponse: TypeAlias = Union[ List[TextClassification], object, @@ -166,4 +173,5 @@ class ImageTextToText(BaseModel): Summarization, ImageToText, ImageTextToText, + MultimodalEmbeddings, ] diff --git a/src/cloudflare/types/ai/finetunes/asset_create_response.py b/src/cloudflare/types/ai/finetunes/asset_create_response.py index eef3e2d7d2d..5647b5f222c 100644 --- a/src/cloudflare/types/ai/finetunes/asset_create_response.py +++ b/src/cloudflare/types/ai/finetunes/asset_create_response.py @@ -1,21 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from datetime import datetime - from ...._models import BaseModel __all__ = ["AssetCreateResponse"] class AssetCreateResponse(BaseModel): - id: str - - bucket_name: str - - created_at: datetime - - file_name: str - - finetune_id: str - - modified_at: datetime + success: bool diff --git a/src/cloudflare/types/ai/to_markdown_transform_params.py b/src/cloudflare/types/ai/to_markdown_transform_params.py new file mode 100644 index 00000000000..d966e7f5d7e --- /dev/null +++ b/src/cloudflare/types/ai/to_markdown_transform_params.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ToMarkdownTransformParams"] + + +class ToMarkdownTransformParams(TypedDict, total=False): + account_id: Required[str] diff --git a/src/cloudflare/types/ai/to_markdown_transform_response.py b/src/cloudflare/types/ai/to_markdown_transform_response.py new file mode 100644 index 00000000000..cae6ac94db4 --- /dev/null +++ b/src/cloudflare/types/ai/to_markdown_transform_response.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["ToMarkdownTransformResponse"] + + +class ToMarkdownTransformResponse(BaseModel): + data: str + + format: str + + mime_type: str = FieldInfo(alias="mimeType") + + name: str + + tokens: str diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py index 6f48d005f7d..ba7a62c80b7 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py @@ -1,12 +1,68 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from ..._models import BaseModel -__all__ = ["AIGatewayCreateResponse"] +__all__ = [ + "AIGatewayCreateResponse", + "DLP", + "DLPUnionMember0", + "DLPUnionMember1", + "DLPUnionMember1Policy", + "Otel", + "Stripe", + "StripeUsageEvent", +] + + +class DLPUnionMember0(BaseModel): + action: Literal["BLOCK", "FLAG"] + + enabled: bool + + profiles: List[str] + + +class DLPUnionMember1Policy(BaseModel): + id: str + + action: Literal["FLAG", "BLOCK"] + + check: List[Literal["REQUEST", "RESPONSE"]] + + enabled: bool + + profiles: List[str] + + +class DLPUnionMember1(BaseModel): + enabled: bool + + policies: List[DLPUnionMember1Policy] + + +DLP: TypeAlias = Union[DLPUnionMember0, DLPUnionMember1] + + +class Otel(BaseModel): + authorization: str + + headers: Dict[str, str] + + url: str + + +class StripeUsageEvent(BaseModel): + payload: str + + +class Stripe(BaseModel): + authorization: str + + usage_events: List[StripeUsageEvent] class AIGatewayCreateResponse(BaseModel): @@ -37,6 +93,8 @@ class AIGatewayCreateResponse(BaseModel): authentication: Optional[bool] = None + dlp: Optional[DLP] = None + log_management: Optional[int] = None log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] = None @@ -44,3 +102,9 @@ class AIGatewayCreateResponse(BaseModel): logpush: Optional[bool] = None logpush_public_key: Optional[str] = None + + otel: Optional[List[Otel]] = None + + store_id: Optional[str] = None + + stripe: Optional[Stripe] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py index b3bfb5e0092..88fd5a4a3d8 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py @@ -1,12 +1,68 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from ..._models import BaseModel -__all__ = ["AIGatewayDeleteResponse"] +__all__ = [ + "AIGatewayDeleteResponse", + "DLP", + "DLPUnionMember0", + "DLPUnionMember1", + "DLPUnionMember1Policy", + "Otel", + "Stripe", + "StripeUsageEvent", +] + + +class DLPUnionMember0(BaseModel): + action: Literal["BLOCK", "FLAG"] + + enabled: bool + + profiles: List[str] + + +class DLPUnionMember1Policy(BaseModel): + id: str + + action: Literal["FLAG", "BLOCK"] + + check: List[Literal["REQUEST", "RESPONSE"]] + + enabled: bool + + profiles: List[str] + + +class DLPUnionMember1(BaseModel): + enabled: bool + + policies: List[DLPUnionMember1Policy] + + +DLP: TypeAlias = Union[DLPUnionMember0, DLPUnionMember1] + + +class Otel(BaseModel): + authorization: str + + headers: Dict[str, str] + + url: str + + +class StripeUsageEvent(BaseModel): + payload: str + + +class Stripe(BaseModel): + authorization: str + + usage_events: List[StripeUsageEvent] class AIGatewayDeleteResponse(BaseModel): @@ -37,6 +93,8 @@ class AIGatewayDeleteResponse(BaseModel): authentication: Optional[bool] = None + dlp: Optional[DLP] = None + log_management: Optional[int] = None log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] = None @@ -44,3 +102,9 @@ class AIGatewayDeleteResponse(BaseModel): logpush: Optional[bool] = None logpush_public_key: Optional[str] = None + + otel: Optional[List[Otel]] = None + + store_id: Optional[str] = None + + stripe: Optional[Stripe] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py index ba3263f0cc8..61307db6563 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py @@ -1,12 +1,68 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from ..._models import BaseModel -__all__ = ["AIGatewayGetResponse"] +__all__ = [ + "AIGatewayGetResponse", + "DLP", + "DLPUnionMember0", + "DLPUnionMember1", + "DLPUnionMember1Policy", + "Otel", + "Stripe", + "StripeUsageEvent", +] + + +class DLPUnionMember0(BaseModel): + action: Literal["BLOCK", "FLAG"] + + enabled: bool + + profiles: List[str] + + +class DLPUnionMember1Policy(BaseModel): + id: str + + action: Literal["FLAG", "BLOCK"] + + check: List[Literal["REQUEST", "RESPONSE"]] + + enabled: bool + + profiles: List[str] + + +class DLPUnionMember1(BaseModel): + enabled: bool + + policies: List[DLPUnionMember1Policy] + + +DLP: TypeAlias = Union[DLPUnionMember0, DLPUnionMember1] + + +class Otel(BaseModel): + authorization: str + + headers: Dict[str, str] + + url: str + + +class StripeUsageEvent(BaseModel): + payload: str + + +class Stripe(BaseModel): + authorization: str + + usage_events: List[StripeUsageEvent] class AIGatewayGetResponse(BaseModel): @@ -37,6 +93,8 @@ class AIGatewayGetResponse(BaseModel): authentication: Optional[bool] = None + dlp: Optional[DLP] = None + log_management: Optional[int] = None log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] = None @@ -44,3 +102,9 @@ class AIGatewayGetResponse(BaseModel): logpush: Optional[bool] = None logpush_public_key: Optional[str] = None + + otel: Optional[List[Otel]] = None + + store_id: Optional[str] = None + + stripe: Optional[Stripe] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py index 882b4e684c2..6b91557946a 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py @@ -1,12 +1,68 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from ..._models import BaseModel -__all__ = ["AIGatewayListResponse"] +__all__ = [ + "AIGatewayListResponse", + "DLP", + "DLPUnionMember0", + "DLPUnionMember1", + "DLPUnionMember1Policy", + "Otel", + "Stripe", + "StripeUsageEvent", +] + + +class DLPUnionMember0(BaseModel): + action: Literal["BLOCK", "FLAG"] + + enabled: bool + + profiles: List[str] + + +class DLPUnionMember1Policy(BaseModel): + id: str + + action: Literal["FLAG", "BLOCK"] + + check: List[Literal["REQUEST", "RESPONSE"]] + + enabled: bool + + profiles: List[str] + + +class DLPUnionMember1(BaseModel): + enabled: bool + + policies: List[DLPUnionMember1Policy] + + +DLP: TypeAlias = Union[DLPUnionMember0, DLPUnionMember1] + + +class Otel(BaseModel): + authorization: str + + headers: Dict[str, str] + + url: str + + +class StripeUsageEvent(BaseModel): + payload: str + + +class Stripe(BaseModel): + authorization: str + + usage_events: List[StripeUsageEvent] class AIGatewayListResponse(BaseModel): @@ -37,6 +93,8 @@ class AIGatewayListResponse(BaseModel): authentication: Optional[bool] = None + dlp: Optional[DLP] = None + log_management: Optional[int] = None log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] = None @@ -44,3 +102,9 @@ class AIGatewayListResponse(BaseModel): logpush: Optional[bool] = None logpush_public_key: Optional[str] = None + + otel: Optional[List[Otel]] = None + + store_id: Optional[str] = None + + stripe: Optional[Stripe] = None 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 3408639a7d7..3de8cbc6e9d 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py @@ -2,10 +2,21 @@ from __future__ import annotations -from typing import Optional -from typing_extensions import Literal, Required, TypedDict +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict -__all__ = ["AIGatewayUpdateParams"] +from ..._types import SequenceNotStr + +__all__ = [ + "AIGatewayUpdateParams", + "DLP", + "DLPUnionMember0", + "DLPUnionMember1", + "DLPUnionMember1Policy", + "Otel", + "Stripe", + "StripeUsageEvent", +] class AIGatewayUpdateParams(TypedDict, total=False): @@ -25,6 +36,8 @@ class AIGatewayUpdateParams(TypedDict, total=False): authentication: bool + dlp: DLP + log_management: Optional[int] log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] @@ -32,3 +45,56 @@ class AIGatewayUpdateParams(TypedDict, total=False): logpush: bool logpush_public_key: Optional[str] + + otel: Optional[Iterable[Otel]] + + store_id: Optional[str] + + stripe: Optional[Stripe] + + +class DLPUnionMember0(TypedDict, total=False): + action: Required[Literal["BLOCK", "FLAG"]] + + enabled: Required[bool] + + profiles: Required[SequenceNotStr[str]] + + +class DLPUnionMember1Policy(TypedDict, total=False): + id: Required[str] + + action: Required[Literal["FLAG", "BLOCK"]] + + check: Required[List[Literal["REQUEST", "RESPONSE"]]] + + enabled: Required[bool] + + profiles: Required[SequenceNotStr[str]] + + +class DLPUnionMember1(TypedDict, total=False): + enabled: Required[bool] + + policies: Required[Iterable[DLPUnionMember1Policy]] + + +DLP: TypeAlias = Union[DLPUnionMember0, DLPUnionMember1] + + +class Otel(TypedDict, total=False): + authorization: Required[str] + + headers: Required[Dict[str, str]] + + url: Required[str] + + +class StripeUsageEvent(TypedDict, total=False): + payload: Required[str] + + +class Stripe(TypedDict, total=False): + authorization: Required[str] + + usage_events: Required[Iterable[StripeUsageEvent]] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py index 7f865b278ed..963a6d344a5 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py @@ -1,12 +1,68 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from ..._models import BaseModel -__all__ = ["AIGatewayUpdateResponse"] +__all__ = [ + "AIGatewayUpdateResponse", + "DLP", + "DLPUnionMember0", + "DLPUnionMember1", + "DLPUnionMember1Policy", + "Otel", + "Stripe", + "StripeUsageEvent", +] + + +class DLPUnionMember0(BaseModel): + action: Literal["BLOCK", "FLAG"] + + enabled: bool + + profiles: List[str] + + +class DLPUnionMember1Policy(BaseModel): + id: str + + action: Literal["FLAG", "BLOCK"] + + check: List[Literal["REQUEST", "RESPONSE"]] + + enabled: bool + + profiles: List[str] + + +class DLPUnionMember1(BaseModel): + enabled: bool + + policies: List[DLPUnionMember1Policy] + + +DLP: TypeAlias = Union[DLPUnionMember0, DLPUnionMember1] + + +class Otel(BaseModel): + authorization: str + + headers: Dict[str, str] + + url: str + + +class StripeUsageEvent(BaseModel): + payload: str + + +class Stripe(BaseModel): + authorization: str + + usage_events: List[StripeUsageEvent] class AIGatewayUpdateResponse(BaseModel): @@ -37,6 +93,8 @@ class AIGatewayUpdateResponse(BaseModel): authentication: Optional[bool] = None + dlp: Optional[DLP] = None + log_management: Optional[int] = None log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] = None @@ -44,3 +102,9 @@ class AIGatewayUpdateResponse(BaseModel): logpush: Optional[bool] = None logpush_public_key: Optional[str] = None + + otel: Optional[List[Otel]] = None + + store_id: Optional[str] = None + + stripe: Optional[Stripe] = None diff --git a/src/cloudflare/types/ai_gateway/dataset_create_params.py b/src/cloudflare/types/ai_gateway/dataset_create_params.py index 2a7ea74b080..8c558e8d20b 100644 --- a/src/cloudflare/types/ai_gateway/dataset_create_params.py +++ b/src/cloudflare/types/ai_gateway/dataset_create_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Union, Iterable from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["DatasetCreateParams", "Filter"] @@ -39,4 +41,4 @@ class Filter(TypedDict, total=False): operator: Required[Literal["eq", "contains", "lt", "gt"]] - value: Required[List[Union[str, float, bool]]] + value: Required[SequenceNotStr[Union[str, float, bool]]] diff --git a/src/cloudflare/types/ai_gateway/dataset_update_params.py b/src/cloudflare/types/ai_gateway/dataset_update_params.py index c076f464a34..78abca5484d 100644 --- a/src/cloudflare/types/ai_gateway/dataset_update_params.py +++ b/src/cloudflare/types/ai_gateway/dataset_update_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Union, Iterable from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["DatasetUpdateParams", "Filter"] @@ -42,4 +44,4 @@ class Filter(TypedDict, total=False): operator: Required[Literal["eq", "contains", "lt", "gt"]] - value: Required[List[Union[str, float, bool]]] + value: Required[SequenceNotStr[Union[str, float, bool]]] diff --git a/src/cloudflare/types/ai_gateway/evaluation_create_params.py b/src/cloudflare/types/ai_gateway/evaluation_create_params.py index 640a403fb1b..f434312dce7 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_create_params.py +++ b/src/cloudflare/types/ai_gateway/evaluation_create_params.py @@ -2,17 +2,18 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["EvaluationCreateParams"] class EvaluationCreateParams(TypedDict, total=False): account_id: Required[str] - dataset_ids: Required[List[str]] + dataset_ids: Required[SequenceNotStr[str]] - evaluation_type_ids: Required[List[str]] + evaluation_type_ids: Required[SequenceNotStr[str]] name: Required[str] diff --git a/src/cloudflare/types/ai_gateway/log_delete_params.py b/src/cloudflare/types/ai_gateway/log_delete_params.py index 0f7f4ca6c3c..2e516f34cb5 100644 --- a/src/cloudflare/types/ai_gateway/log_delete_params.py +++ b/src/cloudflare/types/ai_gateway/log_delete_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import Union, Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["LogDeleteParams", "Filter"] @@ -39,6 +41,7 @@ class Filter(TypedDict, total=False): "created_at", "request_content_type", "response_content_type", + "request_type", "success", "cached", "provider", @@ -51,14 +54,17 @@ class Filter(TypedDict, total=False): "duration", "feedback", "event_id", - "request_type", "metadata.key", "metadata.value", "prompts.prompt_id", "prompts.version_id", + "authentication", + "wholesale", + "compatibilityMode", + "dlp_action", ] ] operator: Required[Literal["eq", "neq", "contains", "lt", "gt"]] - value: Required[List[Union[Optional[str], float, bool]]] + value: Required[SequenceNotStr[Union[Optional[str], float, bool]]] diff --git a/src/cloudflare/types/ai_gateway/log_list_params.py b/src/cloudflare/types/ai_gateway/log_list_params.py index dbdf158649c..27c4229155c 100644 --- a/src/cloudflare/types/ai_gateway/log_list_params.py +++ b/src/cloudflare/types/ai_gateway/log_list_params.py @@ -2,10 +2,11 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import Union, Iterable, Optional from datetime import datetime from typing_extensions import Literal, Required, Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo __all__ = ["LogListParams", "Filter"] @@ -78,6 +79,7 @@ class Filter(TypedDict, total=False): "created_at", "request_content_type", "response_content_type", + "request_type", "success", "cached", "provider", @@ -90,14 +92,17 @@ class Filter(TypedDict, total=False): "duration", "feedback", "event_id", - "request_type", "metadata.key", "metadata.value", "prompts.prompt_id", "prompts.version_id", + "authentication", + "wholesale", + "compatibilityMode", + "dlp_action", ] ] operator: Required[Literal["eq", "neq", "contains", "lt", "gt"]] - value: Required[List[Union[Optional[str], float, bool]]] + value: Required[SequenceNotStr[Union[Optional[str], float, bool]]] diff --git a/src/cloudflare/types/alerting/destinations/pagerduty_delete_response.py b/src/cloudflare/types/alerting/destinations/pagerduty_delete_response.py index 958d795048c..2c80c20a3cc 100644 --- a/src/cloudflare/types/alerting/destinations/pagerduty_delete_response.py +++ b/src/cloudflare/types/alerting/destinations/pagerduty_delete_response.py @@ -4,31 +4,26 @@ from typing_extensions import Literal from ...._models import BaseModel -from ...shared.response_info import ResponseInfo -__all__ = ["PagerdutyDeleteResponse", "ResultInfo"] +__all__ = ["PagerdutyDeleteResponse", "Error", "Message"] -class ResultInfo(BaseModel): - count: Optional[float] = None - """Total number of results for the requested service""" +class Error(BaseModel): + message: str - page: Optional[float] = None - """Current page within paginated list of results""" + code: Optional[int] = None - per_page: Optional[float] = None - """Number of results per page of results""" - total_count: Optional[float] = None - """Total results available without any search parameters""" +class Message(BaseModel): + message: str + + code: Optional[int] = None class PagerdutyDeleteResponse(BaseModel): - errors: List[ResponseInfo] + errors: List[Error] - messages: List[ResponseInfo] + messages: List[Message] success: Literal[True] """Whether the API call was successful""" - - result_info: Optional[ResultInfo] = None diff --git a/src/cloudflare/types/alerting/destinations/webhook_delete_response.py b/src/cloudflare/types/alerting/destinations/webhook_delete_response.py index eef159b9921..b35c98e70f7 100644 --- a/src/cloudflare/types/alerting/destinations/webhook_delete_response.py +++ b/src/cloudflare/types/alerting/destinations/webhook_delete_response.py @@ -4,31 +4,26 @@ from typing_extensions import Literal from ...._models import BaseModel -from ...shared.response_info import ResponseInfo -__all__ = ["WebhookDeleteResponse", "ResultInfo"] +__all__ = ["WebhookDeleteResponse", "Error", "Message"] -class ResultInfo(BaseModel): - count: Optional[float] = None - """Total number of results for the requested service""" +class Error(BaseModel): + message: str - page: Optional[float] = None - """Current page within paginated list of results""" + code: Optional[int] = None - per_page: Optional[float] = None - """Number of results per page of results""" - total_count: Optional[float] = None - """Total results available without any search parameters""" +class Message(BaseModel): + message: str + + code: Optional[int] = None class WebhookDeleteResponse(BaseModel): - errors: List[ResponseInfo] + errors: List[Error] - messages: List[ResponseInfo] + messages: List[Message] success: Literal[True] """Whether the API call was successful""" - - result_info: Optional[ResultInfo] = None diff --git a/src/cloudflare/types/alerting/destinations/webhooks.py b/src/cloudflare/types/alerting/destinations/webhooks.py index eba940eb89b..282b56790f3 100644 --- a/src/cloudflare/types/alerting/destinations/webhooks.py +++ b/src/cloudflare/types/alerting/destinations/webhooks.py @@ -35,7 +35,7 @@ class Webhooks(BaseModel): notification. """ - type: Optional[Literal["slack", "generic", "gchat"]] = None + type: Optional[Literal["datadog", "discord", "feishu", "gchat", "generic", "opsgenie", "slack", "splunk"]] = None """Type of webhook endpoint.""" url: Optional[str] = None diff --git a/src/cloudflare/types/alerting/policy.py b/src/cloudflare/types/alerting/policy.py index 290570aaa5b..39b85618e16 100644 --- a/src/cloudflare/types/alerting/policy.py +++ b/src/cloudflare/types/alerting/policy.py @@ -23,6 +23,7 @@ class Policy(BaseModel): alert_type: Optional[ Literal[ + "abuse_report_alert", "access_custom_certificate_expiration_type", "advanced_ddos_attack_l4_alert", "advanced_ddos_attack_l7_alert", diff --git a/src/cloudflare/types/alerting/policy_create_params.py b/src/cloudflare/types/alerting/policy_create_params.py index f9985eae2d6..f6922a4d71e 100644 --- a/src/cloudflare/types/alerting/policy_create_params.py +++ b/src/cloudflare/types/alerting/policy_create_params.py @@ -16,6 +16,7 @@ class PolicyCreateParams(TypedDict, total=False): alert_type: Required[ Literal[ + "abuse_report_alert", "access_custom_certificate_expiration_type", "advanced_ddos_attack_l4_alert", "advanced_ddos_attack_l7_alert", diff --git a/src/cloudflare/types/alerting/policy_delete_response.py b/src/cloudflare/types/alerting/policy_delete_response.py index d0feccf6ae2..c4ffa82754d 100644 --- a/src/cloudflare/types/alerting/policy_delete_response.py +++ b/src/cloudflare/types/alerting/policy_delete_response.py @@ -4,9 +4,20 @@ from typing_extensions import Literal from ..._models import BaseModel -from ..shared.response_info import ResponseInfo -__all__ = ["PolicyDeleteResponse", "ResultInfo"] +__all__ = ["PolicyDeleteResponse", "Error", "Message", "ResultInfo"] + + +class Error(BaseModel): + message: str + + code: Optional[int] = None + + +class Message(BaseModel): + message: str + + code: Optional[int] = None class ResultInfo(BaseModel): @@ -24,9 +35,9 @@ class ResultInfo(BaseModel): class PolicyDeleteResponse(BaseModel): - errors: List[ResponseInfo] + errors: List[Error] - messages: List[ResponseInfo] + messages: List[Message] success: Literal[True] """Whether the API call was successful""" diff --git a/src/cloudflare/types/alerting/policy_filter.py b/src/cloudflare/types/alerting/policy_filter.py index 199dc2862c2..c9804e52710 100644 --- a/src/cloudflare/types/alerting/policy_filter.py +++ b/src/cloudflare/types/alerting/policy_filter.py @@ -135,6 +135,9 @@ class PolicyFilter(BaseModel): tunnel_name: Optional[List[str]] = None """Usage depends on specific alert type""" + type: Optional[List[str]] = None + """Usage depends on specific alert type""" + where: Optional[List[str]] = None """Usage depends on specific alert type""" diff --git a/src/cloudflare/types/alerting/policy_filter_param.py b/src/cloudflare/types/alerting/policy_filter_param.py index 21f67ba264a..8ea62d1ad70 100644 --- a/src/cloudflare/types/alerting/policy_filter_param.py +++ b/src/cloudflare/types/alerting/policy_filter_param.py @@ -5,50 +5,52 @@ from typing import List from typing_extensions import Literal, TypedDict +from ..._types import SequenceNotStr + __all__ = ["PolicyFilterParam"] class PolicyFilterParam(TypedDict, total=False): - actions: List[str] + actions: SequenceNotStr[str] """Usage depends on specific alert type""" - affected_asns: List[str] + affected_asns: SequenceNotStr[str] """Used for configuring radar_notification""" - affected_components: List[str] + affected_components: SequenceNotStr[str] """Used for configuring incident_alert""" - affected_locations: List[str] + affected_locations: SequenceNotStr[str] """Used for configuring radar_notification""" - airport_code: List[str] + airport_code: SequenceNotStr[str] """Used for configuring maintenance_event_notification""" - alert_trigger_preferences: List[str] + alert_trigger_preferences: SequenceNotStr[str] """Usage depends on specific alert type""" - alert_trigger_preferences_value: List[str] + alert_trigger_preferences_value: SequenceNotStr[str] """Usage depends on specific alert type""" - enabled: List[str] + enabled: SequenceNotStr[str] """Used for configuring load_balancing_pool_enablement_alert""" - environment: List[str] + environment: SequenceNotStr[str] """Used for configuring pages_event_alert""" - event: List[str] + event: SequenceNotStr[str] """Used for configuring pages_event_alert""" - event_source: List[str] + event_source: SequenceNotStr[str] """Used for configuring load_balancing_health_alert""" - event_type: List[str] + event_type: SequenceNotStr[str] """Usage depends on specific alert type""" - group_by: List[str] + group_by: SequenceNotStr[str] """Usage depends on specific alert type""" - health_check_id: List[str] + health_check_id: SequenceNotStr[str] """Used for configuring health_check_status_notification""" incident_impact: List[ @@ -56,83 +58,86 @@ class PolicyFilterParam(TypedDict, total=False): ] """Used for configuring incident_alert""" - input_id: List[str] + input_id: SequenceNotStr[str] """Used for configuring stream_live_notifications""" - insight_class: List[str] + insight_class: SequenceNotStr[str] """Used for configuring security_insights_alert""" - limit: List[str] + limit: SequenceNotStr[str] """Used for configuring billing_usage_alert""" - logo_tag: List[str] + logo_tag: SequenceNotStr[str] """Used for configuring logo_match_alert""" - megabits_per_second: List[str] + megabits_per_second: SequenceNotStr[str] """Used for configuring advanced_ddos_attack_l4_alert""" - new_health: List[str] + new_health: SequenceNotStr[str] """Used for configuring load_balancing_health_alert""" - new_status: List[str] + new_status: SequenceNotStr[str] """Used for configuring tunnel_health_event""" - packets_per_second: List[str] + packets_per_second: SequenceNotStr[str] """Used for configuring advanced_ddos_attack_l4_alert""" - pool_id: List[str] + pool_id: SequenceNotStr[str] """Usage depends on specific alert type""" - pop_names: List[str] + pop_names: SequenceNotStr[str] """Usage depends on specific alert type""" - product: List[str] + product: SequenceNotStr[str] """Used for configuring billing_usage_alert""" - project_id: List[str] + project_id: SequenceNotStr[str] """Used for configuring pages_event_alert""" - protocol: List[str] + protocol: SequenceNotStr[str] """Used for configuring advanced_ddos_attack_l4_alert""" - query_tag: List[str] + query_tag: SequenceNotStr[str] """Usage depends on specific alert type""" - requests_per_second: List[str] + requests_per_second: SequenceNotStr[str] """Used for configuring advanced_ddos_attack_l7_alert""" - selectors: List[str] + selectors: SequenceNotStr[str] """Usage depends on specific alert type""" - services: List[str] + services: SequenceNotStr[str] """Used for configuring clickhouse_alert_fw_ent_anomaly""" - slo: List[str] + slo: SequenceNotStr[str] """Usage depends on specific alert type""" - status: List[str] + status: SequenceNotStr[str] """Used for configuring health_check_status_notification""" - target_hostname: List[str] + target_hostname: SequenceNotStr[str] """Used for configuring advanced_ddos_attack_l7_alert""" - target_ip: List[str] + target_ip: SequenceNotStr[str] """Used for configuring advanced_ddos_attack_l4_alert""" - target_zone_name: List[str] + target_zone_name: SequenceNotStr[str] """Used for configuring advanced_ddos_attack_l7_alert""" traffic_exclusions: List[Literal["security_events"]] """Used for configuring traffic_anomalies_alert""" - tunnel_id: List[str] + tunnel_id: SequenceNotStr[str] """Used for configuring tunnel_health_event""" - tunnel_name: List[str] + tunnel_name: SequenceNotStr[str] + """Usage depends on specific alert type""" + + type: SequenceNotStr[str] """Usage depends on specific alert type""" - where: List[str] + where: SequenceNotStr[str] """Usage depends on specific alert type""" - zones: List[str] + zones: SequenceNotStr[str] """Usage depends on specific alert type""" diff --git a/src/cloudflare/types/alerting/policy_update_params.py b/src/cloudflare/types/alerting/policy_update_params.py index 482bc0f7607..8f054e67fe3 100644 --- a/src/cloudflare/types/alerting/policy_update_params.py +++ b/src/cloudflare/types/alerting/policy_update_params.py @@ -21,6 +21,7 @@ class PolicyUpdateParams(TypedDict, total=False): """ alert_type: Literal[ + "abuse_report_alert", "access_custom_certificate_expiration_type", "advanced_ddos_attack_l4_alert", "advanced_ddos_attack_l7_alert", diff --git a/src/cloudflare/types/api_gateway/__init__.py b/src/cloudflare/types/api_gateway/__init__.py index bb1373799ba..8b30178b627 100644 --- a/src/cloudflare/types/api_gateway/__init__.py +++ b/src/cloudflare/types/api_gateway/__init__.py @@ -19,13 +19,11 @@ from .operation_list_response import OperationListResponse as OperationListResponse from .user_schema_edit_params import UserSchemaEditParams as UserSchemaEditParams from .user_schema_list_params import UserSchemaListParams as UserSchemaListParams -from .configuration_get_params import ConfigurationGetParams as ConfigurationGetParams from .operation_create_response import OperationCreateResponse as OperationCreateResponse from .operation_delete_response import OperationDeleteResponse as OperationDeleteResponse from .user_schema_create_params import UserSchemaCreateParams as UserSchemaCreateParams from .configuration_update_params import ConfigurationUpdateParams as ConfigurationUpdateParams from .user_schema_delete_response import UserSchemaDeleteResponse as UserSchemaDeleteResponse from .operation_bulk_create_params import OperationBulkCreateParams as OperationBulkCreateParams -from .configuration_update_response import ConfigurationUpdateResponse as ConfigurationUpdateResponse from .operation_bulk_create_response import OperationBulkCreateResponse as OperationBulkCreateResponse from .operation_bulk_delete_response import OperationBulkDeleteResponse as OperationBulkDeleteResponse diff --git a/src/cloudflare/types/api_gateway/configuration_get_params.py b/src/cloudflare/types/api_gateway/configuration_get_params.py deleted file mode 100644 index be75145cb97..00000000000 --- a/src/cloudflare/types/api_gateway/configuration_get_params.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["ConfigurationGetParams"] - - -class ConfigurationGetParams(TypedDict, total=False): - zone_id: Required[str] - """Identifier.""" - - properties: List[Literal["auth_id_characteristics"]] - """Requests information about certain properties.""" diff --git a/src/cloudflare/types/api_gateway/configuration_update_response.py b/src/cloudflare/types/api_gateway/configuration_update_response.py deleted file mode 100644 index 91b789cf066..00000000000 --- a/src/cloudflare/types/api_gateway/configuration_update_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from .message import Message -from ..._models import BaseModel - -__all__ = ["ConfigurationUpdateResponse"] - - -class ConfigurationUpdateResponse(BaseModel): - errors: Message - - messages: Message - - success: Literal[True] - """Whether the API call was successful.""" 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 72cad890202..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,9 +2,10 @@ from __future__ import annotations -from typing import List from typing_extensions import Literal, Required, TypedDict +from ...._types import SequenceNotStr + __all__ = ["OperationListParams"] @@ -24,10 +25,10 @@ class OperationListParams(TypedDict, total=False): endpoint: str """Filter results to only include endpoints containing this pattern.""" - host: List[str] + host: SequenceNotStr[str] """Filter results to only include the specified hosts.""" - method: List[str] + method: SequenceNotStr[str] """Filter results to only include the specified HTTP methods.""" order: Literal["host", "method", "endpoint", "traffic_stats.requests", "traffic_stats.last_updated"] 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 bac1f6b7a63..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 @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from ...._types import SequenceNotStr + __all__ = ["FallthroughCreateParams"] @@ -12,5 +13,5 @@ class FallthroughCreateParams(TypedDict, total=False): zone_id: Required[str] """Identifier.""" - hosts: Required[List[str]] + hosts: Required[SequenceNotStr[str]] """List of hosts to be targeted in the expression""" diff --git a/src/cloudflare/types/api_gateway/operation_list_params.py b/src/cloudflare/types/api_gateway/operation_list_params.py index 5e75c59f81d..4ecdcf5db5e 100644 --- a/src/cloudflare/types/api_gateway/operation_list_params.py +++ b/src/cloudflare/types/api_gateway/operation_list_params.py @@ -5,6 +5,8 @@ from typing import List from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["OperationListParams"] @@ -26,10 +28,10 @@ class OperationListParams(TypedDict, total=False): meaning. """ - host: List[str] + host: SequenceNotStr[str] """Filter results to only include the specified hosts.""" - method: List[str] + method: SequenceNotStr[str] """Filter results to only include the specified HTTP methods.""" order: Literal["method", "host", "endpoint", "thresholds.$key"] diff --git a/src/cloudflare/types/api_gateway/schema_list_params.py b/src/cloudflare/types/api_gateway/schema_list_params.py index 96a46cc7b98..b80273584a1 100644 --- a/src/cloudflare/types/api_gateway/schema_list_params.py +++ b/src/cloudflare/types/api_gateway/schema_list_params.py @@ -5,6 +5,8 @@ from typing import List from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["SchemaListParams"] @@ -20,5 +22,5 @@ class SchemaListParams(TypedDict, total=False): meaning. """ - host: List[str] + host: SequenceNotStr[str] """Receive schema only for the given host(s).""" 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 020477781e8..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 @@ -5,6 +5,8 @@ from typing import List from typing_extensions import Literal, Required, TypedDict +from ...._types import SequenceNotStr + __all__ = ["OperationListParams"] @@ -23,10 +25,10 @@ class OperationListParams(TypedDict, total=False): meaning. """ - host: List[str] + host: SequenceNotStr[str] """Filter results to only include the specified hosts.""" - method: List[str] + method: SequenceNotStr[str] """Filter results to only include the specified HTTP methods.""" operation_status: Literal["new", "existing"] diff --git a/src/cloudflare/types/argo/smart_routing_edit_params.py b/src/cloudflare/types/argo/smart_routing_edit_params.py index 44d5123b878..6a0817f9c6a 100644 --- a/src/cloudflare/types/argo/smart_routing_edit_params.py +++ b/src/cloudflare/types/argo/smart_routing_edit_params.py @@ -9,7 +9,7 @@ class SmartRoutingEditParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Specifies the zone associated with the API call.""" value: Required[Literal["on", "off"]] - """Enables Argo Smart Routing.""" + """Specifies the enablement value of Argo Smart Routing.""" diff --git a/src/cloudflare/types/argo/smart_routing_edit_response.py b/src/cloudflare/types/argo/smart_routing_edit_response.py index 7fa39d8d0ca..686c1ea1ba9 100644 --- a/src/cloudflare/types/argo/smart_routing_edit_response.py +++ b/src/cloudflare/types/argo/smart_routing_edit_response.py @@ -1,8 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional -from typing_extensions import TypeAlias +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel __all__ = ["SmartRoutingEditResponse"] -SmartRoutingEditResponse: TypeAlias = Union[Optional[str], Optional[object]] + +class SmartRoutingEditResponse(BaseModel): + id: str + """Specifies the identifier of the Argo Smart Routing setting.""" + + editable: bool + """Specifies if the setting is editable.""" + + value: Literal["on", "off"] + """Specifies the enablement value of Argo Smart Routing.""" + + modified_on: Optional[datetime] = None + """Specifies the time when the setting was last modified.""" diff --git a/src/cloudflare/types/argo/smart_routing_get_response.py b/src/cloudflare/types/argo/smart_routing_get_response.py index f65642d31d3..6249bb13ea2 100644 --- a/src/cloudflare/types/argo/smart_routing_get_response.py +++ b/src/cloudflare/types/argo/smart_routing_get_response.py @@ -1,8 +1,23 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional -from typing_extensions import TypeAlias +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel __all__ = ["SmartRoutingGetResponse"] -SmartRoutingGetResponse: TypeAlias = Union[Optional[str], Optional[object]] + +class SmartRoutingGetResponse(BaseModel): + id: str + """Specifies the identifier of the Argo Smart Routing setting.""" + + editable: bool + """Specifies if the setting is editable.""" + + value: Literal["on", "off"] + """Specifies the enablement value of Argo Smart Routing.""" + + modified_on: Optional[datetime] = None + """Specifies the time when the setting was last modified.""" diff --git a/src/cloudflare/types/argo/tiered_caching_edit_params.py b/src/cloudflare/types/argo/tiered_caching_edit_params.py index bab4bf2900c..1a1702873c2 100644 --- a/src/cloudflare/types/argo/tiered_caching_edit_params.py +++ b/src/cloudflare/types/argo/tiered_caching_edit_params.py @@ -9,7 +9,7 @@ class TieredCachingEditParams(TypedDict, total=False): zone_id: Required[str] - """Identifier""" + """Identifier.""" value: Required[Literal["on", "off"]] """Enables Tiered Caching.""" diff --git a/src/cloudflare/types/argo/tiered_caching_edit_response.py b/src/cloudflare/types/argo/tiered_caching_edit_response.py index dfabfbc67c2..88ed3325780 100644 --- a/src/cloudflare/types/argo/tiered_caching_edit_response.py +++ b/src/cloudflare/types/argo/tiered_caching_edit_response.py @@ -11,13 +11,13 @@ class TieredCachingEditResponse(BaseModel): id: Literal["tiered_caching"] - """ID of the zone setting.""" + """The identifier of the caching setting.""" editable: bool - """Whether the setting is editable""" + """Whether the setting is editable.""" value: Literal["on", "off"] - """The value of the feature""" + """Value of the Tiered Cache zone setting.""" modified_on: Optional[datetime] = None """Last time this setting was modified.""" diff --git a/src/cloudflare/types/argo/tiered_caching_get_response.py b/src/cloudflare/types/argo/tiered_caching_get_response.py index 8747f72e833..b4b468a63af 100644 --- a/src/cloudflare/types/argo/tiered_caching_get_response.py +++ b/src/cloudflare/types/argo/tiered_caching_get_response.py @@ -11,13 +11,13 @@ class TieredCachingGetResponse(BaseModel): id: Literal["tiered_caching"] - """ID of the zone setting.""" + """The identifier of the caching setting.""" editable: bool - """Whether the setting is editable""" + """Whether the setting is editable.""" value: Literal["on", "off"] - """The value of the feature""" + """Value of the Tiered Cache zone setting.""" modified_on: Optional[datetime] = None """Last time this setting was modified.""" 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 1321d2b5f99..7a88d1c7f01 100644 --- a/src/cloudflare/types/bot_management/bot_fight_mode_configuration.py +++ b/src/cloudflare/types/bot_management/bot_fight_mode_configuration.py @@ -35,8 +35,15 @@ class StaleZoneConfiguration(BaseModel): class BotFightModeConfiguration(BaseModel): - ai_bots_protection: Optional[Literal["block", "disabled"]] = None - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Optional[Literal["block", "disabled", "only_on_ad_pages"]] = None + """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: Optional[Literal["off", "policy_only"]] = None + """Specifies the Robots Access Control License variant to use.""" crawler_protection: Optional[Literal["enabled", "disabled"]] = None """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -50,6 +57,13 @@ class BotFightModeConfiguration(BaseModel): fight_mode: Optional[bool] = None """Whether to enable Bot Fight Mode.""" + is_robots_txt_managed: Optional[bool] = None + """Enable cloudflare managed robots.txt. + + If an existing robots.txt is detected, then managed robots.txt will be prepended + to the existing robots.txt. + """ + stale_zone_configuration: Optional[StaleZoneConfiguration] = None """ A read-only field that shows which unauthorized settings are currently active on 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 4eb28780e1e..64151a6bf71 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 @@ -8,8 +8,15 @@ class BotFightModeConfigurationParam(TypedDict, total=False): - ai_bots_protection: Literal["block", "disabled"] - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] + """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: Literal["off", "policy_only"] + """Specifies the Robots Access Control License variant to use.""" crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -22,3 +29,10 @@ class BotFightModeConfigurationParam(TypedDict, total=False): fight_mode: bool """Whether to enable Bot Fight Mode.""" + + is_robots_txt_managed: bool + """Enable cloudflare managed robots.txt. + + If an existing robots.txt is detected, then managed robots.txt will be prepended + to the existing robots.txt. + """ 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 447deb3c4c7..eeaf0a45fc3 100644 --- a/src/cloudflare/types/bot_management/bot_management_update_params.py +++ b/src/cloudflare/types/bot_management/bot_management_update_params.py @@ -18,8 +18,15 @@ class BotFightModeConfiguration(TypedDict, total=False): zone_id: Required[str] """Identifier.""" - ai_bots_protection: Literal["block", "disabled"] - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] + """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: Literal["off", "policy_only"] + """Specifies the Robots Access Control License variant to use.""" crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -33,13 +40,27 @@ class BotFightModeConfiguration(TypedDict, total=False): fight_mode: bool """Whether to enable Bot Fight Mode.""" + is_robots_txt_managed: bool + """Enable cloudflare managed robots.txt. + + If an existing robots.txt is detected, then managed robots.txt will be prepended + to the existing robots.txt. + """ + class SuperBotFightModeDefinitelyConfiguration(TypedDict, total=False): zone_id: Required[str] """Identifier.""" - ai_bots_protection: Literal["block", "disabled"] - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] + """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: Literal["off", "policy_only"] + """Specifies the Robots Access Control License variant to use.""" crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -50,6 +71,13 @@ class SuperBotFightModeDefinitelyConfiguration(TypedDict, total=False): [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). """ + is_robots_txt_managed: bool + """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: bool """Whether to optimize Super Bot Fight Mode protections for Wordpress.""" @@ -71,8 +99,15 @@ class SuperBotFightModeLikelyConfiguration(TypedDict, total=False): zone_id: Required[str] """Identifier.""" - ai_bots_protection: Literal["block", "disabled"] - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] + """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: Literal["off", "policy_only"] + """Specifies the Robots Access Control License variant to use.""" crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -83,6 +118,13 @@ class SuperBotFightModeLikelyConfiguration(TypedDict, total=False): [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). """ + is_robots_txt_managed: bool + """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: bool """Whether to optimize Super Bot Fight Mode protections for Wordpress.""" @@ -107,8 +149,12 @@ class SubscriptionConfiguration(TypedDict, total=False): zone_id: Required[str] """Identifier.""" - ai_bots_protection: Literal["block", "disabled"] - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] + """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: bool """ @@ -117,6 +163,15 @@ class SubscriptionConfiguration(TypedDict, total=False): [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) """ + bm_cookie_enabled: bool + """ + Indicates that the bot management cookie can be placed on end user devices + accessing the site. Defaults to true + """ + + cf_robots_variant: Literal["off", "policy_only"] + """Specifies the Robots Access Control License variant to use.""" + crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -126,6 +181,13 @@ class SubscriptionConfiguration(TypedDict, total=False): [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). """ + is_robots_txt_managed: bool + """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: bool """ Whether to disable tracking the highest bot score for a session in the Bot diff --git a/src/cloudflare/types/bot_management/subscription_configuration.py b/src/cloudflare/types/bot_management/subscription_configuration.py index 8a874700038..0ab062b7db6 100644 --- a/src/cloudflare/types/bot_management/subscription_configuration.py +++ b/src/cloudflare/types/bot_management/subscription_configuration.py @@ -35,8 +35,12 @@ class StaleZoneConfiguration(BaseModel): class SubscriptionConfiguration(BaseModel): - ai_bots_protection: Optional[Literal["block", "disabled"]] = None - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Optional[Literal["block", "disabled", "only_on_ad_pages"]] = None + """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: Optional[bool] = None """ @@ -45,6 +49,15 @@ class SubscriptionConfiguration(BaseModel): [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) """ + bm_cookie_enabled: Optional[bool] = None + """ + Indicates that the bot management cookie can be placed on end user devices + accessing the site. Defaults to true + """ + + cf_robots_variant: Optional[Literal["off", "policy_only"]] = None + """Specifies the Robots Access Control License variant to use.""" + crawler_protection: Optional[Literal["enabled", "disabled"]] = None """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -54,6 +67,13 @@ class SubscriptionConfiguration(BaseModel): [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). """ + is_robots_txt_managed: Optional[bool] = None + """Enable cloudflare managed robots.txt. + + If an existing robots.txt is detected, then managed robots.txt will be prepended + to the existing robots.txt. + """ + stale_zone_configuration: Optional[StaleZoneConfiguration] = None """ A read-only field that shows which unauthorized settings are currently active on diff --git a/src/cloudflare/types/bot_management/subscription_configuration_param.py b/src/cloudflare/types/bot_management/subscription_configuration_param.py index a58d9f30ac6..45ffd01599d 100644 --- a/src/cloudflare/types/bot_management/subscription_configuration_param.py +++ b/src/cloudflare/types/bot_management/subscription_configuration_param.py @@ -8,8 +8,12 @@ class SubscriptionConfigurationParam(TypedDict, total=False): - ai_bots_protection: Literal["block", "disabled"] - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] + """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: bool """ @@ -18,6 +22,15 @@ class SubscriptionConfigurationParam(TypedDict, total=False): [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) """ + bm_cookie_enabled: bool + """ + Indicates that the bot management cookie can be placed on end user devices + accessing the site. Defaults to true + """ + + cf_robots_variant: Literal["off", "policy_only"] + """Specifies the Robots Access Control License variant to use.""" + crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -27,6 +40,13 @@ class SubscriptionConfigurationParam(TypedDict, total=False): [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). """ + is_robots_txt_managed: bool + """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: bool """ Whether to disable tracking the highest bot score for a session in the Bot 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 63e9cbc33cf..6eb70d84e96 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 @@ -20,8 +20,15 @@ class StaleZoneConfiguration(BaseModel): class SuperBotFightModeDefinitelyConfiguration(BaseModel): - ai_bots_protection: Optional[Literal["block", "disabled"]] = None - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Optional[Literal["block", "disabled", "only_on_ad_pages"]] = None + """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: Optional[Literal["off", "policy_only"]] = None + """Specifies the Robots Access Control License variant to use.""" crawler_protection: Optional[Literal["enabled", "disabled"]] = None """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -32,6 +39,13 @@ class SuperBotFightModeDefinitelyConfiguration(BaseModel): [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). """ + is_robots_txt_managed: Optional[bool] = None + """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: Optional[bool] = None """Whether to optimize Super Bot Fight Mode protections for Wordpress.""" 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 d8b195afaf4..2ab93f1f5cf 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 @@ -8,8 +8,15 @@ class SuperBotFightModeDefinitelyConfigurationParam(TypedDict, total=False): - ai_bots_protection: Literal["block", "disabled"] - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] + """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: Literal["off", "policy_only"] + """Specifies the Robots Access Control License variant to use.""" crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -20,6 +27,13 @@ class SuperBotFightModeDefinitelyConfigurationParam(TypedDict, total=False): [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). """ + is_robots_txt_managed: bool + """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: bool """Whether to optimize Super Bot Fight Mode protections for Wordpress.""" 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 1547b01318c..653c0a35705 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 @@ -14,8 +14,15 @@ class StaleZoneConfiguration(BaseModel): class SuperBotFightModeLikelyConfiguration(BaseModel): - ai_bots_protection: Optional[Literal["block", "disabled"]] = None - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Optional[Literal["block", "disabled", "only_on_ad_pages"]] = None + """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: Optional[Literal["off", "policy_only"]] = None + """Specifies the Robots Access Control License variant to use.""" crawler_protection: Optional[Literal["enabled", "disabled"]] = None """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -26,6 +33,13 @@ class SuperBotFightModeLikelyConfiguration(BaseModel): [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). """ + is_robots_txt_managed: Optional[bool] = None + """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: Optional[bool] = None """Whether to optimize Super Bot Fight Mode protections for Wordpress.""" 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 6cb2e09143d..a219a368a2b 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 @@ -8,8 +8,15 @@ class SuperBotFightModeLikelyConfigurationParam(TypedDict, total=False): - ai_bots_protection: Literal["block", "disabled"] - """Enable rule to block AI Scrapers and Crawlers.""" + ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] + """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: Literal["off", "policy_only"] + """Specifies the Robots Access Control License variant to use.""" crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -20,6 +27,13 @@ class SuperBotFightModeLikelyConfigurationParam(TypedDict, total=False): [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). """ + is_robots_txt_managed: bool + """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: bool """Whether to optimize Super Bot Fight Mode protections for Wordpress.""" diff --git a/src/cloudflare/types/brand_protection/__init__.py b/src/cloudflare/types/brand_protection/__init__.py index 3fa7ed724bd..f6f5aa1c0fd 100644 --- a/src/cloudflare/types/brand_protection/__init__.py +++ b/src/cloudflare/types/brand_protection/__init__.py @@ -2,10 +2,18 @@ from __future__ import annotations -from .info import Info as Info -from .submit import Submit as Submit -from .rule_match import RuleMatch as RuleMatch -from .scan_status import ScanStatus as ScanStatus -from .url_info_model_results import URLInfoModelResults as URLInfoModelResults -from .brand_protection_submit_params import BrandProtectionSubmitParams as BrandProtectionSubmitParams -from .brand_protection_url_info_params import BrandProtectionURLInfoParams as BrandProtectionURLInfoParams +from .match_get_params import MatchGetParams as MatchGetParams +from .query_bulk_params import QueryBulkParams as QueryBulkParams +from .logo_create_params import LogoCreateParams as LogoCreateParams +from .match_get_response import MatchGetResponse as MatchGetResponse +from .query_create_params import QueryCreateParams as QueryCreateParams +from .query_delete_params import QueryDeleteParams as QueryDeleteParams +from .logo_create_response import LogoCreateResponse as LogoCreateResponse +from .logo_match_get_params import LogoMatchGetParams as LogoMatchGetParams +from .match_download_params import MatchDownloadParams as MatchDownloadParams +from .logo_match_get_response import LogoMatchGetResponse as LogoMatchGetResponse +from .match_download_response import MatchDownloadResponse as MatchDownloadResponse +from .logo_match_download_params import LogoMatchDownloadParams as LogoMatchDownloadParams +from .logo_match_download_response import LogoMatchDownloadResponse as LogoMatchDownloadResponse +from .brand_protection_submit_response import BrandProtectionSubmitResponse as BrandProtectionSubmitResponse +from .brand_protection_url_info_response import BrandProtectionURLInfoResponse as BrandProtectionURLInfoResponse diff --git a/src/cloudflare/types/brand_protection/brand_protection_submit_response.py b/src/cloudflare/types/brand_protection/brand_protection_submit_response.py new file mode 100644 index 00000000000..3254b97c4d0 --- /dev/null +++ b/src/cloudflare/types/brand_protection/brand_protection_submit_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional + +from ..._models import BaseModel + +__all__ = ["BrandProtectionSubmitResponse"] + + +class BrandProtectionSubmitResponse(BaseModel): + skipped_urls: Optional[List[Dict[str, object]]] = None + + submitted_urls: Optional[List[Dict[str, object]]] = None diff --git a/src/cloudflare/types/brand_protection/brand_protection_url_info_params.py b/src/cloudflare/types/brand_protection/brand_protection_url_info_params.py deleted file mode 100644 index 26a4bfa6d9e..00000000000 --- a/src/cloudflare/types/brand_protection/brand_protection_url_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BrandProtectionURLInfoParams"] - - -class BrandProtectionURLInfoParams(TypedDict, total=False): - account_id: Required[str] - """Identifier.""" - - url: List[str] - """Submission URL(s) to filter submission results by.""" - - url_id: Iterable[int] - """Submission ID(s) to filter submission results by.""" diff --git a/src/cloudflare/types/kv/namespaces/metadata_get_response.py b/src/cloudflare/types/brand_protection/brand_protection_url_info_response.py similarity index 58% rename from src/cloudflare/types/kv/namespaces/metadata_get_response.py rename to src/cloudflare/types/brand_protection/brand_protection_url_info_response.py index 74bf2b5c93e..25dd3de5a58 100644 --- a/src/cloudflare/types/kv/namespaces/metadata_get_response.py +++ b/src/cloudflare/types/brand_protection/brand_protection_url_info_response.py @@ -3,6 +3,6 @@ from typing import Dict from typing_extensions import TypeAlias -__all__ = ["MetadataGetResponse"] +__all__ = ["BrandProtectionURLInfoResponse"] -MetadataGetResponse: TypeAlias = Dict[str, object] +BrandProtectionURLInfoResponse: TypeAlias = Dict[str, object] diff --git a/src/cloudflare/types/brand_protection/info.py b/src/cloudflare/types/brand_protection/info.py deleted file mode 100644 index ecc27c62f00..00000000000 --- a/src/cloudflare/types/brand_protection/info.py +++ /dev/null @@ -1,46 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .rule_match import RuleMatch -from .scan_status import ScanStatus -from .url_info_model_results import URLInfoModelResults - -__all__ = ["Info", "Categorization"] - - -class Categorization(BaseModel): - category: Optional[str] = None - """Name of the category applied.""" - - verification_status: Optional[str] = None - """Result of human review for this categorization.""" - - -class Info(BaseModel): - categorizations: Optional[List[Categorization]] = None - """List of categorizations applied to this submission.""" - - ai_model_results: Optional[List[URLInfoModelResults]] = FieldInfo(alias="model_results", default=None) - """List of model results for completed scans.""" - - rule_matches: Optional[List[RuleMatch]] = None - """ - List of signatures that matched against site content found when crawling the - URL. - """ - - scan_status: Optional[ScanStatus] = None - """Status of the most recent scan found.""" - - screenshot_download_signature: Optional[str] = None - """For internal use.""" - - screenshot_path: Optional[str] = None - """For internal use.""" - - url: Optional[str] = None - """URL that was submitted.""" diff --git a/src/cloudflare/types/brand_protection/logo_create_params.py b/src/cloudflare/types/brand_protection/logo_create_params.py new file mode 100644 index 00000000000..2fd40da7f6b --- /dev/null +++ b/src/cloudflare/types/brand_protection/logo_create_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from ..._types import FileTypes + +__all__ = ["LogoCreateParams"] + + +class LogoCreateParams(TypedDict, total=False): + account_id: Required[str] + + match_type: str + + tag: str + + threshold: float + + image: FileTypes diff --git a/src/cloudflare/types/brand_protection/logo_create_response.py b/src/cloudflare/types/brand_protection/logo_create_response.py new file mode 100644 index 00000000000..d6a6055502f --- /dev/null +++ b/src/cloudflare/types/brand_protection/logo_create_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["LogoCreateResponse"] + + +class LogoCreateResponse(BaseModel): + id: Optional[int] = None + + tag: Optional[str] = None + + upload_path: Optional[str] = None diff --git a/src/cloudflare/types/brand_protection/logo_match_download_params.py b/src/cloudflare/types/brand_protection/logo_match_download_params.py new file mode 100644 index 00000000000..7d69d0c35a3 --- /dev/null +++ b/src/cloudflare/types/brand_protection/logo_match_download_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from ..._types import SequenceNotStr + +__all__ = ["LogoMatchDownloadParams"] + + +class LogoMatchDownloadParams(TypedDict, total=False): + account_id: Required[str] + + limit: str + + logo_id: SequenceNotStr[str] + + offset: str diff --git a/src/cloudflare/types/brand_protection/logo_match_download_response.py b/src/cloudflare/types/brand_protection/logo_match_download_response.py new file mode 100644 index 00000000000..494aeefcdd5 --- /dev/null +++ b/src/cloudflare/types/brand_protection/logo_match_download_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional + +from ..._models import BaseModel + +__all__ = ["LogoMatchDownloadResponse"] + + +class LogoMatchDownloadResponse(BaseModel): + matches: Optional[List[Dict[str, object]]] = None + + total: Optional[int] = None diff --git a/src/cloudflare/types/brand_protection/logo_match_get_params.py b/src/cloudflare/types/brand_protection/logo_match_get_params.py new file mode 100644 index 00000000000..19bc5dd4f9b --- /dev/null +++ b/src/cloudflare/types/brand_protection/logo_match_get_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from ..._types import SequenceNotStr + +__all__ = ["LogoMatchGetParams"] + + +class LogoMatchGetParams(TypedDict, total=False): + account_id: Required[str] + + limit: str + + logo_id: SequenceNotStr[str] + + offset: str diff --git a/src/cloudflare/types/brand_protection/logo_match_get_response.py b/src/cloudflare/types/brand_protection/logo_match_get_response.py new file mode 100644 index 00000000000..b61e431ad09 --- /dev/null +++ b/src/cloudflare/types/brand_protection/logo_match_get_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional + +from ..._models import BaseModel + +__all__ = ["LogoMatchGetResponse"] + + +class LogoMatchGetResponse(BaseModel): + matches: Optional[List[Dict[str, object]]] = None + + total: Optional[int] = None diff --git a/src/cloudflare/types/cloudforce_one/threat_events/insight_edit_params.py b/src/cloudflare/types/brand_protection/match_download_params.py similarity index 53% rename from src/cloudflare/types/cloudforce_one/threat_events/insight_edit_params.py rename to src/cloudflare/types/brand_protection/match_download_params.py index 5fd3dc33226..c9c1474e874 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/insight_edit_params.py +++ b/src/cloudflare/types/brand_protection/match_download_params.py @@ -4,14 +4,16 @@ from typing_extensions import Required, TypedDict -__all__ = ["InsightEditParams"] +__all__ = ["MatchDownloadParams"] -class InsightEditParams(TypedDict, total=False): +class MatchDownloadParams(TypedDict, total=False): account_id: Required[str] - """Account ID.""" - event_id: Required[str] - """Event UUID.""" + id: str - content: Required[str] + include_domain_id: bool + + limit: int + + offset: int diff --git a/src/cloudflare/types/brand_protection/match_download_response.py b/src/cloudflare/types/brand_protection/match_download_response.py new file mode 100644 index 00000000000..8f19d4deab4 --- /dev/null +++ b/src/cloudflare/types/brand_protection/match_download_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional + +from ..._models import BaseModel + +__all__ = ["MatchDownloadResponse"] + + +class MatchDownloadResponse(BaseModel): + matches: Optional[List[Dict[str, object]]] = None + + total: Optional[int] = None diff --git a/src/cloudflare/types/brand_protection/match_get_params.py b/src/cloudflare/types/brand_protection/match_get_params.py new file mode 100644 index 00000000000..e328903a3ec --- /dev/null +++ b/src/cloudflare/types/brand_protection/match_get_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["MatchGetParams"] + + +class MatchGetParams(TypedDict, total=False): + account_id: Required[str] + + id: str + + include_domain_id: bool + + limit: int + + offset: int diff --git a/src/cloudflare/types/brand_protection/match_get_response.py b/src/cloudflare/types/brand_protection/match_get_response.py new file mode 100644 index 00000000000..bdf7bfdcb6d --- /dev/null +++ b/src/cloudflare/types/brand_protection/match_get_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional + +from ..._models import BaseModel + +__all__ = ["MatchGetResponse"] + + +class MatchGetResponse(BaseModel): + matches: Optional[List[Dict[str, object]]] = None + + total: Optional[int] = None diff --git a/src/cloudflare/types/brand_protection/query_bulk_params.py b/src/cloudflare/types/brand_protection/query_bulk_params.py new file mode 100644 index 00000000000..6d03a6801e1 --- /dev/null +++ b/src/cloudflare/types/brand_protection/query_bulk_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["QueryBulkParams"] + + +class QueryBulkParams(TypedDict, total=False): + 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 new file mode 100644 index 00000000000..543c7bbbc71 --- /dev/null +++ b/src/cloudflare/types/brand_protection/query_create_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["QueryCreateParams"] + + +class QueryCreateParams(TypedDict, total=False): + account_id: Required[str] + + id: str + + query_scan: Annotated[bool, PropertyInfo(alias="scan")] + + query_tag: Annotated[str, PropertyInfo(alias="tag")] + + max_time: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + + min_time: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + + body_scan: Annotated[bool, PropertyInfo(alias="scan")] + + string_matches: object + + body_tag: Annotated[str, PropertyInfo(alias="tag")] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/insight_create_params.py b/src/cloudflare/types/brand_protection/query_delete_params.py similarity index 60% rename from src/cloudflare/types/cloudforce_one/threat_events/insight_create_params.py rename to src/cloudflare/types/brand_protection/query_delete_params.py index bcb266c36be..d4a095e924d 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/insight_create_params.py +++ b/src/cloudflare/types/brand_protection/query_delete_params.py @@ -4,11 +4,14 @@ from typing_extensions import Required, TypedDict -__all__ = ["InsightCreateParams"] +__all__ = ["QueryDeleteParams"] -class InsightCreateParams(TypedDict, total=False): +class QueryDeleteParams(TypedDict, total=False): account_id: Required[str] - """Account ID.""" - content: Required[str] + id: str + + scan: bool + + tag: str diff --git a/src/cloudflare/types/brand_protection/rule_match.py b/src/cloudflare/types/brand_protection/rule_match.py deleted file mode 100644 index 00452de5674..00000000000 --- a/src/cloudflare/types/brand_protection/rule_match.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["RuleMatch"] - - -class RuleMatch(BaseModel): - banning: Optional[bool] = None - """For internal use.""" - - blocking: Optional[bool] = None - """For internal use.""" - - description: Optional[str] = None - """Description of the signature that matched.""" - - name: Optional[str] = None - """Name of the signature that matched.""" diff --git a/src/cloudflare/types/brand_protection/scan_status.py b/src/cloudflare/types/brand_protection/scan_status.py deleted file mode 100644 index 711de0b5ed6..00000000000 --- a/src/cloudflare/types/brand_protection/scan_status.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["ScanStatus"] - - -class ScanStatus(BaseModel): - last_processed: Optional[str] = None - """Timestamp of when the submission was processed.""" - - scan_complete: Optional[bool] = None - """For internal use.""" - - status_code: Optional[int] = None - """Status code that the crawler received when loading the submitted URL.""" - - submission_id: Optional[int] = None - """ID of the most recent submission.""" diff --git a/src/cloudflare/types/brand_protection/submit.py b/src/cloudflare/types/brand_protection/submit.py deleted file mode 100644 index e8d8ce9c0d1..00000000000 --- a/src/cloudflare/types/brand_protection/submit.py +++ /dev/null @@ -1,42 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["Submit", "ExcludedURL", "SkippedURL", "SubmittedURL"] - - -class ExcludedURL(BaseModel): - url: Optional[str] = None - """URL that was excluded.""" - - -class SkippedURL(BaseModel): - url: Optional[str] = None - """URL that was skipped.""" - - url_id: Optional[int] = None - """ID of the submission of that URL that is currently scanning.""" - - -class SubmittedURL(BaseModel): - url: Optional[str] = None - """URL that was submitted.""" - - url_id: Optional[int] = None - """ID assigned to this URL submission. Used to retrieve scanning results.""" - - -class Submit(BaseModel): - excluded_urls: Optional[List[ExcludedURL]] = None - """ - URLs that were excluded from scanning because their domain is in our no-scan - list. - """ - - skipped_urls: Optional[List[SkippedURL]] = None - """URLs that were skipped because the same URL is currently being scanned.""" - - submitted_urls: Optional[List[SubmittedURL]] = None - """URLs that were successfully submitted for scanning.""" diff --git a/src/cloudflare/types/brand_protection/url_info_model_results.py b/src/cloudflare/types/brand_protection/url_info_model_results.py deleted file mode 100644 index 009d47d14ca..00000000000 --- a/src/cloudflare/types/brand_protection/url_info_model_results.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["URLInfoModelResults"] - - -class URLInfoModelResults(BaseModel): - ai_model_name: Optional[str] = FieldInfo(alias="model_name", default=None) - """Name of the model.""" - - ai_model_score: Optional[float] = FieldInfo(alias="model_score", default=None) - """This is the score that is outputted by the model for this submission.""" diff --git a/src/cloudflare/types/browser_rendering/content_create_params.py b/src/cloudflare/types/browser_rendering/content_create_params.py index 2be0911683b..ef7f455ed1d 100644 --- a/src/cloudflare/types/browser_rendering/content_create_params.py +++ b/src/cloudflare/types/browser_rendering/content_create_params.py @@ -5,6 +5,7 @@ from typing import Dict, List, Union, Iterable from typing_extensions import Literal, Required, Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo __all__ = [ @@ -42,7 +43,7 @@ class ContentCreateParams(TypedDict, total=False): `